Class NodeAllocationResult.ShardStoreInfo
java.lang.Object
org.elasticsearch.cluster.routing.allocation.NodeAllocationResult.ShardStoreInfo
- All Implemented Interfaces:
Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
- Enclosing class:
- NodeAllocationResult
public static final class NodeAllocationResult.ShardStoreInfo
extends Object
implements org.elasticsearch.common.xcontent.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
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionShardStoreInfo(long matchingBytes)ShardStoreInfo(String allocationId, boolean inSync, Exception storeException) -
Method Summary
Modifier and TypeMethodDescriptionGets the allocation id for the shard copy, if it exists.longGets the number of matching bytes the shard copy has with the primary shard.Gets the store exception when trying to read the store, if there was an error.booleanReturnstrueif the shard copy has a matching sync id with the primary shard.booleanisInSync()Returnstrueif the shard copy is in-sync and contains the latest data.org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
ShardStoreInfo
-
ShardStoreInfo
public ShardStoreInfo(long matchingBytes) -
ShardStoreInfo
- Throws:
IOException
-
-
Method Details
-
isInSync
public boolean isInSync()Returnstrueif the shard copy is in-sync and contains the latest data. Returnsfalseif 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()Returnstrueif the shard copy has a matching sync id with the primary shard. Returnsfalseif 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_VALUEifhasMatchingSyncId()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:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
IOException
-