org.apache.ignite.cache

## Enum PartitionLossPolicy

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

All Implemented Interfaces:
  Serializable, Comparable<PartitionLossPolicy>

    public enum PartitionLossPolicy
    extends Enum<PartitionLossPolicy>

Partition loss policy. Defines how a cache will behave in a case when one or more partitions are lost because of a node(s) failure.

A partition is considered lost if all owning nodes had left a topology.

All `*_SAFE` policies prevent a user from interaction with partial data in lost partitions until `Ignite.resetLostPartitions(Collection)` method is called. `*_ALL` policies allow working with partial data in lost partitions.

`READ_ONLY_*` and `READ_WRITE_*` policies do not automatically change partition state and thus do not change rebalancing assignments for such partitions.

See Also:
  `Ignite.resetLostPartitions(Collection)`, `IgniteCache.lostPartitions()`

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`IGNORE` If a partition was lost silently ignore it and allow any operations with a partition.
`READ_ONLY_ALL` Deprecated. `READ_ONLY_SAFE` is used instead.
`READ_ONLY_SAFE` All writes to the cache will be failed with an exception, reads will only be allowed for keys in non-lost partitions.
`READ_WRITE_ALL` Deprecated. `READ_WRITE_SAFE` is used instead.
`READ_WRITE_SAFE` All reads and writes will be allowed for keys in valid partitions.

### Method Summary

All Methods Static Methods Concrete Methods
`static @Nullable PartitionLossPolicy` `fromOrdinal(byte ord)` Efficiently gets enumerated value from its ordinal.
`static PartitionLossPolicy` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static PartitionLossPolicy[]` `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

#### READ_ONLY_SAFE

    public static final PartitionLossPolicy READ_ONLY_SAFE

All writes to the cache will be failed with an exception, reads will only be allowed for keys in non-lost partitions. Reads from lost partitions will be failed with an exception.

#### READ_ONLY_ALL

    public static final PartitionLossPolicy READ_ONLY_ALL

Deprecated. `READ_ONLY_SAFE` is used instead.
All writes to the cache will be failed with an exception. All reads will proceed as if all partitions were in a consistent state. The result of reading from a lost partition is undefined and may be different on different nodes in the cluster.

#### READ_WRITE_SAFE

    public static final PartitionLossPolicy READ_WRITE_SAFE

All reads and writes will be allowed for keys in valid partitions. All reads and writes for keys in lost partitions will be failed with an exception.

#### READ_WRITE_ALL

    public static final PartitionLossPolicy READ_WRITE_ALL

Deprecated. `READ_WRITE_SAFE` is used instead.
All reads and writes will proceed as if all partitions were in a consistent state. The result of reading from a lost partition is undefined and may be different on different nodes in the cluster.

#### IGNORE

    public static final PartitionLossPolicy IGNORE

If a partition was lost silently ignore it and allow any operations with a partition. Partition loss events are not fired if using this mode. For pure in-memory caches the policy will work only when baseline auto adjust is enabled with zero timeout. If persistence is enabled, the policy is always ignored. READ_WRITE_SAFE is used instead.

### Method Detail

#### values

    public static PartitionLossPolicy[] 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 (PartitionLossPolicy c : PartitionLossPolicy.values())
        System.out.println(c);

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

#### valueOf

    public static PartitionLossPolicy 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

#### fromOrdinal

    @Nullable
    public static @Nullable PartitionLossPolicy fromOrdinal(byte ord)

Efficiently gets enumerated value from its ordinal.

Parameters:
  `ord` - Ordinal value.
Returns:
  Enumerated value or `null` if ordinal out of range.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022