Fix checkstyle issues to enforce it.
Note: I had to replace the calls to MoreExecutors.sameThread() since the
module didn't compile locally. That method [1] is deprecated anyway.
[1]
https://google.github.io/guava/releases/19.0/api/docs/com/google/common/util/concurrent/MoreExecutors.html#sameThreadExecutor()
Change-Id: I4263cadc0748065b20b425d6860fe36569d913b1
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<version>2.0.4</version>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
<version>2.0.4</version>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<argument>org.openjdk.jmh.Main</argument>
<argument>.*</argument>
</arguments>
<argument>org.openjdk.jmh.Main</argument>
<argument>.*</argument>
</arguments>
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import org.openjdk.jmh.annotations.Warmup;
/**
import org.openjdk.jmh.annotations.Warmup;
/**
+ * Abstract class to handle transaction benchmarks.
+ *
* @author Lukas Sedlak
*/
* @author Lukas Sedlak
*/
-public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryWriteTransactionBenchmark {
+public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
+ extends AbstractInMemoryWriteTransactionBenchmark {
protected SerializedDOMDataBroker domBroker;
protected void initTestNode() throws Exception {
protected SerializedDOMDataBroker domBroker;
protected void initTestNode() throws Exception {
- final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH)
- .build();
+ final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode());
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
writeTx.put(LogicalDatastoreType.OPERATIONAL, testPath, provideOuterListNode());
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
DOMDataReadWriteTransaction 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]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_100K_PATHS[outerListKey],
+ OUTER_LIST_ONE_ITEM_INNER_LIST[outerListKey]);
}
writeTx.submit().get();
}
writeTx.submit().get();
public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
public void write100KSingleNodeWithOneInnerItemInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_100K; ++outerListKey) {
DOMDataReadWriteTransaction 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.submit().get();
}
public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
public void write50KSingleNodeWithTwoInnerItemsInOneCommitBenchmark() throws Exception {
DOMDataReadWriteTransaction 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]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_50K_PATHS[outerListKey],
+ OUTER_LIST_TWO_ITEM_INNER_LIST[outerListKey]);
}
writeTx.submit().get();
}
writeTx.submit().get();
public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
public void write50KSingleNodeWithTwoInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_50K; ++outerListKey) {
DOMDataReadWriteTransaction 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.submit().get();
}
}
public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
public void write10KSingleNodeWithTenInnerItemsInOneCommitBenchmark() throws Exception {
DOMDataReadWriteTransaction 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]);
+ writeTx.put(LogicalDatastoreType.OPERATIONAL, OUTER_LIST_10K_PATHS[outerListKey],
+ OUTER_LIST_TEN_ITEM_INNER_LIST[outerListKey]);
}
writeTx.submit().get();
}
}
writeTx.submit().get();
}
public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
DOMDataReadWriteTransaction writeTx = domBroker.newReadWriteTransaction();
public void write10KSingleNodeWithTenInnerItemsInCommitPerWriteBenchmark() throws Exception {
for (int outerListKey = 0; outerListKey < OUTER_LIST_10K; ++outerListKey) {
DOMDataReadWriteTransaction 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.submit().get();
}
}
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import org.openjdk.jmh.annotations.Warmup;
/**
import org.openjdk.jmh.annotations.Warmup;
/**
+ * Abstract class for in-memory Datastore transaction benchmarks.
+ *
* @author Lukas Sedlak
*/
* @author Lukas Sedlak
*/
-public abstract class AbstractInMemoryDatastoreWriteTransactionBenchmark extends AbstractInMemoryWriteTransactionBenchmark {
+public abstract class AbstractInMemoryDatastoreWriteTransactionBenchmark
+ extends AbstractInMemoryWriteTransactionBenchmark {
protected InMemoryDOMDataStore domStore;
protected void initTestNode() throws Exception {
protected InMemoryDOMDataStore domStore;
protected void initTestNode() throws Exception {
- final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH)
- .build();
+ final YangInstanceIdentifier testPath = YangInstanceIdentifier.builder(BenchmarkModel.TEST_PATH).build();
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(testPath, provideOuterListNode());
DOMStoreReadWriteTransaction writeTx = domStore.newReadWriteTransaction();
writeTx.write(testPath, provideOuterListNode());
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
for (int outerListKey = 0; outerListKey < outerListPathsCount; ++outerListKey) {
paths[outerListKey] = YangInstanceIdentifier.builder(BenchmarkModel.OUTER_LIST_PATH)
for (int outerListKey = 0; outerListKey < outerListPathsCount; ++outerListKey) {
paths[outerListKey] = YangInstanceIdentifier.builder(BenchmarkModel.OUTER_LIST_PATH)
- .nodeWithKey(BenchmarkModel.OUTER_LIST_QNAME, BenchmarkModel.ID_QNAME, outerListKey)
- .build();
+ .nodeWithKey(BenchmarkModel.OUTER_LIST_QNAME, BenchmarkModel.ID_QNAME, outerListKey).build();
private static MapNode initInnerListItems(final int count) {
final CollectionNodeBuilder<MapEntryNode, MapNode> mapEntryBuilder = ImmutableNodes
private static MapNode initInnerListItems(final int count) {
final CollectionNodeBuilder<MapEntryNode, MapNode> mapEntryBuilder = ImmutableNodes
- .mapNodeBuilder(BenchmarkModel.INNER_LIST_QNAME);
+ .mapNodeBuilder(BenchmarkModel.INNER_LIST_QNAME);
for (int i = 1; i <= count; ++i) {
mapEntryBuilder
for (int i = 1; i <= count; ++i) {
mapEntryBuilder
- .withChild(ImmutableNodes.mapEntry(BenchmarkModel.INNER_LIST_QNAME, BenchmarkModel.NAME_QNAME, i));
+ .withChild(ImmutableNodes.mapEntry(BenchmarkModel.INNER_LIST_QNAME, BenchmarkModel.NAME_QNAME, i));
}
return mapEntryBuilder.build();
}
}
return mapEntryBuilder.build();
}
- protected static final NormalizedNode<?, ?>[] OUTER_LIST_ONE_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_100K, ONE_ITEM_INNER_LIST);
- protected static final NormalizedNode<?, ?>[] OUTER_LIST_TWO_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_50K, TWO_ITEM_INNER_LIST);
- protected static final NormalizedNode<?, ?>[] OUTER_LIST_TEN_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_10K, TEN_ITEM_INNER_LIST);
+ protected static final NormalizedNode<?, ?>[] OUTER_LIST_ONE_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_100K,
+ ONE_ITEM_INNER_LIST);
+ protected static final NormalizedNode<?, ?>[] OUTER_LIST_TWO_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_50K,
+ TWO_ITEM_INNER_LIST);
+ protected static final NormalizedNode<?, ?>[] OUTER_LIST_TEN_ITEM_INNER_LIST = initOuterListItems(OUTER_LIST_10K,
+ TEN_ITEM_INNER_LIST);
- private static NormalizedNode<?,?>[] initOuterListItems(final int outerListItemsCount, final MapNode innerList) {
- final NormalizedNode<?,?>[] outerListItems = new NormalizedNode[outerListItemsCount];
+ private static NormalizedNode<?, ?>[] initOuterListItems(final int outerListItemsCount, final MapNode innerList) {
+ final NormalizedNode<?, ?>[] outerListItems = new NormalizedNode[outerListItemsCount];
for (int i = 0; i < outerListItemsCount; ++i) {
int outerListKey = i;
for (int i = 0; i < outerListItemsCount; ++i) {
int outerListKey = i;
- outerListItems[i] = ImmutableNodes.mapEntryBuilder(BenchmarkModel.OUTER_LIST_QNAME, BenchmarkModel.ID_QNAME, outerListKey)
- .withChild(innerList).build();
+ outerListItems[i] = ImmutableNodes
+ .mapEntryBuilder(BenchmarkModel.OUTER_LIST_QNAME, BenchmarkModel.ID_QNAME, outerListKey)
+ .withChild(innerList).build();
}
return outerListItems;
}
protected SchemaContext schemaContext;
}
return outerListItems;
}
protected SchemaContext schemaContext;
- abstract public void setUp() throws Exception;
- abstract public void tearDown();
+
+ public abstract void setUp() throws Exception;
+
+ public abstract void tearDown();
protected static DataContainerChild<?, ?> provideOuterListNode() {
protected static DataContainerChild<?, ?> provideOuterListNode() {
- return ImmutableContainerNodeBuilder
- .create()
- .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(BenchmarkModel.TEST_QNAME))
- .withChild(
- ImmutableNodes.mapNodeBuilder(BenchmarkModel.OUTER_LIST_QNAME)
- .build()).build();
+ return ImmutableContainerNodeBuilder.create()
+ .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(BenchmarkModel.TEST_QNAME))
+ .withChild(ImmutableNodes.mapNodeBuilder(BenchmarkModel.OUTER_LIST_QNAME).build()).build();
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
public static final QName ID_QNAME = QName.create(TEST_QNAME, "id");
public static final QName NAME_QNAME = QName.create(TEST_QNAME, "name");
private static final String DATASTORE_TEST_YANG = "/odl-datastore-test.yang";
public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier.of(TEST_QNAME);
public static final YangInstanceIdentifier OUTER_LIST_PATH =
YangInstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
public static final YangInstanceIdentifier TEST_PATH = YangInstanceIdentifier.of(TEST_QNAME);
public static final YangInstanceIdentifier OUTER_LIST_PATH =
YangInstanceIdentifier.builder(TEST_PATH).node(OUTER_LIST_QNAME).build();
+ private BenchmarkModel() {
+ }
+
private static InputStream getInputStream() {
return BenchmarkModel.class.getResourceAsStream(DATASTORE_TEST_YANG);
}
private static InputStream getInputStream() {
return BenchmarkModel.class.getResourceAsStream(DATASTORE_TEST_YANG);
}
- * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
@Setup(Level.Trial)
@Override
public void setUp() throws Exception {
@Setup(Level.Trial)
@Override
public void setUp() throws Exception {
- ListeningExecutorService dsExec = MoreExecutors.sameThreadExecutor();
+ ListeningExecutorService dsExec = MoreExecutors.newDirectExecutorService();
executor = MoreExecutors.listeningDecorator(
executor = MoreExecutors.listeningDecorator(
- MoreExecutors.getExitingExecutorService((ThreadPoolExecutor)Executors.newFixedThreadPool(1), 1L, TimeUnit.SECONDS));
+ MoreExecutors.getExitingExecutorService((ThreadPoolExecutor) Executors.newFixedThreadPool(1), 1L,
+ TimeUnit.SECONDS));
InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", dsExec);
InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", dsExec);
InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", dsExec);
InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", dsExec);
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
-import org.openjdk.jmh.annotations.Level;
-import org.openjdk.jmh.annotations.Setup;
-import org.openjdk.jmh.annotations.TearDown;
-import org.openjdk.jmh.annotations.Fork;
-import org.openjdk.jmh.annotations.Scope;
-import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.annotations.TearDown;
- * Benchmark for testing of performance of write operations for InMemoryDataStore. The instance
- * of benchmark creates InMemoryDataStore with Data Change Listener Executor Service as Blocking Bounded Fast Thread Pool
+ * Benchmark for testing of performance of write operations for
+ * InMemoryDataStore. The instance of benchmark creates InMemoryDataStore with
+ * Data Change Listener Executor Service as Blocking Bounded Fast Thread Pool
* and DOM Store Executor Service as Same Thread Executor.
*
* @author Lukas Sedlak
* and DOM Store Executor Service as Same Thread Executor.
*
* @author Lukas Sedlak
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(1)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Fork(1)
-public class InMemoryDataStoreWithSameThreadedExecutorBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark {
+public class InMemoryDataStoreWithSameThreadedExecutorBenchmark
+ extends AbstractInMemoryDatastoreWriteTransactionBenchmark {
private static final int MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20;
private static final int MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
private static final int MAX_DATA_CHANGE_EXECUTOR_POOL_SIZE = 20;
private static final int MAX_DATA_CHANGE_EXECUTOR_QUEUE_SIZE = 1000;
@Setup(Level.Trial)
public void setUp() throws Exception {
final String name = "DS_BENCHMARK";
final ExecutorService dataChangeListenerExecutor = SpecialExecutors.newBlockingBoundedFastThreadPool(
@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");
+ 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 = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", dataChangeListenerExecutor);
schemaContext = BenchmarkModel.createTestContext();
@TearDown
public void tearDown() {
schemaContext = null;
@TearDown
public void tearDown() {
schemaContext = null;
*/
package org.opendaylight.controller.md.sal.dom.store.benchmark;
*/
package org.opendaylight.controller.md.sal.dom.store.benchmark;
-import com.google.common.util.concurrent.MoreExecutors;
+import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import java.util.concurrent.TimeUnit;
import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.openjdk.jmh.annotations.Fork;
-import org.openjdk.jmh.annotations.Scope;
-import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.BenchmarkMode;
+import org.openjdk.jmh.annotations.Fork;
+import org.openjdk.jmh.annotations.Level;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
+import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.Setup;
-import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.TearDown;
/**
import org.openjdk.jmh.annotations.TearDown;
/**
- * Benchmark for testing of performance of write operations for InMemoryDataStore. The instance
- * of benchmark creates InMemoryDataStore with Data Change Listener Executor Service as Same Thread Executor
- * and DOM Store Executor Service as Same Thread Executor.
+ * Benchmark for testing of performance of write operations for
+ * InMemoryDataStore. The instance of benchmark creates InMemoryDataStore with
+ * Data Change Listener Executor Service as Same Thread Executor and DOM Store
+ * Executor Service as Same Thread Executor.
*
* @author Lukas Sedlak
*/
*
* @author Lukas Sedlak
*/
@Fork(1)
public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark {
@Fork(1)
public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark {
@Setup(Level.Trial)
public void setUp() throws Exception {
@Setup(Level.Trial)
public void setUp() throws Exception {
- domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", MoreExecutors.sameThreadExecutor());
+ domStore = new InMemoryDOMDataStore("SINGLE_THREADED_DS_BENCHMARK", Executors.newSingleThreadExecutor());
schemaContext = BenchmarkModel.createTestContext();
domStore.onGlobalContextUpdated(schemaContext);
initTestNode();
}
schemaContext = BenchmarkModel.createTestContext();
domStore.onGlobalContextUpdated(schemaContext);
initTestNode();
}
@TearDown
public void tearDown() {
schemaContext = null;
@TearDown
public void tearDown() {
schemaContext = null;