Search in sources :

Example 6 with InMemoryDOMDataStore

use of org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore in project controller by opendaylight.

the class AbstractModificationTest method setUp.

@Before
public void setUp() {
    store = new InMemoryDOMDataStore("test", MoreExecutors.newDirectExecutorService());
    store.onGlobalContextUpdated(TestModel.createTestContext());
}
Also used : InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore) Before(org.junit.Before)

Example 7 with InMemoryDOMDataStore

use of org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore in project controller by opendaylight.

the class BindingTestContext method startNewDomDataBroker.

public void startNewDomDataBroker() {
    checkState(this.executor != null, "Executor needs to be set");
    final InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.newDirectExecutorService());
    final InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.newDirectExecutorService());
    this.newDatastores = ImmutableMap.<LogicalDatastoreType, DOMStore>builder().put(LogicalDatastoreType.OPERATIONAL, operStore).put(LogicalDatastoreType.CONFIGURATION, configStore).build();
    this.newDOMDataBroker = new SerializedDOMDataBroker(this.newDatastores, this.executor);
    this.mockSchemaService.registerSchemaContextListener(configStore);
    this.mockSchemaService.registerSchemaContextListener(operStore);
}
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) SerializedDOMDataBroker(org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker)

Example 8 with InMemoryDOMDataStore

use of org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore in project controller by opendaylight.

the class InMemoryBrokerWriteTransactionBenchmark method setUp.

@Setup(Level.Trial)
@Override
public void setUp() throws Exception {
    ListeningExecutorService dsExec = MoreExecutors.newDirectExecutorService();
    executor = MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService((ThreadPoolExecutor) Executors.newFixedThreadPool(1), 1L, TimeUnit.SECONDS));
    InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", dsExec);
    InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", dsExec);
    Map<LogicalDatastoreType, DOMStore> datastores = ImmutableMap.of(LogicalDatastoreType.OPERATIONAL, (DOMStore) operStore, LogicalDatastoreType.CONFIGURATION, configStore);
    domBroker = new SerializedDOMDataBroker(datastores, executor);
    schemaContext = BenchmarkModel.createTestContext();
    configStore.onGlobalContextUpdated(schemaContext);
    operStore.onGlobalContextUpdated(schemaContext);
    initTestNode();
}
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) SerializedDOMDataBroker(org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker) Setup(org.openjdk.jmh.annotations.Setup)

Example 9 with InMemoryDOMDataStore

use of org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore in project controller by opendaylight.

the class InMemoryDataStoreWriteTransactionBenchmark method setUp.

@Override
@Setup(Level.Trial)
public void setUp() throws Exception {
    domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", Executors.newSingleThreadExecutor());
    schemaContext = BenchmarkModel.createTestContext();
    domStore.onGlobalContextUpdated(schemaContext);
    initTestNode();
}
Also used : InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore) Setup(org.openjdk.jmh.annotations.Setup)

Example 10 with InMemoryDOMDataStore

use of org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore 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)

Aggregations

InMemoryDOMDataStore (org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore)13 LogicalDatastoreType (org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType)6 DOMStore (org.opendaylight.controller.sal.core.spi.data.DOMStore)6 Before (org.junit.Before)5 ListeningExecutorService (com.google.common.util.concurrent.ListeningExecutorService)3 Setup (org.openjdk.jmh.annotations.Setup)3 SerializedDOMDataBroker (org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker)2 InMemoryDataStoreStats (org.opendaylight.controller.md.sal.dom.store.impl.jmx.InMemoryDataStoreStats)2 DeadlockDetectingListeningExecutorService (org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService)2 ExecutorService (java.util.concurrent.ExecutorService)1