public class RowBasedSegment<RowType> extends Object implements Segment
Segment that is based on a stream of objects.| Constructor and Description |
|---|
RowBasedSegment(SegmentId segmentId,
Iterable<RowType> rowIterable,
RowAdapter<RowType> rowAdapter,
RowSignature rowSignature)
Create a row-based segment.
|
| Modifier and Type | Method and Description |
|---|---|
QueryableIndex |
asQueryableIndex() |
StorageAdapter |
asStorageAdapter() |
void |
close() |
org.joda.time.Interval |
getDataInterval() |
SegmentId |
getId() |
public RowBasedSegment(SegmentId segmentId, Iterable<RowType> rowIterable, RowAdapter<RowType> rowAdapter, RowSignature rowSignature)
RowAdapter.timestampFunction().
The cursor returned by RowBasedStorageAdapter.makeCursors(org.apache.druid.query.filter.Filter, org.joda.time.Interval, org.apache.druid.segment.VirtualColumns, org.apache.druid.java.util.common.granularity.Granularity, boolean, org.apache.druid.query.QueryMetrics<?>) makes no attempt to verify this, and callers
will expect it.
The provided "rowSignature" will be used for reporting available columns and their capabilities to users of
asStorageAdapter(). Note that the ColumnSelectorFactory implementation returned by this segment's
storage adapter will allow creation of selectors on any field, using the RowAdapter.columnFunction(java.lang.String) for that
field, even if it doesn't appear in "rowSignature".segmentId - segment identifier; will be returned by getId()rowIterable - objects that comprise this segmentrowAdapter - adapter used for reading these objectsrowSignature - signature of the columns in these objects@Nonnull public org.joda.time.Interval getDataInterval()
getDataInterval in interface Segment@Nullable public QueryableIndex asQueryableIndex()
asQueryableIndex in interface Segment@Nonnull public StorageAdapter asStorageAdapter()
asStorageAdapter in interface Segmentpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.