org.apache.ignite.cache

## Enum ReadRepairStrategy

- java.lang.Object
- - java.lang.Enum<ReadRepairStrategy>
  - - org.apache.ignite.cache.ReadRepairStrategy

- All Implemented Interfaces:
    Serializable, Comparable<ReadRepairStrategy>

      public enum ReadRepairStrategy
      extends Enum<ReadRepairStrategy>

  Read repair strategies.
  See Also:
    `for details.`

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `CHECK_ONLY` Only check will be performed.
    `LWW` Last write (the newest entry) wins.
    `PRIMARY` Value from the primary node wins.
    `RELATIVE_MAJORITY` The relative majority, any value found more times than any other wins.
    `REMOVE` Inconsistent entries will be removed.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ReadRepairStrategy` | `fromString(String name)` Provides strategy by name.
    `static ReadRepairStrategy` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static ReadRepairStrategy[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### LWW

          public static final ReadRepairStrategy LWW

      Last write (the newest entry) wins.

      May cause `IgniteException` when fix is impossible (unable to detect the newest entry):

      - Null(s) found as well as non-null values for the same key.

        Null (missed entry) has no version, so, it can not be compared with the versioned entry.

      - Entries with the same version have different values.

    - #### PRIMARY

          public static final ReadRepairStrategy PRIMARY

      Value from the primary node wins.

    - #### RELATIVE_MAJORITY

          public static final ReadRepairStrategy RELATIVE_MAJORITY

      The relative majority, any value found more times than any other wins.

      Works for an even number of copies (which is typical of Ignite) instead of an absolute majority.

      May cause `IgniteException` when it is unable to detect values found more times than any other.

      For example, when 5 copies (4 backups) are given and value `A` is found twice, but `X`, `Y`, and `Z` only once, `A` wins. But, when `A` is found twice, as well as `B`, and `X` only once, the strategy is unable to determine the winner.

      When 4 copies (3 backups) are given, any value found two or more times, when others are found only once, is the winner.

    - #### REMOVE

          public static final ReadRepairStrategy REMOVE

      Inconsistent entries will be removed.

    - #### CHECK_ONLY

          public static final ReadRepairStrategy CHECK_ONLY

      Only check will be performed.

  - ### Method Detail

    - #### values

          public static ReadRepairStrategy[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (ReadRepairStrategy c : ReadRepairStrategy.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static ReadRepairStrategy valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### fromString

          public static ReadRepairStrategy fromString(String name)

      Provides strategy by name.
      Parameters:
        `name` - Text.
      Returns:
        Read Repair strategy.

${current.year} Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023