Class SegmentReference

java.lang.Object
org.apache.druid.segment.SegmentReference
All Implemented Interfaces:
Closeable, AutoCloseable

public class SegmentReference extends Object implements Closeable
Wrapper for a SegmentDescriptor and Optional<Segment>. For regular segments, the latter is typically created by a ReferenceCountedSegmentProvider that may have a SegmentMapFunction applied to it. If the SegmentMapFunction you want to apply is not available at the time the SegmentReference is created, use map(SegmentMapFunction) to apply it. Closing this object closes both the getSegmentReference() and any closeables attached from the process of creating this object, such as from AcquireSegmentAction. The object from getSegmentReference() should not be closed directly by callers.