Class ReconcileUtil
java.lang.Object
org.opendaylight.openflowplugin.applications.frsync.util.ReconcileUtil
Util methods for group reconcil task (future chaining, transforms).
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.util.concurrent.AsyncFunction<org.opendaylight.yangtools.yang.common.RpcResult<Void>,
org.opendaylight.yangtools.yang.common.RpcResult<Void>> chainBarrierFlush
(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<Node> nodeIdent, SendBarrier sendBarrier) Flushes a chain barrier.static boolean
checkGroupPrecondition
(Set<org.opendaylight.yangtools.yang.common.Uint32> installedGroupIds, Group pendingGroup) static <E> int
countTotalPushed
(Iterable<ItemSyncBox<E>> groupsAddPlan) static <E> int
countTotalUpdated
(Iterable<ItemSyncBox<E>> groupsAddPlan) static <D> com.google.common.base.Function<List<org.opendaylight.yangtools.yang.common.RpcResult<D>>,
org.opendaylight.yangtools.yang.common.RpcResult<Void>> createRpcResultCondenser
(String previousItemAction) Creates a single rpc result of type Void honoring all partial rpc results.static <D> com.google.common.base.Function<org.opendaylight.yangtools.yang.common.RpcResult<D>,
org.opendaylight.yangtools.yang.common.RpcResult<Void>> createRpcResultToVoidFunction
(String actionDescription) Creates a single rpc result of type Void honoring all partial rpc results.static List<ItemSyncBox<Group>>
resolveAndDivideGroupDiffs
(NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint32, Group> installedGroupsArg, Collection<Group> pendingGroups) Returns a list of safe synchronization steps with updates.static List<ItemSyncBox<Group>>
resolveAndDivideGroupDiffs
(NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint32, Group> installedGroupsArg, Collection<Group> pendingGroups, boolean gatherUpdates) Returns a list of safe synchronization steps.static Map<TableKey,
ItemSyncBox<Flow>> resolveFlowDiffsInAllTables
(NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint8, Table> tableOperationalMap, Collection<Table> tablesConfigured, boolean gatherUpdates) Resolves flow differences in all tables.static ItemSyncBox<Meter>
resolveMeterDiffs
(NodeId nodeId, Map<MeterId, Meter> meterOperationalMap, Collection<Meter> metersConfigured, boolean gatherUpdates) Resolves meter differences.static Collection<Group>
safeGroups
(FlowCapableNode node) static Collection<Meter>
safeMeters
(FlowCapableNode node) static Collection<Table>
safeTables
(FlowCapableNode node)
-
Method Details
-
createRpcResultCondenser
public static <D> com.google.common.base.Function<List<org.opendaylight.yangtools.yang.common.RpcResult<D>>,org.opendaylight.yangtools.yang.common.RpcResult<Void>> createRpcResultCondenser(String previousItemAction) Creates a single rpc result of type Void honoring all partial rpc results.- Type Parameters:
D
- type of rpc output (gathered in list)- Parameters:
previousItemAction
- description for case when the triggering future contains failure- Returns:
- single rpc result of type Void honoring all partial rpc results
-
createRpcResultToVoidFunction
public static <D> com.google.common.base.Function<org.opendaylight.yangtools.yang.common.RpcResult<D>,org.opendaylight.yangtools.yang.common.RpcResult<Void>> createRpcResultToVoidFunction(String actionDescription) Creates a single rpc result of type Void honoring all partial rpc results.- Type Parameters:
D
- type of rpc output (gathered in list)- Parameters:
actionDescription
- description for case when the triggering future contains failure- Returns:
- single rpc result of type Void honoring all partial rpc results
-
chainBarrierFlush
public static com.google.common.util.concurrent.AsyncFunction<org.opendaylight.yangtools.yang.common.RpcResult<Void>,org.opendaylight.yangtools.yang.common.RpcResult<Void>> chainBarrierFlush(org.opendaylight.yangtools.yang.binding.InstanceIdentifier<Node> nodeIdent, SendBarrier sendBarrier) Flushes a chain barrier.- Parameters:
nodeIdent
- flow capable node path - target device for routed rpcsendBarrier
- barrier rpc service- Returns:
- async barrier result
-
resolveAndDivideGroupDiffs
public static List<ItemSyncBox<Group>> resolveAndDivideGroupDiffs(NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint32, Group> installedGroupsArg, Collection<Group> pendingGroups) Returns a list of safe synchronization steps with updates.- Parameters:
nodeId
- target nodeinstalledGroupsArg
- groups resent on devicependingGroups
- groups configured for device- Returns:
- list of safe synchronization steps with updates
-
resolveAndDivideGroupDiffs
public static List<ItemSyncBox<Group>> resolveAndDivideGroupDiffs(NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint32, Group> installedGroupsArg, Collection<Group> pendingGroups, boolean gatherUpdates) Returns a list of safe synchronization steps.- Parameters:
nodeId
- target nodeinstalledGroupsArg
- groups resent on devicependingGroups
- groups configured for devicegatherUpdates
- check content of pending item if present on device (and create update task eventually)- Returns:
- list of safe synchronization steps
-
checkGroupPrecondition
-
countTotalPushed
-
countTotalUpdated
-
resolveMeterDiffs
public static ItemSyncBox<Meter> resolveMeterDiffs(NodeId nodeId, Map<MeterId, Meter> meterOperationalMap, Collection<Meter> metersConfigured, boolean gatherUpdates) Resolves meter differences.- Parameters:
nodeId
- target nodemeterOperationalMap
- meters present on devicemetersConfigured
- meters configured for devicegatherUpdates
- check content of pending item if present on device (and create update task eventually)- Returns:
- synchronization box
-
resolveFlowDiffsInAllTables
public static Map<TableKey,ItemSyncBox<Flow>> resolveFlowDiffsInAllTables(NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint8, Table> tableOperationalMap, Collection<Table> tablesConfigured, boolean gatherUpdates) Resolves flow differences in all tables.- Parameters:
nodeId
- target nodetableOperationalMap
- flow-tables resent on devicetablesConfigured
- flow-tables configured for devicegatherUpdates
- check content of pending item if present on device (and create update task eventually)- Returns:
- map : key=
TableKey
, value=ItemSyncBox
of safe synchronization steps
-
safeGroups
-
safeTables
-
safeMeters
-