Package org.apache.druid.segment.loading
Interface DataSegmentKiller
public interface DataSegmentKiller
DataSegmentKiller knows how to kill segments from the Druid system.
Since any implementation of DataSegmentKiller is initialized when an ingestion job starts
if a deep storage extension is loaded even when that deep storage is actually not used,
implementations should avoid initializing the deep storage client immediately
but defer it until the deep storage client is actually used.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdescriptorPath(String path) default voidkill(List<DataSegment> segments) Kills a list of segments from deep storage.voidkill(DataSegment segment) Removes segment files (index and metadata) from deep storage.voidkillAll()Like a nuke.default voidkillQuietly(DataSegment segment) A more stoic killer who doesn't throw a tantrum if things get messy.
-
Field Details
-
log
-
-
Method Details
-
descriptorPath
-
kill
Removes segment files (index and metadata) from deep storage.- Parameters:
segment- the segment to kill- Throws:
SegmentLoadingException- if the segment could not be completely removed
-
kill
Kills a list of segments from deep storage. The default implementation calls kill on the segments in a loop. Implementers of this interface can leverage batch / bulk deletes to be more efficient. It is preferable to attempt to delete all segments even if there is an issue with deleting a single one. This is up to implementers to implement as putting a try catch around the default kill via iteration can be problematic if the client of the deep storage is unable to authenticate itself and segment loading exception doesn't encode enough information in it to \ understand why it failed.If a segment or segments does not exist in deep storage, the method should not throw an exception.
This version of kill must **NOT** require additional permissions on the deep storage beyond what
kill(DataSegment)requires.- Parameters:
segments- The list of segments to kill.- Throws:
SegmentLoadingException- If there is an exception during deletion such as a segment in the list could not be completely removed.
-
killQuietly
A more stoic killer who doesn't throw a tantrum if things get messy. Use when killing segments for best-effort cleanup.- Parameters:
segment- the segment to kill
-
killAll
Like a nuke. Use wisely. Used by the 'reset-cluster' command, and of the built-in deep storage implementations, it is only implemented by local and HDFS.- Throws:
IOException
-