Search in sources :

Example 6 with DOMStore

use of org.opendaylight.controller.sal.core.spi.data.DOMStore in project controller by opendaylight.

the class DOMDataTreeListenerTest method setupStore.

@Before
public void setupStore() {
    InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.newDirectExecutorService());
    InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.newDirectExecutorService());
    schemaContext = TestModel.createTestContext();
    operStore.onGlobalContextUpdated(schemaContext);
    configStore.onGlobalContextUpdated(schemaContext);
    final ImmutableMap<LogicalDatastoreType, DOMStore> stores = ImmutableMap.<LogicalDatastoreType, DOMStore>builder().put(CONFIGURATION, // 
    configStore).put(OPERATIONAL, // 
    operStore).build();
    commitExecutor = new CommitExecutorService(Executors.newSingleThreadExecutor());
    futureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool(1, 5, "FCB", DOMDataTreeListenerTest.class);
    executor = new DeadlockDetectingListeningExecutorService(commitExecutor, TransactionCommitDeadlockException.DEADLOCK_EXCEPTION_SUPPLIER, futureExecutor);
    domBroker = new SerializedDOMDataBroker(stores, executor);
}
Also used : DOMStore(org.opendaylight.controller.sal.core.spi.data.DOMStore) InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) DeadlockDetectingListeningExecutorService(org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService) Before(org.junit.Before)

Example 7 with DOMStore

use of org.opendaylight.controller.sal.core.spi.data.DOMStore in project controller by opendaylight.

the class DOMTransactionChainTest method setupStore.

@Before
public void setupStore() {
    InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.newDirectExecutorService());
    InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.newDirectExecutorService());
    schemaContext = TestModel.createTestContext();
    operStore.onGlobalContextUpdated(schemaContext);
    configStore.onGlobalContextUpdated(schemaContext);
    ImmutableMap<LogicalDatastoreType, DOMStore> stores = // 
    ImmutableMap.<LogicalDatastoreType, DOMStore>builder().put(CONFIGURATION, // 
    configStore).put(OPERATIONAL, // 
    operStore).build();
    ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
    domBroker = new SerializedDOMDataBroker(stores, executor);
}
Also used : DOMStore(org.opendaylight.controller.sal.core.spi.data.DOMStore) InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore) ListeningExecutorService(com.google.common.util.concurrent.ListeningExecutorService) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) Before(org.junit.Before)

Example 8 with DOMStore

use of org.opendaylight.controller.sal.core.spi.data.DOMStore in project controller by opendaylight.

the class DOMBrokerPerformanceTest method setupStore.

@Before
public void setupStore() {
    InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.newDirectExecutorService());
    InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.newDirectExecutorService());
    schemaContext = TestModel.createTestContext();
    operStore.onGlobalContextUpdated(schemaContext);
    configStore.onGlobalContextUpdated(schemaContext);
    ImmutableMap<LogicalDatastoreType, DOMStore> stores = // 
    ImmutableMap.<LogicalDatastoreType, DOMStore>builder().put(CONFIGURATION, // 
    configStore).put(OPERATIONAL, // 
    operStore).build();
    ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
    domBroker = new SerializedDOMDataBroker(stores, executor);
}
Also used : DOMStore(org.opendaylight.controller.sal.core.spi.data.DOMStore) InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore) ListeningExecutorService(com.google.common.util.concurrent.ListeningExecutorService) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) Before(org.junit.Before)

Aggregations

DOMStore (org.opendaylight.controller.sal.core.spi.data.DOMStore)8 LogicalDatastoreType (org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType)7 InMemoryDOMDataStore (org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore)6 Before (org.junit.Before)4 ListeningExecutorService (com.google.common.util.concurrent.ListeningExecutorService)3 SerializedDOMDataBroker (org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker)3 DeadlockDetectingListeningExecutorService (org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService)3 EnumMap (java.util.EnumMap)1 ExecutorService (java.util.concurrent.ExecutorService)1 AbstractMXBean (org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean)1 CommitStatsMXBeanImpl (org.opendaylight.controller.md.sal.dom.broker.impl.jmx.CommitStatsMXBeanImpl)1 DurationStatisticsTracker (org.opendaylight.yangtools.util.DurationStatisticsTracker)1 Setup (org.openjdk.jmh.annotations.Setup)1