public interface Segment extends Closeable
DataSegment is that DataSegment contains the segment metadata only, while this class represents the actual
body of segment data, queryable.| Modifier and Type | Method and 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() |
SegmentId getId()
org.joda.time.Interval getDataInterval()
@Nullable QueryableIndex asQueryableIndex()
StorageAdapter asStorageAdapter()
@Nullable default <T> T as(Class<T> clazz)
QueryableIndex or StorageAdapter, then this method behaves
identically to asQueryableIndex() or asStorageAdapter(). 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 than QueryableIndex or StorageAdapter are limited
to using those classes within the extension. This means that one extension cannot rely on the `Segment.as`
behavior of another extension.T - desired interfaceclazz - desired interfaceCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.