FR-sync cleaning 64/40164/9
authorAndrej Leitner <anleitne@cisco.com>
Fri, 10 Jun 2016 12:50:53 +0000 (14:50 +0200)
committerAndrej Leitner <anleitne@cisco.com>
Tue, 21 Jun 2016 09:25:58 +0000 (11:25 +0200)
 - improved logging and comments
 - edited access level modifiers
 - removed unused dependency
 - removed unused method paramters
 - decreased test timeout

Change-Id: Id0edd87292dc946b6b2699dc027555fa7255c917
Signed-off-by: Andrej Leitner <anleitne@cisco.com>
26 files changed:
applications/forwardingrules-sync/pom.xml
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/SyncPlanPushStrategy.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/SyncReactor.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/AbstractFrmSyncListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/FlowForwarder.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/ForwardingRulesSyncProvider.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/FrmExecutors.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/MeterForwarder.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedConfigListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedOperationalListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SimplifiedOperationalRetryListener.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorFutureDecorator.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorFutureZipDecorator.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorGuardDecorator.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorImpl.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorRetryDecorator.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImpl.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SynchronizationDiffInput.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/FlowCapableNodeLookups.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/ItemSyncBox.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/SemaphoreKeeperGuavaImpl.java
applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/ZipQueueEntry.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/SyncReactorRetryDecoratorTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/impl/strategy/SyncPlanPushStrategyIncrementalImplTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtilTest.java
applications/forwardingrules-sync/src/test/java/org/opendaylight/openflowplugin/applications/frsync/util/SemaphoreKeeperTest.java

index e9fad3b3163ad9f54a0f633c75b01bfe2107f6a1..067a462f2ee9dccdbbc66a5a3de49400a003ea3d 100644 (file)
             <artifactId>model-inventory</artifactId>
         </dependency>
 
-        <dependency>
-            <groupId>org.opendaylight.openflowplugin.model</groupId>
-            <artifactId>model-flow-base</artifactId>
-        </dependency>
-
         <dependency>
             <groupId>org.opendaylight.openflowplugin.model</groupId>
             <artifactId>model-flow-service</artifactId>
index 9a856cc6b946aa2dbb19b373b0cb5fe874084ff7..5e3838978c9627f577a710020ef79d6eb607eb33 100644 (file)
@@ -22,7 +22,8 @@ public interface SyncPlanPushStrategy {
     /**
      * @param resultVehicle bootstrap future - execution will chain it's async calls to this one
      * @param diffInput     wraps all diff data required for any strategy ({add,remove,update} x {flow,group,meter})
-     * @param counters      reference to internal one-shot statistics - summary off successfully pushed items shall be recorded here
+     * @param counters      reference to internal one-shot statistics - summary off successfully pushed items
+     *                      shall be recorded here
      * @return last future of the chain
      */
     ListenableFuture<RpcResult<Void>> executeSyncStrategy(ListenableFuture<RpcResult<Void>> resultVehicle,
index 430310bb4d339a737abe62f932f8de3d81fe7e6e..cf92bbae60840ff5b1111f0c066ef9a23a6084be 100644 (file)
@@ -24,8 +24,7 @@ public interface SyncReactor {
      * @param dsType type of DS change
      * @return synchronization outcome
      */
-    ListenableFuture<Boolean> syncup(InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
-                                     FlowCapableNode configTree, FlowCapableNode operationalTree,
-                                     LogicalDatastoreType dsType) throws InterruptedException;
-
+    ListenableFuture<Boolean> syncup(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
+                                     final FlowCapableNode configTree, final FlowCapableNode operationalTree,
+                                     final LogicalDatastoreType dsType) throws InterruptedException;
 }
index 2a4d1bd0f5b3d4559cb41778b138203b02b6e67d..aaf4063bd0f21a6e609d686404383a90a8a7223f 100644 (file)
@@ -15,7 +15,6 @@ import java.util.concurrent.TimeUnit;
 import javax.annotation.Nonnull;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.openflowplugin.applications.frsync.NodeListener;
 import org.opendaylight.openflowplugin.applications.frsync.util.PathUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
@@ -39,18 +38,18 @@ public abstract class AbstractFrmSyncListener<T extends DataObject> implements N
                 if (optFuture.isPresent()) {
                     final ListenableFuture<Boolean> future = optFuture.get();
                     final Boolean ret = future.get(15000, TimeUnit.MILLISECONDS);
-                    LOG.debug("syncup ret {} {} {} thread:{}", dsType(), ret, nodeId, threadName());
+                    LOG.debug("syncup ret {} {} {} thread:{}", dsType(), ret, nodeId.getValue(), threadName());
                 }
             } catch (InterruptedException e) {
-                LOG.warn("permit for forwarding rules sync not acquired: {}", nodeId);
+                LOG.warn("permit for forwarding rules sync not acquired: {}", nodeId.getValue());
             } catch (Exception e) {
-                LOG.error("error processing inventory node modification: {}", nodeId, e);
+                LOG.error("error processing inventory node modification: {}", nodeId.getValue(), e);
             }
         }
     }
 
     protected abstract Optional<ListenableFuture<Boolean>> processNodeModification(
-            DataTreeModification<T> modification) throws ReadFailedException, InterruptedException;
+            DataTreeModification<T> modification) throws InterruptedException;
 
     protected abstract LogicalDatastoreType dsType();
 
index 8bc18dd0ffec6c228a7f3548b78ebe4a8e30ff56..87237c5f77d8910f00c6de93eb44c2e4ef2bb7f8 100644 (file)
@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
 public class FlowForwarder implements ForwardingRulesCommitter<Flow, AddFlowOutput, RemoveFlowOutput, UpdateFlowOutput> {
 
     private static final Logger LOG = LoggerFactory.getLogger(FlowForwarder.class);
-    private SalFlowService salFlowService;
+    private final SalFlowService salFlowService;
 
     public FlowForwarder(final SalFlowService salFlowService) {
         this.salFlowService = salFlowService;
@@ -53,7 +53,7 @@ public class FlowForwarder implements ForwardingRulesCommitter<Flow, AddFlowOutp
                                                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.trace("Forwarding Flow REMOVE request Tbl id, node Id {} {}",
                 identifier, nodeIdent);
-        
+
         final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
         if (tableIdValidationPrecondition(tableKey, removeDataObj)) {
             final RemoveFlowInputBuilder builder = new RemoveFlowInputBuilder(removeDataObj);
@@ -77,7 +77,7 @@ public class FlowForwarder implements ForwardingRulesCommitter<Flow, AddFlowOutp
                                                       final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.trace("Forwarding Flow UPDATE request [Tbl id, node Id {} {} {}",
                 identifier, nodeIdent, update);
-        
+
         final Future<RpcResult<UpdateFlowOutput>> output;
         final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
         if (tableIdValidationPrecondition(tableKey, update)) {
@@ -106,7 +106,7 @@ public class FlowForwarder implements ForwardingRulesCommitter<Flow, AddFlowOutp
                                                 final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.trace("Forwarding the Flow ADD request [Tbl id, node Id {} {} {}",
                 identifier, nodeIdent, addDataObj);
-        
+
         final Future<RpcResult<AddFlowOutput>> output;
         final TableKey tableKey = identifier.firstKeyOf(Table.class, TableKey.class);
         if (tableIdValidationPrecondition(tableKey, addDataObj)) {
index 9376f8320e079121629197966fdd2b2404aa6edb..24bfeafe06522d730c736a3bd82a83491562a42e 100644 (file)
@@ -46,17 +46,17 @@ import org.slf4j.LoggerFactory;
 public class ForwardingRulesSyncProvider implements AutoCloseable, BindingAwareProvider {
 
     private static final Logger LOG = LoggerFactory.getLogger(ForwardingRulesSyncProvider.class);
-    public static final int STARTUP_LOOP_TICK = 500;
-    public static final int STARTUP_LOOP_MAX_RETRIES = 8;
+    private static final int STARTUP_LOOP_TICK = 500;
+    private static final int STARTUP_LOOP_MAX_RETRIES = 8;
 
     private final DataBroker dataService;
     private final SalTableService salTableService;
     private final SalFlatBatchService flatBatchService;
 
-    /** wildcard path to flow-capable-node augmentation of inventory node */
+    /** Wildcard path to flow-capable-node augmentation of inventory node. */
     private static final InstanceIdentifier<FlowCapableNode> FLOW_CAPABLE_NODE_WC_PATH =
             InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class);
-    /** wildcard path to node (not flow-capable-node augmentation) of inventory node */
+    /** Wildcard path to node (not flow-capable-node augmentation) of inventory node. */
     private static final InstanceIdentifier<Node> NODE_WC_PATH =
             InstanceIdentifier.create(Nodes.class).child(Node.class);
 
index 17c500f003ca86bf992eed0db8ea6ea0d42de5be..3e7c55dea9c9d51a12134e00267455234e973a3c 100644 (file)
@@ -30,7 +30,7 @@ public final class FrmExecutors {
     }\r
 \r
     /**\r
-     * This will be rewritten in JUnits using SynchronousExecutorService\r
+     * This will be rewritten in JUnits using SynchronousExecutorService.\r
      */\r
     @VisibleForTesting // should not be private and final\r
     static PceExecutorsFactory DEFAULT_EXECUTORS = new PceExecutorsFactory() {\r
index 58faaab38f5706135eebd49fa8406e70ffe1aca8..aef44f12b64bf85bf395986d60baaac22fa5e186 100644 (file)
@@ -47,7 +47,7 @@ public class MeterForwarder implements ForwardingRulesCommitter<Meter, AddMeterO
 
         LOG.trace("Received the Meter REMOVE request [Tbl id, node Id {} {}",
                 identifier, nodeIdent);
-        
+
         final RemoveMeterInputBuilder builder = new RemoveMeterInputBuilder(removeDataObj);
 
         builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
@@ -61,7 +61,7 @@ public class MeterForwarder implements ForwardingRulesCommitter<Meter, AddMeterO
                                                        final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.trace("Received the Meter UPDATE request [Tbl id, node Id {} {} {}",
                 identifier, nodeIdent, update);
-        
+
         final UpdateMeterInputBuilder builder = new UpdateMeterInputBuilder();
 
         builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
@@ -77,7 +77,7 @@ public class MeterForwarder implements ForwardingRulesCommitter<Meter, AddMeterO
                                                  final InstanceIdentifier<FlowCapableNode> nodeIdent) {
         LOG.trace("Received the Meter ADD request [Tbl id, node Id {} {} {}",
                 identifier, nodeIdent, addDataObj);
-        
+
         final AddMeterInputBuilder builder = new AddMeterInputBuilder(addDataObj);
 
         builder.setNode(new NodeRef(nodeIdent.firstIdentifierOf(Node.class)));
index 298fb6d15df4505c3286139f4088d2afe912882c..8cad7e50ed5b1ac36f8b3c32d5b06a1bb043ef3f 100644 (file)
@@ -45,11 +45,10 @@ public class SimplifiedConfigListener extends AbstractFrmSyncListener<FlowCapabl
         LOG.trace("Inventory Config changes {}", modifications.size());
         super.onDataTreeChanged(modifications);
     }
-    
+
     /**
      * Compare cached operational with current config modification. If operational is not present
      * skip calling Inventory RPCs.
-     * 
      * @throws InterruptedException from syncup
      */
     protected Optional<ListenableFuture<Boolean>> processNodeModification(
@@ -71,11 +70,11 @@ public class SimplifiedConfigListener extends AbstractFrmSyncListener<FlowCapabl
         final FlowCapableNode dataAfter = configModification.getDataAfter();
         final ListenableFuture<Boolean> endResult;
         if (dataBefore == null && dataAfter != null) {
-            endResult = onNodeAdded(nodePath, dataBefore, dataAfter, operationalNode.get());
+            endResult = onNodeAdded(nodePath, dataAfter, operationalNode.get());
         } else if (dataBefore != null && dataAfter == null) {
-            endResult = onNodeDeleted(nodePath, dataBefore, operationalNode.get());
+            endResult = onNodeDeleted(nodePath, dataBefore);
         } else {
-            endResult = onNodeUpdated(nodePath, dataBefore, dataAfter, operationalNode.get());
+            endResult = onNodeUpdated(nodePath, dataBefore, dataAfter);
         }
 
         return Optional.of(endResult);
@@ -91,10 +90,10 @@ public class SimplifiedConfigListener extends AbstractFrmSyncListener<FlowCapabl
      * optimal case (but the switch could be reprogrammed by another person/system.</li>
      * </ul>
      */
-    protected ListenableFuture<Boolean> onNodeAdded(InstanceIdentifier<FlowCapableNode> nodePath,
-            FlowCapableNode dataBefore, FlowCapableNode dataAfter, FlowCapableNode operationalNode)
-                    throws InterruptedException {
-        LOG.trace("onNodeAdded {}", nodePath);
+    private ListenableFuture<Boolean> onNodeAdded(InstanceIdentifier<FlowCapableNode> nodePath,
+                           FlowCapableNode dataAfter, FlowCapableNode operationalNode) throws InterruptedException {
+        NodeId nodeId = PathUtil.digNodeId(nodePath);
+        LOG.trace("onNodeAdded {}", nodeId);
         final ListenableFuture<Boolean> endResult = reactor.syncup(nodePath, dataAfter, operationalNode, dsType());
         return endResult;
     }
@@ -106,10 +105,10 @@ public class SimplifiedConfigListener extends AbstractFrmSyncListener<FlowCapabl
      * system which is updating operational store (that components is also trying to solve
      * scale/performance issues on several layers).
      */
-    protected ListenableFuture<Boolean> onNodeUpdated(InstanceIdentifier<FlowCapableNode> nodePath,
-            FlowCapableNode dataBefore, FlowCapableNode dataAfter, FlowCapableNode operationalNodeNode)
-                    throws InterruptedException {
-        LOG.trace("onNodeUpdated {}", nodePath);
+    private ListenableFuture<Boolean> onNodeUpdated(InstanceIdentifier<FlowCapableNode> nodePath,
+                          FlowCapableNode dataBefore, FlowCapableNode dataAfter) throws InterruptedException {
+        NodeId nodeId = PathUtil.digNodeId(nodePath);
+        LOG.trace("onNodeUpdated {}", nodeId);
         final ListenableFuture<Boolean> endResult = reactor.syncup(nodePath, dataAfter, dataBefore, dsType());
         return endResult;
     }
@@ -119,9 +118,10 @@ public class SimplifiedConfigListener extends AbstractFrmSyncListener<FlowCapabl
      * probably optimized using dedicated wipe-out RPC, but it has impact on switch if it is
      * programmed by two person/system
      */
-    protected ListenableFuture<Boolean> onNodeDeleted(InstanceIdentifier<FlowCapableNode> nodePath,
-            FlowCapableNode dataBefore, FlowCapableNode operationalNode) throws InterruptedException {
-        LOG.trace("onNodeDeleted {}", nodePath);
+    private ListenableFuture<Boolean> onNodeDeleted(InstanceIdentifier<FlowCapableNode> nodePath,
+                                                    FlowCapableNode dataBefore) throws InterruptedException {
+        NodeId nodeId = PathUtil.digNodeId(nodePath);
+        LOG.trace("onNodeDeleted {}", nodeId);
         final ListenableFuture<Boolean> endResult = reactor.syncup(nodePath, null, dataBefore, dsType());
         return endResult;
     }
index 2563fa9dedac977487d8595e02dd4a673c9fcb89..738a652e5e0e08741a0f47d37d850223e235f573 100644 (file)
@@ -16,7 +16,6 @@ import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
 import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType;
 import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.openflowplugin.applications.frsync.SyncReactor;
 import org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeDao;
 import org.opendaylight.openflowplugin.applications.frsync.dao.FlowCapableNodeSnapshotDao;
@@ -36,9 +35,9 @@ import org.slf4j.LoggerFactory;
 public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node> {
     private static final Logger LOG = LoggerFactory.getLogger(SimplifiedOperationalListener.class);
 
-    protected final SyncReactor reactor;
-    protected final FlowCapableNodeSnapshotDao operationalSnapshot;
-    protected final FlowCapableNodeDao configDao;
+    private final SyncReactor reactor;
+    private final FlowCapableNodeSnapshotDao operationalSnapshot;
+    private final FlowCapableNodeDao configDao;
 
     public SimplifiedOperationalListener(SyncReactor reactor, FlowCapableNodeSnapshotDao operationalSnapshot,
                                          FlowCapableNodeDao configDao) {
@@ -64,7 +63,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
      * @throws InterruptedException from syncup
      */
     protected Optional<ListenableFuture<Boolean>> processNodeModification(
-            DataTreeModification<Node> modification) throws ReadFailedException, InterruptedException {
+            DataTreeModification<Node> modification) throws InterruptedException {
 
         updateCache(modification);
         if (isReconciliationNeeded(modification)) {
@@ -96,7 +95,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
     }
 
     /**
-     * ModificationType.DELETE
+     * ModificationType.DELETE.
      */
     private boolean isDelete(DataTreeModification<Node> modification) {
         if (ModificationType.DELETE == modification.getRootNode().getModificationType()) {
@@ -163,7 +162,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
         }
     }
 
-    static FlowCapableNode flowCapableNodeAfter(DataTreeModification<Node> modification) {
+    private static FlowCapableNode flowCapableNodeAfter(DataTreeModification<Node> modification) {
         final Node dataAfter = modification.getRootNode().getDataAfter();
         if (dataAfter == null) {
             return null;
@@ -171,7 +170,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
         return dataAfter.getAugmentation(FlowCapableNode.class);
     }
 
-    static boolean safeConnectorsEmpty(Node node) {
+    private static boolean safeConnectorsEmpty(Node node) {
         if (node == null) {
             return true;
         }
@@ -181,7 +180,7 @@ public class SimplifiedOperationalListener extends AbstractFrmSyncListener<Node>
         return nodeConnectors == null || nodeConnectors.isEmpty();
     }
 
-    static String nodeIdValue(DataTreeModification<Node> modification) {
+    private static String nodeIdValue(DataTreeModification<Node> modification) {
         final NodeId nodeId = nodeId(modification);
 
         if (nodeId == null) {
index 849a27826a2e59e507200dbeaaad2b4294b6d458..924e26f9ca44c54185162eb8d06ae1405e500e0b 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
-import com.google.common.annotations.VisibleForTesting;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -69,8 +68,7 @@ public class SimplifiedOperationalRetryListener extends SimplifiedOperationalLis
      * @param modification operational modification
      * @return true if device is registered for retry and actual modification is consistent, false otherwise
      */
-    @VisibleForTesting
-    boolean isRegisteredAndConsistentForRetry(DataTreeModification<Node> modification) {
+    private boolean isRegisteredAndConsistentForRetry(DataTreeModification<Node> modification) {
         final NodeId nodeId = PathUtil.digNodeId(modification.getRootPath().getRootIdentifier());
 
         if (!retryRegistry.isRegistered(nodeId)) {
@@ -98,7 +96,7 @@ public class SimplifiedOperationalRetryListener extends SimplifiedOperationalLis
         }
 
         try {
-            Date timestampOfRegistration = retryRegistry.getRegistration(nodeId);;
+            Date timestampOfRegistration = retryRegistry.getRegistration(nodeId);
             final SimpleDateFormat simpleDateFormat = new SimpleDateFormat(RetryRegistry.DATE_AND_TIME_FORMAT);
             Date timestampOfStatistics = simpleDateFormat.parse(gatheringStatusEnd.getEnd().getValue());
             if (timestampOfStatistics.after(timestampOfRegistration)) {
index 1eaa81731f3bfe05ec3178381e82beac9ea76bfb..ae0585a4d57efcab0fc5d702b5104bb272a78aa8 100644 (file)
@@ -28,12 +28,10 @@ import org.slf4j.LoggerFactory;
 public class SyncReactorFutureDecorator implements SyncReactor {\r
 \r
     private static final Logger LOG = LoggerFactory.getLogger(SyncReactorFutureDecorator.class);\r
-\r
+    public static final String FRM_RPC_CLIENT_PREFIX = "FRM-RPC-client-";\r
     private final SyncReactor delegate;\r
     private final ListeningExecutorService executorService;\r
 \r
-    public static final String FRM_RPC_CLIENT_PREFIX = "FRM-RPC-client-";\r
-\r
     public SyncReactorFutureDecorator(SyncReactor delegate, ListeningExecutorService executorService) {\r
         this.delegate = delegate;\r
         this.executorService = executorService;\r
@@ -43,7 +41,7 @@ public class SyncReactorFutureDecorator implements SyncReactor {
                                             final FlowCapableNode configTree, final FlowCapableNode operationalTree,\r
                                             final LogicalDatastoreType dsType) throws InterruptedException {\r
         final NodeId nodeId = PathUtil.digNodeId(flowcapableNodePath);\r
-        LOG.trace("syncup {}", nodeId.getValue());\r
+        LOG.trace("syncup future {}", nodeId.getValue());\r
 \r
         final ListenableFuture<Boolean> syncup = executorService.submit(new Callable<Boolean>() {\r
             public Boolean call() throws Exception {\r
@@ -70,17 +68,12 @@ public class SyncReactorFutureDecorator implements SyncReactor {
                                                          final FlowCapableNode configTree, final FlowCapableNode operationalTree,\r
                                                          final LogicalDatastoreType dsType) throws InterruptedException {\r
         final NodeId nodeId = PathUtil.digNodeId(flowcapableNodePath);\r
-        LOG.trace("doSyncupInFuture {}", nodeId.getValue());\r
+        LOG.trace("doSyncupInFuture future {}", nodeId.getValue());\r
 \r
         return delegate.syncup(flowcapableNodePath, configTree, operationalTree, dsType);\r
     }\r
 \r
-    static String threadName() {\r
-        final Thread currentThread = Thread.currentThread();\r
-        return currentThread.getName();\r
-    }\r
-\r
-    protected String updateThreadName(NodeId nodeId) {\r
+    private String updateThreadName(NodeId nodeId) {\r
         final Thread currentThread = Thread.currentThread();\r
         final String oldName = currentThread.getName();\r
         try {\r
@@ -95,7 +88,7 @@ public class SyncReactorFutureDecorator implements SyncReactor {
         return oldName;\r
     }\r
 \r
-    protected String updateThreadName(String name) {\r
+    private String updateThreadName(String name) {\r
         final Thread currentThread = Thread.currentThread();\r
         final String oldName = currentThread.getName();\r
         try {\r
index 15b79ec2224a174df5f21cf8af0ccc2b64b38269..a3edde05a884882b7f86eaa5029012346f1af9af 100644 (file)
@@ -8,7 +8,6 @@
 
 package org.opendaylight.openflowplugin.applications.frsync.impl;
 
-import com.google.common.annotations.VisibleForTesting;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
@@ -34,8 +33,8 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
     private static final Logger LOG = LoggerFactory.getLogger(SyncReactorFutureZipDecorator.class);
 
     @GuardedBy("compressionGuard")
-    protected final Map<InstanceIdentifier<FlowCapableNode>, ZipQueueEntry> compressionQueue = new HashMap<>();
-    protected final Semaphore compressionGuard = new Semaphore(1, false);
+    private final Map<InstanceIdentifier<FlowCapableNode>, ZipQueueEntry> compressionQueue = new HashMap<>();
+    private final Semaphore compressionGuard = new Semaphore(1, false);
 
     public SyncReactorFutureZipDecorator(SyncReactor delegate, ListeningExecutorService executorService) {
         super(delegate, executorService);
@@ -79,9 +78,9 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
      * If there is config delta in compression queue for the device and new configuration is coming,
      * update its zip queue entry. Create/replace zip queue entry for the device with operational delta otherwise.
      */
-    protected boolean updateCompressionState(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
-                                             final FlowCapableNode configTree, final FlowCapableNode operationalTree,
-                                             final LogicalDatastoreType dsType) {
+    private boolean updateCompressionState(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
+                                           final FlowCapableNode configTree, final FlowCapableNode operationalTree,
+                                           final LogicalDatastoreType dsType) {
         final ZipQueueEntry previousEntry = compressionQueue.get(flowcapableNodePath);
 
         if (previousEntry != null && dsType == LogicalDatastoreType.CONFIGURATION
@@ -118,8 +117,4 @@ public class SyncReactorFutureZipDecorator extends SyncReactorFutureDecorator {
         }
     }
 
-    @VisibleForTesting
-    Map<InstanceIdentifier<FlowCapableNode>, ZipQueueEntry> getCompressionQueue() {
-        return compressionQueue;
-    }
 }
\ No newline at end of file
index 90ead252bc52be1c458fb118b7e2b9da0199206e..f879aea76f3a3ddee05b77e71ffe9fb7b159edaa 100644 (file)
@@ -45,7 +45,7 @@ public class SyncReactorGuardDecorator implements SyncReactor {
                                             final FlowCapableNode configTree, final FlowCapableNode operationalTree,\r
                                             final LogicalDatastoreType dsType) throws InterruptedException {\r
         final NodeId nodeId = PathUtil.digNodeId(flowcapableNodePath);\r
-        LOG.trace("syncup {}", nodeId.getValue());\r
+        LOG.trace("syncup guard {}", nodeId.getValue());\r
 \r
         final long stampBeforeGuard = System.nanoTime();\r
         final Semaphore guard = summonGuardAndAcquire(flowcapableNodePath);//TODO handle InteruptedException\r
@@ -66,48 +66,47 @@ public class SyncReactorGuardDecorator implements SyncReactor {
                 public void onSuccess(@Nullable final Boolean result) {\r
                     if (LOG.isDebugEnabled()) {\r
                         final long stampFinished = System.nanoTime();\r
-                        LOG.debug("syncup finished {} took:{} rpc:{} wait:{} guard:{}, thread:{}", nodeId.getValue(),\r
+                        LOG.debug("syncup finished {} took:{} rpc:{} wait:{} guard:{} permits thread:{}", nodeId.getValue(),\r
                                 formatNanos(stampFinished - stampBeforeGuard),\r
                                 formatNanos(stampFinished - stampAfterGuard),\r
                                 formatNanos(stampAfterGuard - stampBeforeGuard),\r
-                                guard, threadName());\r
+                                guard.availablePermits(), threadName());\r
                     }\r
 \r
-                    releaseGuardForNodeId(nodeId, guard);\r
+                    releaseGuardForNodeId(guard);\r
                 }\r
 \r
                 @Override\r
                 public void onFailure(final Throwable t) {\r
                     if (LOG.isDebugEnabled()) {\r
                         final long stampFinished = System.nanoTime();\r
-                        LOG.warn("syncup failed {} took:{} rpc:{} wait:{} guard:{} thread:{}", nodeId.getValue(),\r
+                        LOG.warn("syncup failed {} took:{} rpc:{} wait:{} guard:{} permits thread:{}", nodeId.getValue(),\r
                                 formatNanos(stampFinished - stampBeforeGuard),\r
                                 formatNanos(stampFinished - stampAfterGuard),\r
                                 formatNanos(stampAfterGuard - stampBeforeGuard),\r
-                                guard, threadName());\r
+                                guard.availablePermits(), threadName());\r
                     }\r
 \r
-                    releaseGuardForNodeId(nodeId, guard);\r
+                    releaseGuardForNodeId(guard);\r
                 }\r
             });\r
             return endResult;\r
-        } catch(InterruptedException e) {\r
-            releaseGuardForNodeId(nodeId, guard);\r
+        } catch (InterruptedException e) {\r
+            releaseGuardForNodeId(guard);\r
             throw e;\r
         }\r
     }\r
 \r
-    protected String formatNanos(long nanos) {\r
+    private String formatNanos(long nanos) {\r
         return "'" + TimeUnit.NANOSECONDS.toMillis(nanos) + " ms'";\r
     }\r
 \r
     /**\r
-     * get guard\r
-     *\r
+     * Get guard and lock for node.\r
      * @param flowcapableNodePath II of node for which guard should be acquired\r
      * @return semaphore guard\r
      */\r
-    protected Semaphore summonGuardAndAcquire(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath)\r
+    private Semaphore summonGuardAndAcquire(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath)\r
             throws InterruptedException {\r
         final Semaphore guard = Preconditions.checkNotNull(semaphoreKeeper.summonGuard(flowcapableNodePath),\r
                 "no guard for " + flowcapableNodePath);\r
@@ -126,19 +125,17 @@ public class SyncReactorGuardDecorator implements SyncReactor {
     }\r
 \r
     /**\r
-     * unlock per node\r
-     *\r
-     * @param nodeId NodeId of node which should be unlocked\r
-     * @param guard semaphore guard\r
+     * Unlock and release guard.\r
+     * @param guard semaphore guard which should be unlocked\r
      */\r
-    protected void releaseGuardForNodeId(final NodeId nodeId, final Semaphore guard) {\r
+    private void releaseGuardForNodeId(final Semaphore guard) {\r
         if (guard == null) {\r
             return;\r
         }\r
         guard.release();\r
     }\r
 \r
-    static String threadName() {\r
+    private static String threadName() {\r
         final Thread currentThread = Thread.currentThread();\r
         return currentThread.getName();\r
     }\r
index 0528470789958bd1b5c035bc00e60dcaf6161d10..504d583d032f8a02dc029067e20e4cc593265a9f 100644 (file)
@@ -60,8 +60,10 @@ public class SyncReactorImpl implements SyncReactor {
                                             final FlowCapableNode configTree, final FlowCapableNode operationalTree,
                                             final LogicalDatastoreType dsType) {
 
-        LOG.trace("syncup {} cfg:{} oper:{}", nodeIdent, configTree == null ? "is null" : "non null", operationalTree == null ? "is null" : "non null");
+        final NodeId nodeId = PathUtil.digNodeId(nodeIdent);
+        LOG.trace("syncup impl {} cfg:{} oper:{}", nodeId.getValue(), configTree == null ? "is null" : "non null", operationalTree == null ? "is null" : "non null");
         final SyncCrudCounters counters = new SyncCrudCounters();
+
         /**
          * instructions:
          *  - extract diff changes and prepare change steps in safe order
@@ -75,8 +77,6 @@ public class SyncReactorImpl implements SyncReactor {
          *  - flows - meters - groups (reordered)
          **/
 
-        final NodeId nodeId = PathUtil.digNodeId(nodeIdent);
-
         final List<ItemSyncBox<Group>> groupsToAddOrUpdate = extractGroupsToAddOrUpdate(nodeId, configTree, operationalTree);
         final ItemSyncBox<Meter> metersToAddOrUpdate = extractMetersToAddOrUpdate(nodeId, configTree, operationalTree);
         final Map<TableKey, ItemSyncBox<Flow>> flowsToAddOrUpdate = extractFlowsToAddOrUpdate(nodeId, configTree, operationalTree);
@@ -130,9 +130,9 @@ public class SyncReactorImpl implements SyncReactor {
     }
 
     @VisibleForTesting
-    static List<ItemSyncBox<Group>> extractGroupsToAddOrUpdate(final NodeId nodeId,
-                                                               final FlowCapableNode flowCapableNodeConfigured,
-                                                               final FlowCapableNode flowCapableNodeOperational) {
+    private static List<ItemSyncBox<Group>> extractGroupsToAddOrUpdate(final NodeId nodeId,
+                                                                       final FlowCapableNode flowCapableNodeConfigured,
+                                                                       final FlowCapableNode flowCapableNodeOperational) {
         final List<Group> groupsConfigured = ReconcileUtil.safeGroups(flowCapableNodeConfigured);
         final List<Group> groupsOperational = ReconcileUtil.safeGroups(flowCapableNodeOperational);
         final Map<Long, Group> groupOperationalMap = FlowCapableNodeLookups.wrapGroupsToMap(groupsOperational);
@@ -144,9 +144,9 @@ public class SyncReactorImpl implements SyncReactor {
     }
 
     @VisibleForTesting
-    static ItemSyncBox<Meter> extractMetersToAddOrUpdate(final NodeId nodeId,
-                                                         final FlowCapableNode flowCapableNodeConfigured,
-                                                         final FlowCapableNode flowCapableNodeOperational) {
+    private static ItemSyncBox<Meter> extractMetersToAddOrUpdate(final NodeId nodeId,
+                                                                 final FlowCapableNode flowCapableNodeConfigured,
+                                                                 final FlowCapableNode flowCapableNodeOperational) {
         final List<Meter> metersConfigured = ReconcileUtil.safeMeters(flowCapableNodeConfigured);
         final List<Meter> metersOperational = ReconcileUtil.safeMeters(flowCapableNodeOperational);
         final Map<MeterId, Meter> meterOperationalMap = FlowCapableNodeLookups.wrapMetersToMap(metersOperational);
@@ -155,9 +155,9 @@ public class SyncReactorImpl implements SyncReactor {
     }
 
     @VisibleForTesting
-    static Map<TableKey, ItemSyncBox<Flow>> extractFlowsToAddOrUpdate(final NodeId nodeId,
-                                                                      final FlowCapableNode flowCapableNodeConfigured,
-                                                                      final FlowCapableNode flowCapableNodeOperational) {
+    private static Map<TableKey, ItemSyncBox<Flow>> extractFlowsToAddOrUpdate(final NodeId nodeId,
+                                                                              final FlowCapableNode flowCapableNodeConfigured,
+                                                                              final FlowCapableNode flowCapableNodeOperational) {
         final List<Table> tablesConfigured = ReconcileUtil.safeTables(flowCapableNodeConfigured);
         if (tablesConfigured.isEmpty()) {
             return Collections.emptyMap();
@@ -170,9 +170,9 @@ public class SyncReactorImpl implements SyncReactor {
     }
 
     @VisibleForTesting
-    static Map<TableKey, ItemSyncBox<Flow>> extractFlowsToRemove(final NodeId nodeId,
-                                                                 final FlowCapableNode flowCapableNodeConfigured,
-                                                                 final FlowCapableNode flowCapableNodeOperational) {
+    private static Map<TableKey, ItemSyncBox<Flow>> extractFlowsToRemove(final NodeId nodeId,
+                                                                         final FlowCapableNode flowCapableNodeConfigured,
+                                                                         final FlowCapableNode flowCapableNodeOperational) {
         final List<Table> tablesOperational = ReconcileUtil.safeTables(flowCapableNodeOperational);
         if (tablesOperational.isEmpty()) {
             return Collections.emptyMap();
@@ -185,9 +185,9 @@ public class SyncReactorImpl implements SyncReactor {
     }
 
     @VisibleForTesting
-    static ItemSyncBox<Meter> extractMetersToRemove(final NodeId nodeId,
-                                                    final FlowCapableNode flowCapableNodeConfigured,
-                                                    final FlowCapableNode flowCapableNodeOperational) {
+    private static ItemSyncBox<Meter> extractMetersToRemove(final NodeId nodeId,
+                                                            final FlowCapableNode flowCapableNodeConfigured,
+                                                            final FlowCapableNode flowCapableNodeOperational) {
         final List<Meter> metersConfigured = ReconcileUtil.safeMeters(flowCapableNodeConfigured);
         final List<Meter> metersOperational = ReconcileUtil.safeMeters(flowCapableNodeOperational);
         final Map<MeterId, Meter> meterConfiguredMap = FlowCapableNodeLookups.wrapMetersToMap(metersConfigured);
@@ -196,9 +196,9 @@ public class SyncReactorImpl implements SyncReactor {
     }
 
     @VisibleForTesting
-    static List<ItemSyncBox<Group>> extractGroupsToRemove(final NodeId nodeId,
-                                                          final FlowCapableNode flowCapableNodeConfigured,
-                                                          final FlowCapableNode flowCapableNodeOperational) {
+    private static List<ItemSyncBox<Group>> extractGroupsToRemove(final NodeId nodeId,
+                                                                  final FlowCapableNode flowCapableNodeConfigured,
+                                                                  final FlowCapableNode flowCapableNodeOperational) {
         final List<Group> groupsConfigured = ReconcileUtil.safeGroups(flowCapableNodeConfigured);
         final List<Group> groupsOperational = ReconcileUtil.safeGroups(flowCapableNodeOperational);
         final Map<Long, Group> groupConfiguredMap = FlowCapableNodeLookups.wrapGroupsToMap(groupsConfigured);
index 9a6669ba7ab2fbae5e38f594ff46b8bad03de007..d504855c9283077bb032c7457b3115e48e7aa84b 100644 (file)
@@ -24,21 +24,21 @@ import org.slf4j.LoggerFactory;
 /**
  * Adding retry mechanism in case of unsuccessful syncup.
  */
-public class SyncReactorRetryDecorator implements SyncReactor{
+public class SyncReactorRetryDecorator implements SyncReactor {
 
     private static final Logger LOG = LoggerFactory.getLogger(SyncReactorRetryDecorator.class);
 
     private final SyncReactor delegate;
     private final RetryRegistry retryRegistry;
 
-    public SyncReactorRetryDecorator (final SyncReactor delegate, RetryRegistry retryRegistry) {
+    public SyncReactorRetryDecorator(final SyncReactor delegate, RetryRegistry retryRegistry) {
         this.delegate = delegate;
         this.retryRegistry = retryRegistry;
     }
 
-    public ListenableFuture<Boolean> syncup (final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
-                                             final FlowCapableNode configTree, final FlowCapableNode operationalTree,
-                                             final LogicalDatastoreType dsType) throws InterruptedException {
+    public ListenableFuture<Boolean> syncup(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
+                                            final FlowCapableNode configTree, final FlowCapableNode operationalTree,
+                                            final LogicalDatastoreType dsType) throws InterruptedException {
 
         final NodeId nodeId = PathUtil.digNodeId(flowcapableNodePath);
         LOG.trace("syncup retry {}", nodeId.getValue());
index 4a56acb38b124625ef4dfd9828b864f6d5e7b238..3f4b53efdb850e00fbe6792a3000fc50d54eb415 100644 (file)
@@ -152,7 +152,7 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
     }
 
 
-    protected ListenableFuture<RpcResult<Void>> addMissingFlows(final NodeId nodeId,
+    ListenableFuture<RpcResult<Void>> addMissingFlows(final NodeId nodeId,
                                                                 final InstanceIdentifier<FlowCapableNode> nodeIdent,
                                                                 final Map<TableKey, ItemSyncBox<Flow>> flowsInTablesSyncBox,
                                                                 final SyncCrudCounters counters) {
@@ -216,7 +216,7 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
                 */
     }
 
-    protected ListenableFuture<RpcResult<Void>> removeRedundantFlows(final NodeId nodeId,
+    ListenableFuture<RpcResult<Void>> removeRedundantFlows(final NodeId nodeId,
                                                                      final InstanceIdentifier<FlowCapableNode> nodeIdent,
                                                                      final Map<TableKey, ItemSyncBox<Flow>> removalPlan,
                                                                      final SyncCrudCounters counters) {
@@ -249,7 +249,7 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
 
     }
 
-    protected ListenableFuture<RpcResult<Void>> removeRedundantMeters(final NodeId nodeId,
+    ListenableFuture<RpcResult<Void>> removeRedundantMeters(final NodeId nodeId,
                                                                       final InstanceIdentifier<FlowCapableNode> nodeIdent,
                                                                       final ItemSyncBox<Meter> meterRemovalPlan,
                                                                       final SyncCrudCounters counters) {
@@ -412,7 +412,7 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
                         PathUtil.digNodePath(nodeIdent), transactionService));
     }
 
-    protected ListenableFuture<RpcResult<Void>> addMissingMeters(final NodeId nodeId,
+    ListenableFuture<RpcResult<Void>> addMissingMeters(final NodeId nodeId,
                                                                  final InstanceIdentifier<FlowCapableNode> nodeIdent,
                                                                  final ItemSyncBox<Meter> syncBox,
                                                                  final SyncCrudCounters counters) {
@@ -463,7 +463,7 @@ public class SyncPlanPushStrategyIncrementalImpl implements SyncPlanPushStrategy
                 */
     }
 
-    protected ListenableFuture<RpcResult<Void>> addMissingGroups(final NodeId nodeId,
+    ListenableFuture<RpcResult<Void>> addMissingGroups(final NodeId nodeId,
                                                                  final InstanceIdentifier<FlowCapableNode> nodeIdent,
                                                                  final List<ItemSyncBox<Group>> groupsAddPlan,
                                                                  final SyncCrudCounters counters) {
index a0b9fde0af446c292cdaad3c09188b48b2d36ebe..f5b86cdc741c57c85ba4ce1c84d6a23492503b67 100644 (file)
@@ -24,12 +24,12 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 public class SynchronizationDiffInput {
 
     private final InstanceIdentifier<FlowCapableNode> nodeIdent;
-    final List<ItemSyncBox<Group>> groupsToAddOrUpdate;
-    final ItemSyncBox<Meter> metersToAddOrUpdate;
-    final Map<TableKey, ItemSyncBox<Flow>> flowsToAddOrUpdate;
-    final Map<TableKey, ItemSyncBox<Flow>> flowsToRemove;
-    final ItemSyncBox<Meter> metersToRemove;
-    final List<ItemSyncBox<Group>> groupsToRemove;
+    private final List<ItemSyncBox<Group>> groupsToAddOrUpdate;
+    private final ItemSyncBox<Meter> metersToAddOrUpdate;
+    private final Map<TableKey, ItemSyncBox<Flow>> flowsToAddOrUpdate;
+    private final Map<TableKey, ItemSyncBox<Flow>> flowsToRemove;
+    private final ItemSyncBox<Meter> metersToRemove;
+    private final List<ItemSyncBox<Group>> groupsToRemove;
 
     public SynchronizationDiffInput(final InstanceIdentifier<FlowCapableNode> nodeIdent,
                                     final List<ItemSyncBox<Group>> groupsToAddOrUpdate,
index 1a6b277962b0fc36011366ea7261338d0543733f..52d0623d00d7a35ce044ce464525bdd7ee768b37 100644 (file)
@@ -68,7 +68,7 @@ public final class FlowCapableNodeLookups {
 
         return flowMap;
     }
-    
+
     public static Flow flowMapLookupExisting(Flow flow, Map<SwitchFlowId, Flow> flowConfigMap) {
         return flowConfigMap.get(new SwitchFlowId(flow));
     }
index 6635d0a5d3ddbc4e44c479366fcbdbc69cb51420..1e9b49ea9ae1d1b70ea53cab3e63f0d7b37d6c2f 100644 (file)
@@ -33,8 +33,7 @@ public class ItemSyncBox<I> {
     }
 
     /**
-     * Tuple holder for original and updated item
-     *
+     * Tuple holder for original and updated item.
      * @param <I> basic type
      */
     public static final class ItemUpdateTuple<I> {
index 2cd6204033839af51e4372ff0f9980069c3285dc..419525a1326b97c4d2e008bb47d3fa8faf1df534 100644 (file)
@@ -40,7 +40,7 @@ public class SemaphoreKeeperGuavaImpl<K> implements SemaphoreKeeper<K> {
     public Semaphore summonGuard(final @Nonnull K key) {
         return semaphoreCache.getUnchecked(key);
     }
-    
+
     @Override
     public String toString() {
         return super.toString() + " size:" + (semaphoreCache == null ? null : semaphoreCache.size()) + " " + semaphoreCache;
index 13077a1d12af5da619183d09107bb18b079ea566..ec4d8a87fa2120ddbf5870ca699574f7b72a31e6 100644 (file)
@@ -9,21 +9,22 @@
 package org.opendaylight.openflowplugin.applications.frsync.util;
 
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.openflowplugin.applications.frsync.impl.SyncReactorFutureZipDecorator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 
 /**
- * Simple compression queue entry for {@link org.opendaylight.openflowplugin.applications.frsync.impl.SyncReactorFutureZipDecorator}.
+ * Simple compression queue entry for {@link SyncReactorFutureZipDecorator}.
  */
 public class ZipQueueEntry {
-    private FlowCapableNode after;
-    private FlowCapableNode before;
-    private LogicalDatastoreType dsTypeBefore;
+    private final FlowCapableNode after;
+    private final FlowCapableNode before;
+    private final LogicalDatastoreType dsTypeBefore;
 
-    public ZipQueueEntry(final FlowCapableNode after, final FlowCapableNode before, final LogicalDatastoreType dsTypeBefore) {
+    public ZipQueueEntry(final FlowCapableNode after, final FlowCapableNode before,
+                         final LogicalDatastoreType dsTypeBefore) {
         this.after = after;
         this.before = before;
         this.dsTypeBefore = dsTypeBefore;
-
     }
 
     public FlowCapableNode getLeft() {
index e118a347f4dd21d1ec8b83929749636c05413757..1bf41a49cbb9ec9c20d63761c999f8638a6ae6c5 100644 (file)
@@ -34,7 +34,7 @@ public class SyncReactorRetryDecoratorTest {
     private static final NodeId NODE_ID = new NodeId("test-node");
     private SyncReactorRetryDecorator reactor;
     private InstanceIdentifier<FlowCapableNode> fcNodePath;
-    final LogicalDatastoreType dsType = LogicalDatastoreType.CONFIGURATION;
+    private final LogicalDatastoreType dsType = LogicalDatastoreType.CONFIGURATION;
 
     @Mock
     private SyncReactorImpl delegate;
index 75a34b81a09920396f4e74a35386c6770217ebd1..99358de3e2b0e71b0b56889bcef398813342af01 100644 (file)
@@ -65,8 +65,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Test for {@link SyncPlanPushStrategyIncrementalImpl}.
@@ -74,8 +72,6 @@ import org.slf4j.LoggerFactory;
 @RunWith(MockitoJUnitRunner.class)
 public class SyncPlanPushStrategyIncrementalImplTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger(SyncPlanPushStrategyIncrementalImplTest.class);
-
     private static final NodeId NODE_ID = new NodeId("unit-nodeId");
     private static final InstanceIdentifier<FlowCapableNode> NODE_IDENT = InstanceIdentifier.create(Nodes.class)
             .child(Node.class, new NodeKey(NODE_ID)).augmentation(FlowCapableNode.class);
index ee09da96ee7447fd94ea482fb237f14537eb5d34..61fd6384b828e844fafbb5af1c2bd972a9313799 100644 (file)
@@ -61,7 +61,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 public class ReconcileUtilTest {
 
     private static final NodeId NODE_ID = new NodeId("unit-node-id");
-    private InstanceIdentifier<Node> NODE_IDENT = InstanceIdentifier.create(Nodes.class)
+    private final InstanceIdentifier<Node> NODE_IDENT = InstanceIdentifier.create(Nodes.class)
             .child(Node.class, new NodeKey(NODE_ID));
     private static final Splitter COMMA_SPLITTER = Splitter.on(",");
 
index b2d38d06ec87c36de820629eb7bbbc4e5f36fae1..8affd2a5b2444bed518cfd6019d796c810d42ef8 100644 (file)
@@ -91,7 +91,7 @@ public class SemaphoreKeeperTest {
             for (int i = 0; i < steps; i++) {
                 executorService.submit(task);
             }
-            Thread.sleep(1000L);
+            Thread.sleep(100L);
             System.gc();
 
             executorService.shutdown();