Class StrategicSegmentAssigner
java.lang.Object
org.apache.druid.server.coordinator.loading.StrategicSegmentAssigner
- All Implemented Interfaces:
SegmentActionHandler
Used by the coordinator in each run for segment loading, dropping, balancing
and broadcasting.
An instance of this class is freshly created for each coordinator run.
-
Constructor Summary
ConstructorsConstructorDescriptionStrategicSegmentAssigner(SegmentLoadQueueManager loadQueueManager, DruidCluster cluster, BalancerStrategy strategy, SegmentLoadingConfig loadingConfig, CoordinatorRunStats stats) -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcastSegment(DataSegment segment) Broadcasts the given segment to all servers that are broadcast targets.voiddeleteSegment(DataSegment segment) Marks the given segment as unused.booleanmoveSegment(DataSegment segment, ServerHolder sourceServer, List<ServerHolder> destinationServers) Moves the given segment from the source server to an eligible destination server.voidreplicateSegment(DataSegment segment, Map<String, Integer> tierToReplicaCount) Queues load or drop of replicas of the given segment to achieve the target replication level on all historical tiers.
-
Constructor Details
-
StrategicSegmentAssigner
public StrategicSegmentAssigner(SegmentLoadQueueManager loadQueueManager, DruidCluster cluster, BalancerStrategy strategy, SegmentLoadingConfig loadingConfig, CoordinatorRunStats stats)
-
-
Method Details
-
getReplicationStatus
-
getSegmentsToDelete
-
getSegmentsWithZeroRequiredReplicas
-
getDatasourceToInvalidLoadTiers
-
moveSegment
public boolean moveSegment(DataSegment segment, ServerHolder sourceServer, List<ServerHolder> destinationServers) Moves the given segment from the source server to an eligible destination server.An eligible destination server must:
- be present in the given list of destination servers
- belong to the same tier as the source server
- not already be serving or loading a replica of the segment
- have enough space to load the segment
The segment is not moved if:
- there is no eligible destination server
- or segment is already optimally placed
- or some other error occurs
-
replicateSegment
Description copied from interface:SegmentActionHandlerQueues load or drop of replicas of the given segment to achieve the target replication level on all historical tiers.- Specified by:
replicateSegmentin interfaceSegmentActionHandler
-
broadcastSegment
Description copied from interface:SegmentActionHandlerBroadcasts the given segment to all servers that are broadcast targets.- Specified by:
broadcastSegmentin interfaceSegmentActionHandler
-
deleteSegment
Description copied from interface:SegmentActionHandlerMarks the given segment as unused. Unused segments are eventually unloaded from all servers and deleted from metadata as well as deep storage.- Specified by:
deleteSegmentin interfaceSegmentActionHandler
-
getBroadcastSegments
-