Class IndexReshardingState.Split.Builder

java.lang.Object
org.elasticsearch.cluster.metadata.IndexReshardingState.Split.Builder
Enclosing class:
IndexReshardingState.Split

public static class IndexReshardingState.Split.Builder extends Object
  • Constructor Details

  • Method Details

    • setSourceShardState

      public void setSourceShardState(int shardNum, IndexReshardingState.Split.SourceShardState sourceShardState)
      Set the shard state of a source shard Supported transition is SOURCE -> READY_FOR_CLEANUP -> DONE. The transition to READY_FOR_CLEANUP and above should only be done once all target shards are DONE.
      Parameters:
      shardNum - an index into the shards which must be no greater than the number of shards before split
      sourceShardState - 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 count
      targetShardState - the state to which the shard should be set
    • build

      Build a new Split
      Returns:
      Split reflecting the current state of the builder