Class GridDhtPartitionsStateValidator


  • public class GridDhtPartitionsStateValidator
    extends Object
    Class to validate partitions update counters and cache sizes during exchange process.
    • 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 given top.
        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 given top.
        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.