Fix checkstyle issues to enforce it 22/62722/1
authorDavid Suarez <david.suarez.fuentes@gmail.com>
Tue, 5 Sep 2017 18:50:00 +0000 (20:50 +0200)
committerDavid Suarez <david.suarez.fuentes@gmail.com>
Tue, 5 Sep 2017 18:50:00 +0000 (20:50 +0200)
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>
opendaylight/md-sal/benchmark-data-store/pom.xml
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryBrokerWriteTransactionBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryDatastoreWriteTransactionBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/AbstractInMemoryWriteTransactionBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/BenchmarkModel.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryBrokerWriteTransactionBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWithSameThreadedExecutorBenchmark.java
opendaylight/md-sal/benchmark-data-store/src/main/java/org/opendaylight/controller/md/sal/dom/store/benchmark/InMemoryDataStoreWriteTransactionBenchmark.java

index 2ca12671856ecadf2d7b0330e080aba02408b1a1..d08e9b3c7ef7ec3099f7764602a78f71eb08b0a1 100644 (file)
@@ -6,15 +6,14 @@ This program and the accompanying materials are made available under the
 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>
-    <relativePath/>
+    <relativePath />
   </parent>
 
 
@@ -74,6 +73,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
 
   <build>
     <plugins>
+      <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>
@@ -82,7 +88,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
           <executable>java</executable>
           <arguments>
             <argument>-classpath</argument>
-            <classpath/>
+            <classpath />
             <argument>org.openjdk.jmh.Main</argument>
             <argument>.*</argument>
           </arguments>
index 2219c2a4daa342ccc63d90186c845a864afbfbf3..04298a66fe139e696b3ddbbff6c85cff67d7a35c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -18,15 +18,17 @@ import org.openjdk.jmh.annotations.Measurement;
 import org.openjdk.jmh.annotations.Warmup;
 
 /**
+ * Abstract class to handle transaction benchmarks.
+ *
  * @author Lukas Sedlak
  */
-public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryWriteTransactionBenchmark {
+public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark
+        extends AbstractInMemoryWriteTransactionBenchmark {
 
     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());
 
@@ -40,7 +42,8 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends Ab
 
         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();
@@ -52,7 +55,8 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends Ab
     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();
         }
@@ -64,7 +68,8 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends Ab
     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();
@@ -76,7 +81,8 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends Ab
     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();
         }
     }
@@ -87,7 +93,8 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends Ab
     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();
     }
@@ -98,7 +105,8 @@ public abstract class AbstractInMemoryBrokerWriteTransactionBenchmark extends Ab
     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();
         }
     }
index 80bb50375fe81f644ac77c81aacf4e2c69ce4526..00925a562db1222bb0e58b88c474b36b37e24c35 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -17,15 +17,17 @@ import org.openjdk.jmh.annotations.Measurement;
 import org.openjdk.jmh.annotations.Warmup;
 
 /**
+ * Abstract class for in-memory Datastore transaction benchmarks.
+ *
  * @author Lukas Sedlak
  */
-public abstract class AbstractInMemoryDatastoreWriteTransactionBenchmark extends AbstractInMemoryWriteTransactionBenchmark {
+public abstract class AbstractInMemoryDatastoreWriteTransactionBenchmark
+        extends AbstractInMemoryWriteTransactionBenchmark {
 
     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());
 
index 6c256eb7af6d8b07163e999512b8082ee5ccf0fa..a2414d71ef83d228b648b68408377554058cba96 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -31,8 +31,7 @@ public abstract class AbstractInMemoryWriteTransactionBenchmark {
 
         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();
         }
         return paths;
     }
@@ -46,40 +45,43 @@ public abstract class AbstractInMemoryWriteTransactionBenchmark {
 
     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
-                .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();
     }
 
-    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;
-            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;
-    abstract public void setUp() throws Exception;
-    abstract public void tearDown();
+
+    public abstract void setUp() throws Exception;
+
+    public abstract void tearDown();
 
     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();
     }
 }
index 7424adc259c7d122ec7ee0298e0db96d44d02683..d2d3b51048182ea6feaa8ec565f4378df72ed3e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -33,11 +33,13 @@ public final class BenchmarkModel {
     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();
 
+    private BenchmarkModel() {
+    }
+
     private static InputStream getInputStream() {
         return BenchmarkModel.class.getResourceAsStream(DATASTORE_TEST_YANG);
     }
index e6a16427037f39a5130252a6286490391049f9fc..7c0b4b7d07bf269d43ad485629471e2f27a64a18 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -37,9 +37,10 @@ public class InMemoryBrokerWriteTransactionBenchmark extends AbstractInMemoryBro
     @Setup(Level.Trial)
     @Override
     public void setUp() throws Exception {
-        ListeningExecutorService dsExec = MoreExecutors.sameThreadExecutor();
+        ListeningExecutorService dsExec = MoreExecutors.newDirectExecutorService();
         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);
index 330c9479433bfb23461fe41eecab83eed849e1f2..037058848e607cd88e7f0c3689f50dafe524065b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -11,19 +11,20 @@ import java.util.concurrent.ExecutorService;
 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.Fork;
+import org.openjdk.jmh.annotations.Level;
 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
@@ -32,16 +33,18 @@ import org.openjdk.jmh.annotations.OutputTimeUnit;
 @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;
 
+    @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");
+                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();
@@ -49,6 +52,7 @@ public class InMemoryDataStoreWithSameThreadedExecutorBenchmark extends Abstract
         initTestNode();
     }
 
+    @Override
     @TearDown
     public void tearDown() {
         schemaContext = null;
index 930ceaf07dce5105a7c4dd24244eee9cead401ea..fee7eca788799836b7d05f477380f5afd998adad 100644 (file)
@@ -7,23 +7,24 @@
  */
 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 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.Fork;
+import org.openjdk.jmh.annotations.Level;
 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.Level;
+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 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
  */
@@ -33,14 +34,16 @@ import org.openjdk.jmh.annotations.TearDown;
 @Fork(1)
 public class InMemoryDataStoreWriteTransactionBenchmark extends AbstractInMemoryDatastoreWriteTransactionBenchmark {
 
+    @Override
     @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();
     }
 
+    @Override
     @TearDown
     public void tearDown() {
         schemaContext = null;