Module org.elasticsearch.server
Class IndexReshardingState.Split.Builder
java.lang.Object
org.elasticsearch.cluster.metadata.IndexReshardingState.Split.Builder
- Enclosing class:
IndexReshardingState.Split
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a new SplitvoidsetSourceShardState(int shardNum, IndexReshardingState.Split.SourceShardState sourceShardState) Set the shard state of a source shard Currently the only legal transition is from SOURCE to DONE and any other transition will assert.voidsetTargetShardState(int shardNum, IndexReshardingState.Split.TargetShardState targetShardState) Set the target state of a shard The only legal state in the split state machine is the one following the shard's current state.
-
Constructor Details
-
Builder
-
-
Method Details
-
setSourceShardState
public void setSourceShardState(int shardNum, IndexReshardingState.Split.SourceShardState sourceShardState) Set the shard state of a source shard Currently the only legal transition is from SOURCE to DONE and any other transition will assert. This could be expressed through a markSourceDone API but this form is the same shape assetTargetShardState(int, org.elasticsearch.cluster.metadata.IndexReshardingState.Split.TargetShardState)and leaves the door open for additional source states.- Parameters:
shardNum- an index into the shards which must be no greater than the number of shards before splitsourceShardState- the state to which the shard should be set
-
setTargetShardState
public void setTargetShardState(int shardNum, IndexReshardingState.Split.TargetShardState targetShardState) Set the target state of a shard The only legal state in the split state machine is the one following the shard's current state. The reason for this API rather than an advanceState API is to confirm that the caller knows what the current state is when setting it.- Parameters:
shardNum- an index into shards greater than or equal to the old shard count and less than the new shard counttargetShardState- the state to which the shard should be set
-
build
Build a new Split- Returns:
- Split reflecting the current state of the builder
-