Package org.apache.druid.segment
Interface Segment
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Subinterfaces:
SegmentReference
- All Known Implementing Classes:
AbstractSegment
,ArrayListSegment
,FrameSegment
,HashJoinSegment
,IncrementalIndexSegment
,LookupSegment
,QueryableIndexSegment
,ReferenceCountingSegment
,RowBasedSegment
,WrappedSegmentReference
public interface Segment extends Closeable
The difference between this class andDataSegment
is thatDataSegment
contains the segment metadata only, while this class represents the actual body of segment data, queryable.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> T
as(Class<T> clazz)
Request an implementation of a particular interface.QueryableIndex
asQueryableIndex()
StorageAdapter
asStorageAdapter()
org.joda.time.Interval
getDataInterval()
SegmentId
getId()
-
-
-
Method Detail
-
getId
SegmentId getId()
-
getDataInterval
org.joda.time.Interval getDataInterval()
-
asQueryableIndex
@Nullable QueryableIndex asQueryableIndex()
-
asStorageAdapter
StorageAdapter asStorageAdapter()
-
as
@Nullable default <T> T as(@Nonnull Class<T> clazz)
Request an implementation of a particular interface. If the passed-in interface isQueryableIndex
orStorageAdapter
, then this method behaves identically toasQueryableIndex()
orasStorageAdapter()
. Other interfaces are only expected to be requested by callers that have specific knowledge of extra features provided by specific segment types. For example, an extension might provide a custom Segment type that can offer both StorageAdapter and some new interface. That extension can also offer a Query that uses that new interface. Implementations which accept classes other thanQueryableIndex
orStorageAdapter
are limited to using those classes within the extension. This means that one extension cannot rely on the `Segment.as` behavior of another extension.- Type Parameters:
T
- desired interface- Parameters:
clazz
- desired interface- Returns:
- instance of clazz, or null if the interface is not supported by this segment
-
-