Search in sources :

Example 11 with InMemoryDOMDataStore

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

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

Example 13 with InMemoryDOMDataStore

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

the class InMemoryConfigDataStoreProviderModule method createInstance.

@Override
public java.lang.AutoCloseable createInstance() {
    InMemoryDOMDataStore dataStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", LogicalDatastoreType.CONFIGURATION, getSchemaServiceDependency(), getDebugTransactions(), InMemoryDOMDataStoreConfigProperties.create(getMaxDataChangeExecutorPoolSize(), getMaxDataChangeExecutorQueueSize(), getMaxDataChangeListenerQueueSize(), getMaxDataStoreExecutorQueueSize()));
    InMemoryDataStoreStats statsBean = new InMemoryDataStoreStats("InMemoryConfigDataStore", 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)

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