Class KillUnusedSegments
- java.lang.Object
-
- org.apache.druid.server.coordinator.duty.KillUnusedSegments
-
- All Implemented Interfaces:
CoordinatorDuty
public class KillUnusedSegments extends Object implements CoordinatorDuty
Completely removes information about unused segments who have an interval end that comes before now -
durationToRetainfrom the metadata store.durationToRetaincan be a positive or negative duration, negative meaning the interval end target will be in the future. Also,durationToRetaincan be ignored ifignoreDurationToRetainis 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 byfindIntervalForKill(String, DateTime), which takes into account the configuredbufferPeriod. However, the kill task needs to check again for maxbufferPeriodfor the unused segments in the widened interval as there can be multiple unused segments with differentused_status_last_updatedtime.See
org.apache.druid.indexing.common.task.KillUnusedSegmentsTask.
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.base.Predicate<org.apache.druid.indexer.TaskStatusPlus>IS_AUTO_KILL_TASKstatic StringKILL_TASK_TYPEstatic StringTASK_ID_PREFIX
-
Constructor Summary
Constructors Constructor Description KillUnusedSegments(SegmentsMetadataManager segmentsMetadataManager, OverlordClient overlordClient, DruidCoordinatorConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DruidCoordinatorRuntimeParamsrun(DruidCoordinatorRuntimeParams params)Implementations of this method run various activities performed by the coordinator.
-
-
-
Field Detail
-
KILL_TASK_TYPE
public static final String KILL_TASK_TYPE
- See Also:
- Constant Field Values
-
TASK_ID_PREFIX
public static final String TASK_ID_PREFIX
- See Also:
- Constant Field Values
-
IS_AUTO_KILL_TASK
public static final com.google.common.base.Predicate<org.apache.druid.indexer.TaskStatusPlus> IS_AUTO_KILL_TASK
-
-
Constructor Detail
-
KillUnusedSegments
public KillUnusedSegments(SegmentsMetadataManager segmentsMetadataManager, OverlordClient overlordClient, DruidCoordinatorConfig config)
-
-
Method Detail
-
run
public DruidCoordinatorRuntimeParams run(DruidCoordinatorRuntimeParams params)
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.
-
-