Class GridDhtPartitionsStateValidator
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.distributed.dht.topology.GridDhtPartitionsStateValidator
-
public class GridDhtPartitionsStateValidator extends Object
Class to validate partitions update counters and cache sizes during exchange process.
-
-
Constructor Summary
Constructors Constructor Description GridDhtPartitionsStateValidator(GridCacheSharedContext<?,?> cctx)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvalidatePartitionCountersAndSizes(GridDhtPartitionsExchangeFuture fut, GridDhtPartitionTopology top, Map<UUID,GridDhtPartitionsSingleMessage> messages)Validates partition states - update counters and cache sizes for all nodes.Map<Integer,Map<UUID,Long>>validatePartitionsSizes(GridDhtPartitionTopology top, Map<UUID,GridDhtPartitionsSingleMessage> messages, Set<UUID> ignoringNodes)Validate partitions cache sizes for giventop.Map<Integer,Map<UUID,Long>>validatePartitionsUpdateCounters(GridDhtPartitionTopology top, Map<UUID,GridDhtPartitionsSingleMessage> messages, Set<UUID> ignoringNodes)Validate partitions update counters for giventop.
-
-
-
Constructor Detail
-
GridDhtPartitionsStateValidator
public GridDhtPartitionsStateValidator(GridCacheSharedContext<?,?> cctx)
Constructor.- Parameters:
cctx- Cache shared context.
-
-
Method Detail
-
validatePartitionCountersAndSizes
public void validatePartitionCountersAndSizes(GridDhtPartitionsExchangeFuture fut, GridDhtPartitionTopology top, Map<UUID,GridDhtPartitionsSingleMessage> messages) throws IgniteCheckedException
Validates partition states - update counters and cache sizes for all nodes. If update counter value or cache size for the same partitions are different on some nodes method throws exception with full information about inconsistent partitions.- Parameters:
fut- Current exchange future.top- Topology to validate.messages- Single messages received from all nodes.- Throws:
IgniteCheckedException- If validation failed. Exception message contains full information about all partitions which update counters or cache sizes are not consistent.
-
validatePartitionsUpdateCounters
public Map<Integer,Map<UUID,Long>> validatePartitionsUpdateCounters(GridDhtPartitionTopology top, Map<UUID,GridDhtPartitionsSingleMessage> messages, Set<UUID> ignoringNodes)
Validate partitions update counters for giventop.- Parameters:
top- Topology to validate.messages- Single messages received from all nodes.ignoringNodes- Nodes for what we ignore validation.- Returns:
- Invalid partitions map with following structure: (partId, (nodeId, updateCounter)). If map is empty validation is successful.
-
validatePartitionsSizes
public Map<Integer,Map<UUID,Long>> validatePartitionsSizes(GridDhtPartitionTopology top, Map<UUID,GridDhtPartitionsSingleMessage> messages, Set<UUID> ignoringNodes)
Validate partitions cache sizes for giventop.- Parameters:
top- Topology to validate.messages- Single messages received from all nodes.ignoringNodes- Nodes for what we ignore validation.- Returns:
- Invalid partitions map with following structure: (partId, (nodeId, cacheSize)). If map is empty validation is successful.
-
-