public static final class NodeAllocationResult.ShardStoreInfo extends java.lang.Object implements ToXContent, Writeable
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
EMPTY_PARAMS
Constructor and Description |
---|
ShardStoreInfo(long matchingBytes) |
ShardStoreInfo(StreamInput in) |
ShardStoreInfo(java.lang.String allocationId,
boolean inSync,
java.lang.Exception storeException) |
Modifier and Type | Method and 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()
Returns
true if the shard copy has a matching sync id with the primary shard. |
boolean |
isInSync()
Returns
true 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isFragment
public ShardStoreInfo(java.lang.String allocationId, boolean inSync, java.lang.Exception storeException)
public ShardStoreInfo(long matchingBytes)
public ShardStoreInfo(StreamInput in) throws java.io.IOException
java.io.IOException
public boolean isInSync()
true
if the shard copy is in-sync and contains the latest data.
Returns false
if the shard copy is stale or if the shard copy being examined
is for a replica shard allocation.@Nullable public java.lang.String getAllocationId()
public boolean hasMatchingSyncId()
true
if the shard copy has a matching sync id with the primary shard.
Returns false
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.public long getMatchingBytes()
Long.MAX_VALUE
if hasMatchingSyncId()
returns true
.
Returns -1 if not applicable (this value only applies to assigning replica shards).@Nullable public java.lang.Exception getStoreException()
null
.public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException