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
public class OnheapIncrementalIndex extends IncrementalIndex
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OnheapIncrementalIndex.Builder
static class
OnheapIncrementalIndex.Spec
-
Nested classes/interfaces inherited from class org.apache.druid.segment.incremental.IncrementalIndex
IncrementalIndex.DimensionDesc, IncrementalIndex.MetricDesc
-
-
Field Summary
Fields Modifier and Type Field Description protected long
maxBytesInMemory
protected int
maxRowCount
-
Fields inherited from class org.apache.druid.segment.incremental.IncrementalIndex
preserveExistingMetrics
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.druid.segment.incremental.IncrementalIndex.AddToFactsResult
addToFacts(InputRow row, IncrementalIndexRow key, ThreadLocal<InputRow> rowContainer, com.google.common.base.Supplier<InputRow> rowSupplier, boolean skipMaxRowsInMemoryCheck)
boolean
canAppendRow()
void
close()
Clear out maps to allow GC NOTE: This is NOT thread-safe with add...protected Aggregator[]
concurrentGet(int offset)
protected void
concurrentRemove(int offset)
protected void
concurrentSet(int offset, Aggregator[] value)
protected Aggregator[]
getAggsForRow(int rowOffset)
org.apache.druid.segment.incremental.IncrementalIndex.FactsHolder
getFacts()
int
getLastRowIndex()
protected double
getMetricDoubleValue(int rowOffset, int aggOffset)
float
getMetricFloatValue(int rowOffset, int aggOffset)
long
getMetricLongValue(int rowOffset, int aggOffset)
Object
getMetricObjectValue(int rowOffset, int aggOffset)
String
getOutOfRowsReason()
protected void
initAggs(AggregatorFactory[] metrics, com.google.common.base.Supplier<InputRow> rowSupplier, boolean deserializeComplexMetrics, boolean concurrentEventAdd)
boolean
isNull(int rowOffset, int aggOffset)
Iterable<Row>
iterableWithPostAggregations(List<PostAggregator> postAggs, boolean descending)
-
Methods inherited from class org.apache.druid.segment.incremental.IncrementalIndex
add, add, dimsComparator, formatRow, getBytesInMemory, getColumnCapabilities, getColumnFormat, getColumnFormats, getColumnNames, getCombinedParseException, getDimension, getDimensionIndex, getDimensionNames, getDimensionOrder, getDimensions, getDimensionsSpec, getInterval, getMaxIngestedEventTime, getMaxTime, getMetadata, getMetricAggs, getMetricNames, getMinTime, isEmpty, isRollup, iterator, loadDimensionIterable, makeColumnSelectorFactory, makeColumnSelectorFactory, makeDefaultCapabilitiesFromValueType, makeMetricColumnValueSelector, size
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.ColumnInspector
getColumnCapabilitiesWithDefault, getType
-
Methods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getFacts
public org.apache.druid.segment.incremental.IncrementalIndex.FactsHolder getFacts()
- Specified by:
getFacts
in classIncrementalIndex
-
initAggs
protected void initAggs(AggregatorFactory[] metrics, com.google.common.base.Supplier<InputRow> rowSupplier, boolean deserializeComplexMetrics, boolean concurrentEventAdd)
- Specified by:
initAggs
in classIncrementalIndex
-
addToFacts
protected org.apache.druid.segment.incremental.IncrementalIndex.AddToFactsResult addToFacts(InputRow row, IncrementalIndexRow key, ThreadLocal<InputRow> rowContainer, com.google.common.base.Supplier<InputRow> rowSupplier, boolean skipMaxRowsInMemoryCheck) throws IndexSizeExceededException
- Specified by:
addToFacts
in classIncrementalIndex
- Throws:
IndexSizeExceededException
-
getLastRowIndex
public int getLastRowIndex()
- Specified by:
getLastRowIndex
in classIncrementalIndex
-
concurrentGet
protected Aggregator[] concurrentGet(int offset)
-
concurrentSet
protected void concurrentSet(int offset, Aggregator[] value)
-
concurrentRemove
protected void concurrentRemove(int offset)
-
canAppendRow
public boolean canAppendRow()
- Specified by:
canAppendRow
in classIncrementalIndex
-
getOutOfRowsReason
public String getOutOfRowsReason()
- Specified by:
getOutOfRowsReason
in classIncrementalIndex
-
getAggsForRow
protected Aggregator[] getAggsForRow(int rowOffset)
-
getMetricFloatValue
public float getMetricFloatValue(int rowOffset, int aggOffset)
- Specified by:
getMetricFloatValue
in classIncrementalIndex
-
getMetricLongValue
public long getMetricLongValue(int rowOffset, int aggOffset)
- Specified by:
getMetricLongValue
in classIncrementalIndex
-
getMetricObjectValue
public Object getMetricObjectValue(int rowOffset, int aggOffset)
- Specified by:
getMetricObjectValue
in classIncrementalIndex
-
getMetricDoubleValue
protected double getMetricDoubleValue(int rowOffset, int aggOffset)
- Specified by:
getMetricDoubleValue
in classIncrementalIndex
-
isNull
public boolean isNull(int rowOffset, int aggOffset)
- Specified by:
isNull
in classIncrementalIndex
-
iterableWithPostAggregations
public Iterable<Row> iterableWithPostAggregations(@Nullable List<PostAggregator> postAggs, boolean descending)
- Specified by:
iterableWithPostAggregations
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classIncrementalIndex
-
-