Package org.apache.solr.common.cloud

# Enum Class Replica.Type

java.lang.Object
java.lang.Enum<Replica.Type>
org.apache.solr.common.cloud.Replica.Type

All Implemented Interfaces:
  `Serializable`, `Comparable<Replica.Type>`, `java.lang.constant.Constable`

Enclosing class:
  `Replica`

public static enum Replica.Type extends Enum<Replica.Type>

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`NRT`
Writes updates to transaction log and indexes locally.
`PULL`
Does not index or writes to transaction log.
`TLOG`
Writes to transaction log, but not to index, uses replication.

## Field Summary

Fields
Modifier and Type
Field
Description
`final boolean`
`leaderEligible`
Whether replicas of this type join the leader election and can be elected.
`final String`
`numReplicasPropertyName`
Name of the property in messages that contains the number of replicas of this type.
`final boolean`
`replicateFromLeader`
Whether replicas of this type continuously replicate from the leader, if they are not themselves the leader.
`final boolean`
`requireTransactionLog`
Whether replicas of this type require a transaction log.

## Method Summary

Modifier and Type
Method
Description
`static Replica.Type`
`defaultType()`
Returns a default replica type.
`static Replica.Type`
`get(String name)`
`static Replica.Type`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static Replica.Type[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

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

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

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

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

## Enum Constant Details

### NRT

public static final Replica.Type NRT
Writes updates to transaction log and indexes locally. Replicas of type `NRT` support NRT (soft commits) and RTG. Any `NRT` replica can become a leader. A shard leader will forward updates to all active `NRT` and `TLOG` replicas.

### TLOG

public static final Replica.Type TLOG
Writes to transaction log, but not to index, uses replication. Any `TLOG` replica can become leader (by first applying all local transaction log elements). If a replica is of type `TLOG` but is also the leader, it will behave as a `NRT`. A shard leader will forward updates to all active `NRT` and `TLOG` replicas.

### PULL

public static final Replica.Type PULL
Does not index or writes to transaction log. Just replicates from `NRT` or `TLOG` replicas. `PULL` replicas can’t become shard leaders (i.e., if there are only pull replicas in the collection at some point, updates will fail same as if there is no leaders, queries continue to work), so they don’t even participate in elections.

## Field Details

### leaderEligible

public final boolean leaderEligible
Whether replicas of this type join the leader election and can be elected.

### requireTransactionLog

public final boolean requireTransactionLog
Whether replicas of this type require a transaction log. A transaction log will be created only if this is `true`.

### replicateFromLeader

public final boolean replicateFromLeader
Whether replicas of this type continuously replicate from the leader, if they are not themselves the leader.

### numReplicasPropertyName

public final String numReplicasPropertyName
Name of the property in messages that contains the number of replicas of this type.

## Method Details

### values

public static Replica.Type[] values()
Returns an array containing the constants of this enum class, in the order they are declared.

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

### valueOf

public static Replica.Type valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
  `NullPointerException` - if the argument is null

### get

public static Replica.Type get(String name)

### defaultType

public static Replica.Type defaultType()
Returns a default replica type. It is most notably used by the replica factor, which maps onto this replica type. This replica type needs to be leader-eligible.