Class OnheapIncrementalIndex
java.lang.Object
org.apache.druid.segment.incremental.IncrementalIndex
org.apache.druid.segment.incremental.OnheapIncrementalIndex
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<Row>,Expr.InputBindingInspector,ColumnInspector,IncrementalIndexRowSelector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class org.apache.druid.segment.incremental.IncrementalIndex
IncrementalIndex.AddToFactsResult, IncrementalIndex.DimensionDesc, IncrementalIndex.InputRowHolder, IncrementalIndex.MetricDesc -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final longprotected final intFields inherited from class org.apache.druid.segment.incremental.IncrementalIndex
inputRowHolder, preserveExistingMetrics, timePosition -
Method Summary
Modifier and TypeMethodDescriptionprotected IncrementalIndex.AddToFactsResultaddToFacts(IncrementalIndexRow key, IncrementalIndex.InputRowHolder inputRowHolder) booleanvoidclose()Clear out maps to allow GC NOTE: This is NOT thread-safe with add...getFacts()Get theFactsHoldercontaining all of theIncrementalIndexRowbacking this selectorintHighest valueIncrementalIndexRow.getRowIndex()available in this selector.doublegetMetricDoubleValue(int rowOffset, int aggOffset) floatgetMetricFloatValue(int rowOffset, int aggOffset) longgetMetricLongValue(int rowOffset, int aggOffset) getMetricObjectValue(int rowOffset, int aggOffset) getProjection(String name) getProjection(CursorBuildSpec buildSpec) protected voidinitAggs(AggregatorFactory[] metrics, IncrementalIndex.InputRowHolder inputRowHolder) booleanisNull(int rowOffset, int aggOffset) iterableWithPostAggregations(List<PostAggregator> postAggs, boolean descending) Methods inherited from class org.apache.druid.segment.incremental.IncrementalIndex
add, dimsComparator, formatRow, getBytesInMemory, getColumnCapabilities, getColumnFormat, getColumnFormats, getColumnNames, getCombinedParseException, getDimension, getDimensionNames, getDimensionOrder, getDimensions, getDimensionsSpec, getInterval, getMaxIngestedEventTime, getMaxTime, getMetric, getMetricAggs, getMetricNames, getMinTime, getOrdering, getTimePosition, isEmpty, isRollup, iterator, loadDimensionIterable, makeColumnSelectorFactory, makeColumnSelectorFactory, makeDefaultCapabilitiesFromValueType, makeMetricColumnValueSelector, numRowsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.segment.ColumnInspector
getTypeMethods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorizeMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
maxRowCount
protected final int maxRowCount -
maxBytesInMemory
protected final long maxBytesInMemory
-
-
Method Details
-
getFacts
Description copied from interface:IncrementalIndexRowSelectorGet theFactsHoldercontaining all of theIncrementalIndexRowbacking this selector -
getMetadata
- Overrides:
getMetadatain classIncrementalIndex
-
initAggs
protected void initAggs(AggregatorFactory[] metrics, IncrementalIndex.InputRowHolder inputRowHolder) - Specified by:
initAggsin classIncrementalIndex
-
addToFacts
protected IncrementalIndex.AddToFactsResult addToFacts(IncrementalIndexRow key, IncrementalIndex.InputRowHolder inputRowHolder) - Specified by:
addToFactsin classIncrementalIndex
-
getLastRowIndex
public int getLastRowIndex()Description copied from interface:IncrementalIndexRowSelectorHighest valueIncrementalIndexRow.getRowIndex()available in this selector. Note that these values do not reflect the position of the row in theFactsHolder, rather just the order in which they were processed -
getProjection
@Nullable public QueryableProjection<IncrementalIndexRowSelector> getProjection(CursorBuildSpec buildSpec) - Specified by:
getProjectionin classIncrementalIndex
-
getProjection
- Specified by:
getProjectionin classIncrementalIndex
-
canAppendRow
public boolean canAppendRow()- Specified by:
canAppendRowin classIncrementalIndex
-
getOutOfRowsReason
- Specified by:
getOutOfRowsReasonin classIncrementalIndex
-
getMetricFloatValue
public float getMetricFloatValue(int rowOffset, int aggOffset) - Parameters:
rowOffset- row to get float aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- float value of the metric
-
getMetricLongValue
public long getMetricLongValue(int rowOffset, int aggOffset) - Parameters:
rowOffset- row to get long aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- long value of the aggregator for this row
-
getMetricDoubleValue
public double getMetricDoubleValue(int rowOffset, int aggOffset) - Parameters:
rowOffset- row to get double aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- double value of the aggregator for this row
-
getMetricObjectValue
- Parameters:
rowOffset- row to get long aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- long value of the aggregator for this row
-
isNull
public boolean isNull(int rowOffset, int aggOffset) - Parameters:
rowOffset- row to check for a aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- is the value null for this row?
-
iterableWithPostAggregations
public Iterable<Row> iterableWithPostAggregations(@Nullable List<PostAggregator> postAggs, boolean descending) - Specified by:
iterableWithPostAggregationsin classIncrementalIndex
-
close
public void close()Clear out maps to allow GC NOTE: This is NOT thread-safe with add... so make sure all the adding is DONE before closing- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classIncrementalIndex
-