org.apache.ignite.internal.processors.cache.verify

## Class IdleVerifyUtility

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.verify.IdleVerifyUtility

    public class IdleVerifyUtility
    extends Object

Utility class for idle verify command.

### Nested Class Summary

Nested Classes
`static class` `IdleVerifyUtility.IdleChecker` Idle checker.

### Field Summary

Fields
`static String` `GRID_NOT_IDLE_MSG` Cluster not idle message.

### Method Summary

All Methods Static Methods Concrete Methods
`static @Nullable PartitionHashRecordV2` `calculatePartitionHash(PartitionKeyV2 partKey, long updCntr, Object consId, GridDhtPartitionState state, boolean isPrimary, long partSize, GridIterator<CacheDataRow> it)`
`static void` `checkPartitionsPageCrcSum(IgniteThrowableSupplier<FilePageStore> pageStoreSup, int partId, byte pageType)` Checks CRC sum of pages with `pageType` page type stored in partition with `partId` id and associated with cache group.
`static List<Integer>` `compareUpdateCounters(IgniteEx ign, Map<Integer,Map<Integer,PartitionUpdateCounter>> cntrsIn, Integer grpId)` Compares two sets with partitions and upd counters per group distribution.
`static List<Integer>` `compareUpdateCounters(IgniteEx ign, Map<Integer,Map<Integer,PartitionUpdateCounter>> cntrsEth, Map<Integer,Map<Integer,PartitionUpdateCounter>> curCntrs)` Compares two sets with partitions and upd counters per group distribution.
`static String` `formatUpdateCountersDiff(IgniteEx ig, List<Integer> diff)` Prints diff between incoming update counters snapshots.
`static Map<Integer,Map<Integer,PartitionUpdateCounter>>` `getUpdateCountersSnapshot(IgniteEx ign, Set<Integer> grpIds)` Gather updateCounters info.

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

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

### Field Detail

#### GRID_NOT_IDLE_MSG

    public static final String GRID_NOT_IDLE_MSG

Cluster not idle message.

See Also:
  Constant Field Values

### Method Detail

#### checkPartitionsPageCrcSum

    public static void checkPartitionsPageCrcSum(IgniteThrowableSupplier<FilePageStore> pageStoreSup,
                                                 int partId,
                                                 byte pageType)

Checks CRC sum of pages with `pageType` page type stored in partition with `partId` id and associated with cache group.

Parameters:
  `pageStoreSup` - Page store supplier.
  `partId` - Partition id.
  `pageType` - Page type. Possible types `PageIdAllocator.FLAG_DATA`, `PageIdAllocator.FLAG_IDX` and `PageIdAllocator.FLAG_AUX`.

#### getUpdateCountersSnapshot

    public static Map<Integer,Map<Integer,PartitionUpdateCounter>> getUpdateCountersSnapshot(IgniteEx ign,
                                                                                             Set<Integer> grpIds)

Gather updateCounters info. Holds `PartitionUpdateCounter.copy()` of update counters.

Parameters:
  `ign` - Ignite instance.
  `grpIds` - Group Id`s.
Returns:
  Current groups distribution with update counters per partitions.

#### formatUpdateCountersDiff

    public static String formatUpdateCountersDiff(IgniteEx ig,
                                                  List<Integer> diff)

Prints diff between incoming update counters snapshots.

Parameters:
  `ig` - Ignite instance.
  `diff` - Compared groups diff.
Returns:
  Formatted diff representation.

#### compareUpdateCounters

    public static List<Integer> compareUpdateCounters(IgniteEx ign,
                                                      Map<Integer,Map<Integer,PartitionUpdateCounter>> cntrsIn,
                                                      Integer grpId)

Compares two sets with partitions and upd counters per group distribution.

Parameters:
  `ign` - Ignite instance.
  `cntrsIn` - Group id`s with counters per partitions per groups distribution.
  `grpId` - Group id to compare.
Returns:
  Diff with grpId info between two sets.

#### compareUpdateCounters

    public static List<Integer> compareUpdateCounters(IgniteEx ign,
                                                      Map<Integer,Map<Integer,PartitionUpdateCounter>> cntrsEth,
                                                      Map<Integer,Map<Integer,PartitionUpdateCounter>> curCntrs)

Compares two sets with partitions and upd counters per group distribution.

Parameters:
  `ign` - Ignite instance.
  `cntrsEth` - Ethalon group id`s with counters per partitions per groups distribution.
  `curCntrs` - Group id`s with counters per partitions per groups distribution compare with.
Returns:
  Diff with grpId info between two sets.

#### calculatePartitionHash

    @Nullable
    public static @Nullable PartitionHashRecordV2 calculatePartitionHash(PartitionKeyV2 partKey,
                                                                                   long updCntr,
                                                                                   Object consId,
                                                                                   GridDhtPartitionState state,
                                                                                   boolean isPrimary,
                                                                                   long partSize,
                                                                                   GridIterator<CacheDataRow> it)
                                                                            throws IgniteCheckedException

Parameters:
  `partKey` - Partition key.
  `updCntr` - Partition update counter prior check.
  `consId` - Local node consistent id.
  `state` - Partition state to check.
  `isPrimary` - `true` if partition is primary.
  `partSize` - Partition size on disk.
  `it` - Iterator though partition data rows.
Returns:
  Map of calculated partition.
Throws:
  `IgniteCheckedException` - If fails.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021