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());
}
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);
}
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();
}
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();
}
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);
}
Aggregations