Search in sources :

Example 1 with InMemoryDOMDataStore

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

the class InMemoryDataStoreWithSameThreadedExecutorBenchmark method setUp.

@Override
@Setup(Level.Trial)
public void setUp() throws Exception {
    final String name = "DS_BENCHMARK";
    final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE, MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE, name + "-DCL");
    domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor);
    schemaContext = BenchmarkModel.createTestContext();
    domStore.onGlobalContextUpdated(schemaContext);
    initTestNode();
}
Also used : InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore) ExecutorService(java.util.concurrent.ExecutorService) Setup(org.openjdk.jmh.annotations.Setup)

Example 2 with InMemoryDOMDataStore

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

the class DOMBrokerTest 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", DOMBrokerTest.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 3 with InMemoryDOMDataStore

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

the class InMemoryOperationalDataStoreProviderModule method createInstance.

@Override
public java.lang.AutoCloseable createInstance() {
    InMemoryDOMDataStore dataStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", LogicalDatastoreType.OPERATIONAL, getSchemaServiceDependency(), getDebugTransactions(), InMemoryDOMDataStoreConfigProperties.create(getMaxDataChangeExecutorPoolSize(), getMaxDataChangeExecutorQueueSize(), getMaxDataChangeListenerQueueSize(), getMaxDataStoreExecutorQueueSize()));
    InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryOperationalDataStore", dataStore);
    dataStore.setCloseable(statsBean);
    return dataStore;
}
Also used : InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore) InMemoryDataStoreStats(org.opendaylight.controller.md.sal.dom.store.impl.jmx.InMemoryDataStoreStats)

Example 4 with InMemoryDOMDataStore

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

the class AbstractDataBrokerTestCustomizer method createConfigurationDatastore.

public DOMStore createConfigurationDatastore() {
    final InMemoryDOMDataStore store = new InMemoryDOMDataStore("CFG", getDataTreeChangeListenerExecutor());
    this.schemaService.registerSchemaContextListener(store);
    return store;
}
Also used : InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore)

Example 5 with InMemoryDOMDataStore

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

the class AbstractDataBrokerTestCustomizer method createOperationalDatastore.

public DOMStore createOperationalDatastore() {
    final InMemoryDOMDataStore store = new InMemoryDOMDataStore("OPER", getDataTreeChangeListenerExecutor());
    this.schemaService.registerSchemaContextListener(store);
    return store;
}
Also used : InMemoryDOMDataStore(org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore)

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