Bug 6745 Remove thread renaming and unnecessary logging
[openflowplugin.git] / applications / forwardingrules-sync / src / main / java / org / opendaylight / openflowplugin / applications / frsync / impl / SyncReactorImpl.java
index 7f1be0b3fde15bdd1aa2ad52c279c7437e9b9efa..d1cb342cd0bc9703ee8b36173cb5536081ee505a 100644 (file)
@@ -14,6 +14,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -23,7 +24,6 @@ import org.opendaylight.openflowplugin.applications.frsync.SyncReactor;
 import org.opendaylight.openflowplugin.applications.frsync.impl.strategy.SynchronizationDiffInput;
 import org.opendaylight.openflowplugin.applications.frsync.util.CrudCounts;
 import org.opendaylight.openflowplugin.applications.frsync.util.FlowCapableNodeLookups;
-import org.opendaylight.openflowplugin.applications.frsync.util.FxChainUtil;
 import org.opendaylight.openflowplugin.applications.frsync.util.ItemSyncBox;
 import org.opendaylight.openflowplugin.applications.frsync.util.PathUtil;
 import org.opendaylight.openflowplugin.applications.frsync.util.ReconcileUtil;
@@ -61,11 +61,6 @@ public class SyncReactorImpl implements SyncReactor {
         final NodeId nodeId = PathUtil.digNodeId(nodeIdent);
         FlowCapableNode configTree = syncupEntry.getAfter();
         FlowCapableNode operationalTree = syncupEntry.getBefore();
-
-        LOG.trace("syncup reactor {} cfg:{} oper:{}",
-                nodeId.getValue(),
-                configTree == null ? "is null" : "non null",
-                operationalTree == null ? "is null" : "non null");
         final SyncCrudCounters counters = new SyncCrudCounters();
 
         /**
@@ -76,7 +71,6 @@ public class SyncReactorImpl implements SyncReactor {
          *  - recommended order follows:
          * reconciliation strategy - phase 1: - add/update missing objects in following order:
          *  - table features - groups (reordered) - meters - flows
-         *
          * reconciliation strategy - phase 2: - remove redundant objects in following order:
          *  - flows - meters - groups (reordered)
          **/
@@ -93,14 +87,10 @@ public class SyncReactorImpl implements SyncReactor {
                 groupsToAddOrUpdate, metersToAddOrUpdate, flowsToAddOrUpdate,
                 flowsToRemove, metersToRemove, groupsToRemove);
 
-        counters.setStartNano(System.nanoTime());
         final ListenableFuture<RpcResult<Void>> bootstrapResultFuture = RpcResultBuilder.<Void>success().buildFuture();
         final ListenableFuture<RpcResult<Void>> resultVehicle = syncPlanPushStrategy.executeSyncStrategy(
                 bootstrapResultFuture, input, counters);
 
-        // log final result
-        Futures.addCallback(resultVehicle, FxChainUtil.logResultCallback(nodeId, "final result"));
-
         return Futures.transform(resultVehicle, new Function<RpcResult<Void>, Boolean>() {
             @Override
             public Boolean apply(RpcResult<Void> input) {
@@ -111,14 +101,14 @@ public class SyncReactorImpl implements SyncReactor {
                     final CrudCounts flowCrudCounts = counters.getFlowCrudCounts();
                     final CrudCounts meterCrudCounts = counters.getMeterCrudCounts();
                     final CrudCounts groupCrudCounts = counters.getGroupCrudCounts();
-                    LOG.debug("syncup outcome[{}] (added/updated/removed): flow={}/{}/{}, group={}/{}/{}, meter={}/{}/{}, took={} ms",
+                    LOG.debug("syncup outcome[{}] (added/updated/removed): flow={}/{}/{}, group={}/{}/{}, " +
+                                    "meter={}/{}/{}, errors={}",
                             nodeId.getValue(),
                             flowCrudCounts.getAdded(), flowCrudCounts.getUpdated(), flowCrudCounts.getRemoved(),
                             groupCrudCounts.getAdded(), groupCrudCounts.getUpdated(), groupCrudCounts.getRemoved(),
                             meterCrudCounts.getAdded(), meterCrudCounts.getUpdated(), meterCrudCounts.getRemoved(),
-                            TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - counters.getStartNano()));
+                            Arrays.toString(input.getErrors().toArray()));
                 }
-                LOG.trace("syncup errors: {}", input.getErrors());
                 return input.isSuccessful();
             }});
     }
@@ -202,5 +192,4 @@ public class SyncReactorImpl implements SyncReactor {
 
         return ReconcileUtil.resolveAndDivideGroupDiffs(nodeId, groupConfiguredMap, pendingGroups, false);
     }
-
 }