dsbenchmark: final parameters 04/56904/2
authorStephen Kitt <skitt@redhat.com>
Thu, 11 May 2017 15:25:21 +0000 (17:25 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Mon, 15 May 2017 11:50:25 +0000 (11:50 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: If18095c558eb8841e509421dc3d460c34272a03a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
19 files changed:
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/BaListBuilder.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DatastoreAbstractWriter.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DomListBuilder.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DsbenchmarkProvider.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/listener/DsbenchmarkListener.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/listener/DsbenchmarkListenerProvider.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxDomDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxDomRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxDomWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModule.java

index 9d5aa511a8fe776b61ebac110945698ecbc16e30..018246e922042e61002402b96e0d37433c98b0c9 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchm
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerListKey;
 
 public final class BaListBuilder {
-    public static List<OuterList> buildOuterList(int outerElements, int innerElements) {
+    public static List<OuterList> buildOuterList(final int outerElements, final int innerElements) {
         List<OuterList> outerList = new ArrayList<>(outerElements);
         for (int j = 0; j < outerElements; j++) {
             outerList.add(new OuterListBuilder()
@@ -31,7 +31,7 @@ public final class BaListBuilder {
         return outerList;
     }
 
-    private static List<InnerList> buildInnerList( int index, int elements ) {
+    private static List<InnerList> buildInnerList( final int index, final int elements ) {
         List<InnerList> innerList = new ArrayList<>( elements );
 
         final String itemStr = "Item-" + String.valueOf(index) + "-";
index fafcaad9ac2b288c3b0d98b54ec86c077e753d79..a3466e3803a1915a1a9fc8e13d456ea3cd2e5629 100644 (file)
@@ -31,8 +31,8 @@ public abstract class DatastoreAbstractWriter {
     protected int txError = 0;
 
 
-    public DatastoreAbstractWriter(StartTestInput.Operation oper,
-                                   int outerListElem, int innerListElem, long writesPerTx, DataStore dataStore) {
+    public DatastoreAbstractWriter(final StartTestInput.Operation oper,
+                                   final int outerListElem, final int innerListElem, final long writesPerTx, final DataStore dataStore) {
         this.outerListElem = outerListElem;
         this.innerListElem = innerListElem;
         this.writesPerTx = writesPerTx;
index bac6b2bba051c59dd81cc70d083540b5bfd3f3de..cc4fc045cea38c83cc137b26041938b58847a12c 100644 (file)
@@ -28,7 +28,7 @@ public final class DomListBuilder {
     // Outer List Qname identifier for yang model's 'id'
     private static final org.opendaylight.yangtools.yang.common.QName OL_ID = QName.create(OuterList.QNAME, "id");
 
-    public static List<MapEntryNode> buildOuterList(int outerElements, int innerElements) {
+    public static List<MapEntryNode> buildOuterList(final int outerElements, final int innerElements) {
         List<MapEntryNode> outerList = new ArrayList<>(outerElements);
         for (int j = 0; j < outerElements; j++) {
             outerList.add(ImmutableNodes.mapEntryBuilder()
@@ -40,7 +40,7 @@ public final class DomListBuilder {
         return outerList;
     }
 
-    private static MapNode buildInnerList(int index, int elements ) {
+    private static MapNode buildInnerList(final int index, final int elements ) {
         CollectionNodeBuilder<MapEntryNode, MapNode> innerList = ImmutableNodes.mapNodeBuilder(InnerList.QNAME);
 
         final String itemStr = "Item-" + String.valueOf(index) + "-";
index e762d6d9adf094b2b9d84b4b985408d81f40cdce..8af7e15b9775c6af18fd7872f372effe55b00a1c 100644 (file)
@@ -69,7 +69,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
 
     private long testsCompleted = 0;
 
-    public DsbenchmarkProvider(DOMDataBroker domDataBroker, DataBroker bindingDataBroker) {
+    public DsbenchmarkProvider(final DOMDataBroker domDataBroker, final DataBroker bindingDataBroker) {
         // We have to get the DOMDataBroker via the constructor,
         // since we can't get it from the session
         this.domDataBroker = domDataBroker;
@@ -77,7 +77,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
     }
 
     @Override
-    public void onSessionInitiated(ProviderContext session) {
+    public void onSessionInitiated(final ProviderContext session) {
         this.dataBroker = session.getSALService(DataBroker.class);
         this.dstReg = session.addRpcImplementation( DsbenchmarkService.class, this );
         listenerProvider.setDataBroker(dataBroker);
@@ -100,7 +100,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
     }
 
     @Override
-    public Future<RpcResult<StartTestOutput>> startTest(StartTestInput input) {
+    public Future<RpcResult<StartTestOutput>> startTest(final StartTestInput input) {
         LOG.info("Starting the data store benchmark test, input: {}", input);
 
         // Check if there is a test in progress
@@ -136,7 +136,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
 
             this.testsCompleted++;
 
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.error( "Test error: {}", e.toString());
             execStatus.set( ExecStatus.Idle );
             return RpcResultBuilder.success(new StartTestOutputBuilder()
@@ -165,7 +165,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
         return RpcResultBuilder.success(output).buildFuture();
     }
 
-    private void setTestOperData( ExecStatus sts, long tstCompl ) {
+    private void setTestOperData( final ExecStatus sts, final long tstCompl ) {
         TestStatus status = new TestStatusBuilder()
                 .setExecStatus(sts)
                 .setTestsCompleted(tstCompl)
@@ -176,7 +176,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
 
         try {
             tx.submit().checkedGet();
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             throw new IllegalStateException(e);
         }
 
@@ -193,7 +193,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
         try {
             tx.submit().checkedGet();
             LOG.debug("DataStore config test data cleaned up");
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.info("Failed to cleanup DataStore configtest data");
             throw new IllegalStateException(e);
         }
@@ -203,14 +203,14 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
         try {
             tx.submit().checkedGet();
             LOG.debug("DataStore operational test data cleaned up");
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.info("Failed to cleanup DataStore operational test data");
             throw new IllegalStateException(e);
         }
 
     }
 
-    private DatastoreAbstractWriter getDatastoreWriter(StartTestInput input) {
+    private DatastoreAbstractWriter getDatastoreWriter(final StartTestInput input) {
 
         final DatastoreAbstractWriter retVal;
 
index fcd2c1110b278701f59348fba511df4b10374d3c..14633c9ee0c6cc914685d54d279b6f708d7468d9 100644 (file)
@@ -28,7 +28,7 @@ public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
 
     @Override
     public void onDataTreeChanged(
-            Collection<DataTreeModification<TestExec>> changes) {
+            final Collection<DataTreeModification<TestExec>> changes) {
         // Since we're registering the same DsbenchmarkListener object for both
         // OPERATIONAL and CONFIG, the onDataTreeChanged() method can be called
         // from different threads, and we need to use atomic counters.
@@ -41,8 +41,8 @@ public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
         }
     }
 
-    private static synchronized void logDataTreeChangeEvent(int eventNum,
-            Collection<DataTreeModification<TestExec>> changes) {
+    private static synchronized void logDataTreeChangeEvent(final int eventNum,
+            final Collection<DataTreeModification<TestExec>> changes) {
         LOG.debug("DsbenchmarkListener-onDataTreeChanged: Event {}", eventNum);
 
         for (DataTreeModification<TestExec> change : changes) {
index 62b48ad0453b1ddf50716a63faad3e5808ea6a18..27d060b6a1323933cee9e3cb60d82e659491fd84 100644 (file)
@@ -28,12 +28,12 @@ public class DsbenchmarkListenerProvider {
             new ArrayList<>();
     private DataBroker dataBroker;
 
-    public void setDataBroker(DataBroker dataBroker) {
+    public void setDataBroker(final DataBroker dataBroker) {
         this.dataBroker = dataBroker;
         LOG.debug("DsbenchmarkListenerProvider created");
     }
 
-    public void createAndRegisterListeners(int numListeners) {
+    public void createAndRegisterListeners(final int numListeners) {
         for (int i = 0; i < numListeners; i++) {
             DsbenchmarkListener listener = new DsbenchmarkListener();
             listeners.add(dataBroker.registerDataTreeChangeListener(
index cb44e8f59daaa6408cda6557dc6c0bc77c6dda8e..a165ea0a03b442f1708a0fdecb2a79d403dd49c0 100644 (file)
@@ -65,7 +65,7 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -76,7 +76,7 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter {
         if (putCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }
index afff73c5fe7f6bf54ef48fa1e0befced70d425b3..aa91b5d6aafd21e38e2494182da27a85d6d5e7b4 100644 (file)
@@ -89,7 +89,7 @@ public class SimpletxBaRead extends DatastoreAbstractWriter {
                     } else {
                         txError++;
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index ea373d150e5662b5fb340021e12b01f963b66ae9..9a3f27eabfde002a89f27234c840492cd39fa89c 100644 (file)
@@ -62,7 +62,7 @@ public class SimpletxBaWrite extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -75,7 +75,7 @@ public class SimpletxBaWrite extends DatastoreAbstractWriter {
         if (writeCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }
index e7c6ffd8d9b1428d274fc7717cb27b7c0c3efe52..58baedb9c675ce6c1700b129f21920b48ef9d3eb 100644 (file)
@@ -69,7 +69,7 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -80,7 +80,7 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
         if (writeCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }
index f2b2799294d3e8f990d1ce9b015ba9931e901caf..536e77ecd6d4d10f424aa2b2f3d081f14f4cd63e 100644 (file)
@@ -76,7 +76,7 @@ public class SimpletxDomRead extends DatastoreAbstractWriter {
                         txError++;
                         LOG.warn("optionalDataObject is either null or .isPresent is false");
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index 1ea66f26a608651db8261fab4aed78a61f01ce33..e55724d54bdebca1bb3e451df7a9a3d9a70cbf4c 100644 (file)
@@ -67,7 +67,7 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed", e);
                     txError++;
                 }
@@ -79,7 +79,7 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
         if (writeCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed", e);
             }
         }
index 74ba61c5346d7129c1273dea0784232835b7b4fb..a8363df679bfdbb77c60f03c52ad6da9a063d106 100644 (file)
@@ -97,12 +97,12 @@ public class TxchainBaDelete extends DatastoreAbstractWriter implements Transact
                 txSubmitted++;
             }
             tx.submit().checkedGet();
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
         LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
index 9b2ec412056ac2697334d9f4f1db9202d2485acb..20694ca5d36671f7f1d1a1bd89972d84d964d4de 100644 (file)
@@ -91,7 +91,7 @@ public class TxchainBaRead extends DatastoreAbstractWriter implements Transactio
                     } else {
                         txError++;
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index e17ef9827e102c49b6444441b88aba9ba03b5bae..a0327a97029d2a4c0dbe68088bcf2bdd56d6afe6 100644 (file)
@@ -94,13 +94,13 @@ public class TxchainBaWrite extends DatastoreAbstractWriter implements Transacti
             txSubmitted++;
             tx.submit().checkedGet();
             txOk++;
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
             txError++;
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
         LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
index 132ccbc111125b176cbc53d3365a763ee5ec1f49..8e32897a042986f2e00fbe54ffab5f1cd79d2fcd 100644 (file)
@@ -100,13 +100,13 @@ public class TxchainDomDelete extends DatastoreAbstractWriter implements Transac
             txSubmitted++;
             tx.submit().checkedGet();
             txOk++;
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
             txError++;
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
         LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
index 359aff3fad17b3ed9d104494bfc7184c89ea41a6..bb24f8b7b30b387c62bb29c7514dab8bacb8b351 100644 (file)
@@ -73,7 +73,7 @@ public class TxchainDomRead extends DatastoreAbstractWriter implements Transacti
                     if (optionalDataObject != null && optionalDataObject.isPresent()) {
                         txOk++;
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index 2693fa976af753cdc69182e32f92c96d94fb55fb..52f574ab1c0ecf240b20378fbccb5dd434aead9b 100644 (file)
@@ -99,13 +99,13 @@ public class TxchainDomWrite extends DatastoreAbstractWriter implements Transact
             txSubmitted++;
             tx.submit().checkedGet();
             txOk++;
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
             txError++;
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
 
index 82d1270677b3971b9ce9baa70b8bd2bcd1a7cec8..2a38b6e08983ab504e1cc71f9793ede48394df33 100644 (file)
@@ -10,11 +10,11 @@ package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbench
 import org.opendaylight.dsbenchmark.DsbenchmarkProvider;
 
 public class DsbenchmarkImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.AbstractDsbenchmarkImplModule {
-    public DsbenchmarkImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+    public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
     }
 
-    public DsbenchmarkImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.DsbenchmarkImplModule oldModule, java.lang.AutoCloseable oldInstance) {
+    public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.DsbenchmarkImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
         super(identifier, dependencyResolver, oldModule, oldInstance);
     }