Class ReconcileUtil
- java.lang.Object
-
- org.opendaylight.openflowplugin.applications.frsync.util.ReconcileUtil
-
public final class ReconcileUtil extends Object
Util methods for group reconcil task (future chaining, transforms).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeIdent, FlowCapableTransactionService flowCapableTransactionService)
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(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.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(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.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(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint8,Table> tableOperationalMap, List<Table> tablesConfigured, boolean gatherUpdates)
Resolves flow differences in all tables.static ItemSyncBox<Meter>
resolveMeterDiffs(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId, Map<MeterId,Meter> meterOperationalMap, List<Meter> metersConfigured, boolean gatherUpdates)
Resolves meter differences.static List<Group>
safeGroups(FlowCapableNode node)
static List<Meter>
safeMeters(FlowCapableNode node)
static List<Table>
safeTables(FlowCapableNode node)
-
-
-
Method Detail
-
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<org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node> nodeIdent, FlowCapableTransactionService flowCapableTransactionService)
Flushes a chain barrier.- Parameters:
nodeIdent
- flow capable node path - target device for routed rpcflowCapableTransactionService
- barrier rpc service- Returns:
- async barrier result
-
resolveAndDivideGroupDiffs
public static List<ItemSyncBox<Group>> resolveAndDivideGroupDiffs(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.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(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.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
public static boolean checkGroupPrecondition(Set<org.opendaylight.yangtools.yang.common.Uint32> installedGroupIds, Group pendingGroup)
-
countTotalPushed
public static <E> int countTotalPushed(Iterable<ItemSyncBox<E>> groupsAddPlan)
-
countTotalUpdated
public static <E> int countTotalUpdated(Iterable<ItemSyncBox<E>> groupsAddPlan)
-
resolveMeterDiffs
public static ItemSyncBox<Meter> resolveMeterDiffs(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId, Map<MeterId,Meter> meterOperationalMap, List<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(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId nodeId, Map<org.opendaylight.yangtools.yang.common.Uint8,Table> tableOperationalMap, List<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
public static List<Group> safeGroups(FlowCapableNode node)
-
safeTables
public static List<Table> safeTables(FlowCapableNode node)
-
safeMeters
public static List<Meter> safeMeters(FlowCapableNode node)
-
-