Class NodeAllocationResult.ShardStoreInfo
java.lang.Object
org.elasticsearch.cluster.routing.allocation.NodeAllocationResult.ShardStoreInfo
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentFragment
- Enclosing class:
- NodeAllocationResult
public static final class NodeAllocationResult.ShardStoreInfo extends java.lang.Object implements ToXContentFragment, Writeable
A class that captures metadata about a shard store on a node.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ShardStoreInfo(long matchingBytes)
ShardStoreInfo(java.lang.String allocationId, boolean inSync, java.lang.Exception storeException)
ShardStoreInfo(StreamInput in)
-
Method Summary
Modifier and Type Method Description java.lang.String
getAllocationId()
Gets the allocation id for the shard copy, if it exists.long
getMatchingBytes()
Gets the number of matching bytes the shard copy has with the primary shard.java.lang.Exception
getStoreException()
Gets the store exception when trying to read the store, if there was an error.boolean
hasMatchingSyncId()
Returnstrue
if the shard copy has a matching sync id with the primary shard.boolean
isInSync()
Returnstrue
if the shard copy is in-sync and contains the latest data.XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.
-
Constructor Details
-
ShardStoreInfo
public ShardStoreInfo(java.lang.String allocationId, boolean inSync, java.lang.Exception storeException) -
ShardStoreInfo
public ShardStoreInfo(long matchingBytes) -
ShardStoreInfo
- Throws:
java.io.IOException
-
-
Method Details
-
isInSync
public boolean isInSync()Returnstrue
if the shard copy is in-sync and contains the latest data. Returnsfalse
if the shard copy is stale or if the shard copy being examined is for a replica shard allocation. -
getAllocationId
Gets the allocation id for the shard copy, if it exists. -
hasMatchingSyncId
public boolean hasMatchingSyncId()Returnstrue
if the shard copy has a matching sync id with the primary shard. Returnsfalse
if the shard copy does not have a matching sync id with the primary shard, or this explanation pertains to the allocation of a primary shard, in which case matching sync ids are irrelevant. -
getMatchingBytes
public long getMatchingBytes()Gets the number of matching bytes the shard copy has with the primary shard. ReturnsLong.MAX_VALUE
ifhasMatchingSyncId()
returnstrue
. Returns -1 if not applicable (this value only applies to assigning replica shards). -
getStoreException
Gets the store exception when trying to read the store, if there was an error. If there was no error, returnsnull
. -
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-