org.apache.ignite.internal.processors.cache.distributed.dht.topology

## 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 and Description
`GridDhtPartitionsStateValidator(GridCacheSharedContext<?,?> cctx)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `validatePartitionCountersAndSizes(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 given `top`.
`Map<Integer,Map<UUID,Long>>` `validatePartitionsUpdateCounters(GridDhtPartitionTopology top, Map<UUID,GridDhtPartitionsSingleMessage> messages, Set<UUID> ignoringNodes)` Validate partitions update counters for given `top`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021