X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=applications%2Fforwardingrules-sync%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fapplications%2Ffrsync%2Futil%2FReconcileUtil.java;h=ab0ad75f2d45a1f6f4de91970409d75e703d3f5d;hb=refs%2Fchanges%2F53%2F67753%2F3;hp=9bc5fb7dcf90dbfc696e403e97cc9496d5fcbbb8;hpb=fda20d57a0c1979ff40177602981ee3851d357a2;p=openflowplugin.git diff --git a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtil.java b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtil.java index 9bc5fb7dcf..ab0ad75f2d 100644 --- a/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtil.java +++ b/applications/forwardingrules-sync/src/main/java/org/opendaylight/openflowplugin/applications/frsync/util/ReconcileUtil.java @@ -58,11 +58,14 @@ public final class ReconcileUtil { } /** + * Creates a single rpc result of type Void honoring all partial rpc results. + * * @param previousItemAction description for case when the triggering future contains failure * @param type of rpc output (gathered in list) * @return single rpc result of type Void honoring all partial rpc results */ - public static Function>, RpcResult> createRpcResultCondenser(final String previousItemAction) { + public static Function>, RpcResult> createRpcResultCondenser( + final String previousItemAction) { return input -> { final RpcResultBuilder resultSink; if (input != null) { @@ -86,11 +89,14 @@ public final class ReconcileUtil { } /** + * Creates a single rpc result of type Void honoring all partial rpc results. + * * @param actionDescription description for case when the triggering future contains failure * @param type of rpc output (gathered in list) * @return single rpc result of type Void honoring all partial rpc results */ - public static Function, RpcResult> createRpcResultToVoidFunction(final String actionDescription) { + public static Function, RpcResult> createRpcResultToVoidFunction( + final String actionDescription) { return input -> { final RpcResultBuilder resultSink; if (input != null) { @@ -110,7 +116,9 @@ public final class ReconcileUtil { } /** - * @param nodeIdent flow capable node path - target device for routed rpc + * Flushes a chain barrier. + * + * @param nodeIdent flow capable node path - target device for routed rpc * @param flowCapableTransactionService barrier rpc service * @return async barrier result */ @@ -126,7 +134,9 @@ public final class ReconcileUtil { } /** - * @param nodeId target node + * Returns a list of safe synchronization steps with updates. + * + * @param nodeId target node * @param installedGroupsArg groups resent on device * @param pendingGroups groups configured for device * @return list of safe synchronization steps with updates @@ -138,6 +148,8 @@ public final class ReconcileUtil { } /** + * Returns a list of safe synchronization steps. + * * @param nodeId target node * @param installedGroupsArg groups resent on device * @param pendingGroups groups configured for device @@ -170,8 +182,10 @@ public final class ReconcileUtil { } else { if (checkGroupPrecondition(installedGroups.keySet(), group)) { iterator.remove(); - LOG.trace("Group {} on device {} differs - planned for update", group.getGroupId(), nodeId); - stepPlan.getItemsToUpdate().add(new ItemSyncBox.ItemUpdateTuple<>(existingGroup, group)); + LOG.trace("Group {} on device {} differs - planned for update", group.getGroupId(), + nodeId); + stepPlan.getItemsToUpdate().add(new ItemSyncBox.ItemUpdateTuple<>(existingGroup, + group)); } } } @@ -187,8 +201,8 @@ public final class ReconcileUtil { installedGroups.putAll(installIncrement); plan.add(stepPlan); } else if (!pendingGroups.isEmpty()) { - LOG.warn("Failed to resolve and divide groups into preconditions-match based ordered plan: {}, " + - "resolving stuck at level {}", nodeId.getValue(), plan.size()); + LOG.warn("Failed to resolve and divide groups into preconditions-match based ordered plan: {}, " + + "resolving stuck at level {}", nodeId.getValue(), plan.size()); throw new IllegalStateException("Failed to resolve and divide groups when matching preconditions"); } } @@ -203,7 +217,7 @@ public final class ReconcileUtil { for (Action action : bucket.getAction()) { // if the output action is a group if (GroupActionCase.class.equals(action.getAction().getImplementedInterface())) { - Long groupId = ((GroupActionCase) (action.getAction())).getGroupAction().getGroupId(); + Long groupId = ((GroupActionCase) action.getAction()).getGroupAction().getGroupId(); // see if that output group is installed if (!installedGroupIds.contains(groupId)) { // if not installed, we have missing dependencies and cannot install this pending group @@ -236,6 +250,8 @@ public final class ReconcileUtil { } /** + * Resolves meter differences. + * * @param nodeId target node * @param meterOperationalMap meters present on device * @param metersConfigured meters configured for device @@ -263,6 +279,8 @@ public final class ReconcileUtil { } /** + * Resolves flow differences in a table. + * * @param flowsConfigured flows resent on device * @param flowOperationalMap flows configured for device * @param gatherUpdates check content of pending item if present on device (and create update task eventually) @@ -289,6 +307,8 @@ public final class ReconcileUtil { } /** + * Resolves flow differences in all tables. + * * @param nodeId target node * @param tableOperationalMap flow-tables resent on device * @param tablesConfigured flow-tables configured for device @@ -296,9 +316,8 @@ public final class ReconcileUtil { * @return map : key={@link TableKey}, value={@link ItemSyncBox} of safe synchronization steps */ public static Map> resolveFlowDiffsInAllTables(final NodeId nodeId, - final Map tableOperationalMap, - final List tablesConfigured, - final boolean gatherUpdates) { + final Map tableOperationalMap, final List
tablesConfigured, + final boolean gatherUpdates) { LOG.trace("resolving flows in tables for {}", nodeId.getValue()); final Map> tableFlowSyncBoxes = new HashMap<>(); for (final Table tableConfigured : tablesConfigured) {