Module org.elasticsearch.xcore
Record Class AllocationInfo
java.lang.Object
java.lang.Record
org.elasticsearch.xpack.core.ilm.step.info.AllocationInfo
- All Implemented Interfaces:
org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
public record AllocationInfo(long numberOfReplicas, long numberShardsLeftToAllocate, boolean allShardsActive, String message)
extends Record
implements org.elasticsearch.xcontent.ToXContentObject
Represents the state of an index's shards allocation, including a user friendly message describing the current state.
It allows to transfer the allocation information to
XContent using
toXContent(XContentBuilder, Params)-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params -
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionAllocationInfo(long numberOfReplicas, long numberShardsLeftToAllocate, boolean allShardsActive, String message) Creates an instance of aAllocationInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallShardsActiverecord component.static AllocationInfoallShardsActiveAllocationInfo(long numReplicas, long numberShardsLeftToAllocate) Builds the AllocationInfo representing a cluster state with a routing table that has all the shards active for a particular index but there are stillnumberShardsLeftToAllocateleft to be allocated.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.longReturns the value of thenumberOfReplicasrecord component.longReturns the value of thenumberShardsLeftToAllocaterecord component.toString()Returns a string representation of this record class.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) static AllocationInfowaitingForActiveShardsAllocationInfo(long numReplicas) Builds the AllocationInfo representing a cluster state with a routing table that does not have enough shards active for a particular index.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
AllocationInfo
public AllocationInfo(long numberOfReplicas, long numberShardsLeftToAllocate, boolean allShardsActive, String message) Creates an instance of aAllocationInforecord class.- Parameters:
numberOfReplicas- the value for thenumberOfReplicasrecord componentnumberShardsLeftToAllocate- the value for thenumberShardsLeftToAllocaterecord componentallShardsActive- the value for theallShardsActiverecord componentmessage- the value for themessagerecord component
-
-
Method Details
-
waitingForActiveShardsAllocationInfo
Builds the AllocationInfo representing a cluster state with a routing table that does not have enough shards active for a particular index. -
allShardsActiveAllocationInfo
public static AllocationInfo allShardsActiveAllocationInfo(long numReplicas, long numberShardsLeftToAllocate) Builds the AllocationInfo representing a cluster state with a routing table that has all the shards active for a particular index but there are stillnumberShardsLeftToAllocateleft to be allocated. -
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
numberOfReplicas
public long numberOfReplicas()Returns the value of thenumberOfReplicasrecord component.- Returns:
- the value of the
numberOfReplicasrecord component
-
numberShardsLeftToAllocate
public long numberShardsLeftToAllocate()Returns the value of thenumberShardsLeftToAllocaterecord component.- Returns:
- the value of the
numberShardsLeftToAllocaterecord component
-
allShardsActive
public boolean allShardsActive()Returns the value of theallShardsActiverecord component.- Returns:
- the value of the
allShardsActiverecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-