Package org.elasticsearch.indices.flush
Class ShardsSyncedFlushResult
- java.lang.Object
-
- org.elasticsearch.indices.flush.ShardsSyncedFlushResult
-
- All Implemented Interfaces:
Streamable
public class ShardsSyncedFlushResult extends java.lang.Object implements Streamable
Result for all copies of a shard
-
-
Constructor Summary
Constructors Constructor Description ShardsSyncedFlushResult(ShardId shardId, int totalShards, java.lang.String failureReason)
failure constructorShardsSyncedFlushResult(ShardId shardId, java.lang.String syncId, int totalShards, java.util.Map<ShardRouting,SyncedFlushService.ShardSyncedFlushResponse> shardResponses)
success constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
failed()
java.util.Map<ShardRouting,SyncedFlushService.ShardSyncedFlushResponse>
failedShards()
java.lang.String
failureReason()
ShardId
getShardId()
void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.static ShardsSyncedFlushResult
readShardsSyncedFlushResult(StreamInput in)
ShardId
shardId()
java.util.Map<ShardRouting,SyncedFlushService.ShardSyncedFlushResponse>
shardResponses()
int
successfulShards()
java.lang.String
syncId()
int
totalShards()
void
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.io.stream.Streamable
-
-
-
-
Constructor Detail
-
ShardsSyncedFlushResult
public ShardsSyncedFlushResult(ShardId shardId, int totalShards, java.lang.String failureReason)
failure constructor
-
ShardsSyncedFlushResult
public ShardsSyncedFlushResult(ShardId shardId, java.lang.String syncId, int totalShards, java.util.Map<ShardRouting,SyncedFlushService.ShardSyncedFlushResponse> shardResponses)
success constructor
-
-
Method Detail
-
getShardId
public ShardId getShardId()
-
failed
public boolean failed()
- Returns:
- true if the operation failed before reaching step three of synced flush.
failureReason()
can be used for more details
-
failureReason
public java.lang.String failureReason()
- Returns:
- the reason for the failure if synced flush failed before step three of synced flush
-
syncId
public java.lang.String syncId()
-
totalShards
public int totalShards()
- Returns:
- total number of shards for which a sync attempt was made
-
successfulShards
public int successfulShards()
- Returns:
- total number of successful shards
-
failedShards
public java.util.Map<ShardRouting,SyncedFlushService.ShardSyncedFlushResponse> failedShards()
- Returns:
- an array of shard failures
-
shardResponses
public java.util.Map<ShardRouting,SyncedFlushService.ShardSyncedFlushResponse> shardResponses()
- Returns:
- Individual responses for each shard copy with a detailed failure message if the copy failed to perform the synced flush. Empty if synced flush failed before step three.
-
shardId
public ShardId shardId()
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Throws:
java.io.IOException
-
readShardsSyncedFlushResult
public static ShardsSyncedFlushResult readShardsSyncedFlushResult(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-