java.lang.Object
org.elasticsearch.indices.recovery.RecoveryState
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
Keeps track of state related to shard recovery.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic enumstatic classstatic classstatic classNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, 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.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionRecoveryState(ShardRouting shardRouting, DiscoveryNode targetNode, DiscoveryNode sourceNode) RecoveryState(ShardRouting shardRouting, DiscoveryNode targetNode, DiscoveryNode sourceNode, RecoveryState.Index index) -
Method Summary
Modifier and TypeMethodDescriptiongetIndex()booleanReturns recovery source node (only non-null if peer recovery)getStage()getTimer()static RecoveryStatereset()Resets the stage to the initial state and clears all index, verify index and translog information keeping the original timing informationsetStage(RecoveryState.Stage stage) toXContent(XContentBuilder builder, ToXContent.Params params) protected voidvalidateAndSetStage(RecoveryState.Stage expected, RecoveryState.Stage next) voidvalidateCurrentStage(RecoveryState.Stage expected) 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.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
RecoveryState
public RecoveryState(ShardRouting shardRouting, DiscoveryNode targetNode, @Nullable DiscoveryNode sourceNode) -
RecoveryState
public RecoveryState(ShardRouting shardRouting, DiscoveryNode targetNode, @Nullable DiscoveryNode sourceNode, RecoveryState.Index index)
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getShardId
-
getStage
-
validateAndSetStage
-
validateCurrentStage
-
setStage
-
reset
Resets the stage to the initial state and clears all index, verify index and translog information keeping the original timing information -
setLocalTranslogStage
-
setRemoteTranslogStage
-
getIndex
-
getVerifyIndex
-
getTranslog
-
getTimer
-
getRecoverySource
-
getSourceNode
Returns recovery source node (only non-null if peer recovery) -
getTargetNode
-
getPrimary
public boolean getPrimary() -
readRecoveryState
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-