- All Implemented Interfaces:
public class IndexMetadataUpdater extends RoutingChangesObserver.AbstractRoutingChangesObserver
Observer that tracks changes made to RoutingNodes in order to update the primary terms and in-sync allocation ids in
IndexMetadataonce the allocation round has completed. Primary terms are updated on primary initialization or when an active primary fails. Allocation ids are added for shards that become active and removed for shards that stop being active.
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.cluster.routing.RoutingChangesObserver
Method SummaryModifier and TypeMethodDescriptionUpdates the current
Metadatabased on the changes of this RoutingChangesObserver.
ShardRouting removedRelocationSource)(Called on relocation source when relocation completes after relocation target is started.
static ClusterStateRemoves allocation ids from the in-sync set for shard copies for which there is no routing entries in the routing table.
voidCalled when a shard is failed or cancelled.
voidCalled when unassigned shard is initialized.
voidCalled when an initializing shard is started.
Methods inherited from class org.elasticsearch.cluster.routing.RoutingChangesObserver.AbstractRoutingChangesObserver
initializedReplicaReinitialized, relocationSourceRemoved, relocationStarted, replicaPromoted, unassignedInfoUpdated
relocationCompletedpublic void relocationCompleted(ShardRouting removedRelocationSource)Description copied from interface:
RoutingChangesObserverCalled on relocation source when relocation completes after relocation target is started.
- Specified by:
applyChangesUpdates the current
Metadatabased on the changes of this RoutingChangesObserver. Specifically we update
IndexMetadata.primaryTerm(int)based on the changes made during this allocation.
removeStaleIdsWithoutRoutingspublic static ClusterState removeStaleIdsWithoutRoutings(ClusterState clusterState, List<StaleShard> staleShards, org.apache.logging.log4j.Logger logger)Removes allocation ids from the in-sync set for shard copies for which there is no routing entries in the routing table. This method is called in AllocationService before any changes to the routing table are made.