Class KillUnusedSegments
- All Implemented Interfaces:
CoordinatorDuty
Completely removes information about unused segments who have an interval end that comes before
now - durationToRetain from the metadata store. durationToRetain can be a positive or negative duration,
negative meaning the interval end target will be in the future. Also, durationToRetain can be ignored if
ignoreDurationToRetain is enabled, meaning that there is no upper bound to the end interval of segments that
will be killed. The umbrella interval of the unused segments per datasource to be killed is determined by
findIntervalForKill(String, DateTime, CoordinatorRunStats), which takes into account the configured bufferPeriod.
However, the kill task needs to check again for max bufferPeriod for the unused segments in the widened interval
as there can be multiple unused segments with different used_status_last_updated time.
The datasources to be killed during each cycle are selected from datasourceCircularKillList. This state is
refreshed in a run if the set of datasources to be killed changes. Consecutive duplicate datasources are avoided
across runs, provided there are other datasources to be killed.
- See Also:
-
for details of the actual kill task andUnusedSegmentKillerto run embedded kill tasks on the Overlord.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKillUnusedSegments(IndexerMetadataStorageCoordinator storageCoordinator, OverlordClient overlordClient, KillUnusedSegmentsConfig killConfig) -
Method Summary
Modifier and TypeMethodDescriptionrun(DruidCoordinatorRuntimeParams params) Implementations of this method run various activities performed by the coordinator.
-
Field Details
-
KILL_TASK_TYPE
- See Also:
-
TASK_ID_PREFIX
- See Also:
-
-
Constructor Details
-
KillUnusedSegments
public KillUnusedSegments(IndexerMetadataStorageCoordinator storageCoordinator, OverlordClient overlordClient, KillUnusedSegmentsConfig killConfig)
-
-
Method Details
-
run
Description copied from interface:CoordinatorDutyImplementations of this method run various activities performed by the coordinator. Input params can be used and modified. The returned DruidCoordinatorRuntimeParams is passed to the next duty.- Specified by:
runin interfaceCoordinatorDuty- Returns:
- same as input or a modified value to be used by next duty. Null return
values will prevent subsequent CoordinatorDuty objects (see the order in the lists passed into the constructor of
DruidCoordinator.DutiesRunnable) from running until the next cycle.
-