Module org.elasticsearch.server
Class RecoveryResponse
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.action.ActionResponse
org.elasticsearch.action.support.broadcast.BaseBroadcastResponse
org.elasticsearch.action.admin.indices.recovery.RecoveryResponse
- All Implemented Interfaces:
Writeable,ChunkedToXContent,ChunkedToXContentObject,RefCounted
Information regarding the recovery state of indices and their associated shards.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.ActionResponse
ActionResponse.EmptyNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.action.support.broadcast.BaseBroadcastResponse
EMPTYFields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTYFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
ConstructorsConstructorDescriptionRecoveryResponse(int totalShards, int successfulShards, int failedShards, Map<String, List<RecoveryState>> shardRecoveryStates, List<DefaultShardOperationFailedException> shardFailures) Constructs recovery information for a collection of indices and associated shards. -
Method Summary
Modifier and TypeMethodDescriptionbooleantoString()toXContentChunked(ToXContent.Params params) Create an iterator ofToXContentchunks for a REST response.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.support.broadcast.BaseBroadcastResponse
getFailedShards, getShardFailures, getStatus, getSuccessfulShards, getTotalShardsMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
toXContentChunked, toXContentChunkedV8Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContentObject
isFragmentMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRef
-
Constructor Details
-
RecoveryResponse
- Throws:
IOException
-
RecoveryResponse
public RecoveryResponse(int totalShards, int successfulShards, int failedShards, Map<String, List<RecoveryState>> shardRecoveryStates, List<DefaultShardOperationFailedException> shardFailures) Constructs recovery information for a collection of indices and associated shards. Keeps track of how many total shards were seen, and out of those how many were successfully processed and how many failed.- Parameters:
totalShards- Total count of shards seensuccessfulShards- Count of shards successfully processedfailedShards- Count of shards which failed to processshardRecoveryStates- Map of indices to shard recovery informationshardFailures- List of failures processing shards
-
-
Method Details
-
hasRecoveries
public boolean hasRecoveries() -
shardRecoveryStates
-
toXContentChunked
Description copied from interface:ChunkedToXContentCreate an iterator ofToXContentchunks for a REST response. Each chunk is serialized with the sameXContentBuilderandToXContent.Params, which is also the same as theToXContent.Paramspassed as theparamsargument. For best results, all chunks should beO(1)size. The last chunk in the iterator must always yield at least one byte of output. See alsoChunkedToXContentHelperfor some handy utilities.Note that chunked response bodies cannot send deprecation warning headers once transmission has started, so implementations must check for deprecated feature use before returning.
- Specified by:
toXContentChunkedin interfaceChunkedToXContent- Returns:
- iterator over chunks of
ToXContent
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classBaseBroadcastResponse- Throws:
IOException
-
toString
-