Module org.elasticsearch.server
Interface ResizeNumberOfShardsCalculator
- All Known Implementing Classes:
- ResizeNumberOfShardsCalculator.CloneShardsCalculator,- ResizeNumberOfShardsCalculator.ShrinkShardsCalculator,- ResizeNumberOfShardsCalculator.SplitShardsCalculator
public interface ResizeNumberOfShardsCalculator
This class calculates and verifies the number of shards of a target index after a resize operation. It supports three operations SHRINK,
 SPLIT and CLONE.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic class
- 
Method SummaryModifier and TypeMethodDescriptionintcalculate(Integer numberOfShards, ByteSizeValue maxPrimaryShardSize, IndexMetadata sourceMetadata) Calculates the target number of shards based on the parameters of the requestvoidvalidate(int numberOfShards, IndexMetadata sourceMetadata) Validates the target number of shards based on the operation.
- 
Method Details- 
calculateint calculate(@Nullable Integer numberOfShards, @Nullable ByteSizeValue maxPrimaryShardSize, IndexMetadata sourceMetadata) Calculates the target number of shards based on the parameters of the request- Parameters:
- numberOfShards- requested number of shards or null if it was not provided
- maxPrimaryShardSize- requested max primary shard size or null if it was not provided
- sourceMetadata- the index metadata of the source index
- Returns:
- the number of shards for the target index
 
- 
validateValidates the target number of shards based on the operation. For example, in the case of SHRINK it will check if the doc count per shard is within limits and in the other opetations it will ensure we get the right exceptions if the number of shards is wrong or less than etc.- Parameters:
- numberOfShards- the number of shards the target index is going to have
- sourceMetadata- the index metadata of the source index
 
 
-