Interface IndicesClusterStateService.Shard
- All Known Implementing Classes:
IndexShard
- Enclosing class:
- IndicesClusterStateService
public static interface IndicesClusterStateService.Shard
-
Method Summary
Modifier and TypeMethodDescriptionReturns the recovery state associated with this shard.Returns the latest cluster routing entry received with this shard.shardId()
Returns the shard id of this shard.state()
Returns the latest internal shard state.void
updateShardState(ShardRouting shardRouting, long primaryTerm, BiConsumer<IndexShard,ActionListener<PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncer, long applyingClusterStateVersion, Set<String> inSyncAllocationIds, IndexShardRoutingTable routingTable)
Updates the shard state based on an incoming cluster state: - Updates and persists the new routing value.
-
Method Details
-
shardId
ShardId shardId()Returns the shard id of this shard. -
routingEntry
ShardRouting routingEntry()Returns the latest cluster routing entry received with this shard. -
state
IndexShardState state()Returns the latest internal shard state. -
recoveryState
RecoveryState recoveryState()Returns the recovery state associated with this shard. -
getTimestampRange
- Returns:
- the range of the
@timestamp
field for this shard, orShardLongFieldRange.EMPTY
if this field is not found, orShardLongFieldRange.UNKNOWN
if its range is not fixed.
-
updateShardState
void updateShardState(ShardRouting shardRouting, long primaryTerm, BiConsumer<IndexShard,ActionListener<PrimaryReplicaSyncer.ResyncTask>> primaryReplicaSyncer, long applyingClusterStateVersion, Set<String> inSyncAllocationIds, IndexShardRoutingTable routingTable) throws IOExceptionUpdates the shard state based on an incoming cluster state: - Updates and persists the new routing value. - Updates the primary term if this shard is a primary. - Updates the allocation ids that are tracked by the shard if it is a primary. SeeReplicationTracker.updateFromMaster(long, Set, IndexShardRoutingTable)
for details.- Parameters:
shardRouting
- the new routing entryprimaryTerm
- the new primary termprimaryReplicaSyncer
- the primary-replica resync action to trigger when a term is increased on a primaryapplyingClusterStateVersion
- the cluster state version being applied when updating the allocation IDs from the masterinSyncAllocationIds
- the allocation ids of the currently in-sync shard copiesroutingTable
- the shard routing table- Throws:
IndexShardRelocatedException
- if shard is marked as relocated and relocation abortedIOException
- if shard state could not be persisted
-