This removes controller dependencies.
Change-Id: Ic3fa0748d4e92f86899af2b8dcf73b7f1ae2560a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
<version>1.10.0-SNAPSHOT</version>
<packaging>jar</packaging>
<version>1.10.0-SNAPSHOT</version>
<packaging>jar</packaging>
+ <properties>
+ <spotbugs.skip>true</spotbugs.skip>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<dependencies>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<version>1.17.5</version>
</dependency>
<dependency>
<version>1.17.5</version>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-inmemory-datastore</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-dom-inmemory-datastore</artifactId>
</dependency>
<dependency>
</dependency>
<dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-broker-impl</artifactId>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-dom-broker</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
package org.opendaylight.controller.md.sal.dom.store.benchmark;
import java.util.concurrent.TimeUnit;
package org.opendaylight.controller.md.sal.dom.store.benchmark;
import java.util.concurrent.TimeUnit;
-
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Measurement;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Measurement;
protected void initTestNode() throws Exception {
final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
protected void initTestNode() throws Exception {
final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
- DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode());
writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode());
- writeTx.submit().get();
+ writeTx.commit().get();
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception {
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInOneCommitBenchmark() throws Exception {
- DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
}
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
}
- writeTx.submit().get();
+ writeTx.commit().get();
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
- DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
- writeTx.submit().get();
+ writeTx.commit().get();
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
- DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
}
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
}
- writeTx.submit().get();
+ writeTx.commit().get();
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
- DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
- writeTx.submit().get();
+ writeTx.commit().get();
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception {
@Warmup(iterations = WARMUP_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception {
- DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
}
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
}
- writeTx.submit().get();
+ writeTx.commit().get();
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
@Measurement(iterations = MEASUREMENT_ITERATIONS, timeUnit = TimeUnit.MILLISECONDS)
public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
- DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
- writeTx.submit().get();
+ writeTx.commit().get();
package org.opendaylight.controller.md.sal.dom.store.benchmark;
import java.util.concurrent.TimeUnit;
package org.opendaylight.controller.md.sal.dom.store.benchmark;
import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
-import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Measurement;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Measurement;
*/
package org.opendaylight.controller.md.sal.dom.store.benchmark;
*/
package org.opendaylight.controller.md.sal.dom.store.benchmark;
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.List;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
/**
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
/**
private BenchmarkModel() {
}
private BenchmarkModel() {
}
- private static InputStream getInputStream() {
- return BenchmarkModel.class.getResourceAsStream(DATASTORE_TEST_YANG);
- }
-
public static SchemaContext createTestContext() {
public static SchemaContext createTestContext() {
- final SchemaContext schemaContext;
- final List<InputStream> streams = Collections.singletonList(getInputStream());
-
- try {
- schemaContext = YangParserTestUtils.parseYangStreams(streams);
- } catch (ReactorException e) {
- throw new RuntimeException("Unable to build schema context from " + streams, e);
- }
- return schemaContext;
+ return YangParserTestUtils.parseYangResources(BenchmarkModel.class, DATASTORE_TEST_YANG);
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
public void setUp() throws Exception {
final String name = "DS_BENCHMARK";
final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
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");
+ MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE, MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE, name + "-DCL",
+ InMemoryDataStoreWithSameThreadedExecutorBenchmark.class);
domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor);
schemaContext = BenchmarkModel.createTestContext();
domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor);
schemaContext = BenchmarkModel.createTestContext();
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Level;