public abstract class IncrementalIndex<AggregatorType> extends Object implements Iterable<io.druid.data.input.Row>, Closeable
Modifier and Type | Field and Description |
---|---|
protected CopyOnWriteArrayList<String> |
dimensions |
Constructor and Description |
---|
IncrementalIndex(IncrementalIndexSchema incrementalIndexSchema,
boolean deserializeComplexMetrics)
Setting deserializeComplexMetrics to false is necessary for intermediate aggregation such as groupBy that
should not deserialize input columns using ComplexMetricSerde for aggregators that return complex metrics.
|
Modifier and Type | Method and Description |
---|---|
int |
add(io.druid.data.input.InputRow row)
Adds a new row.
|
protected abstract Integer |
addToFacts(AggregatorFactory[] metrics,
boolean deserializeComplexMetrics,
io.druid.data.input.InputRow row,
AtomicInteger numEntries,
io.druid.segment.incremental.IncrementalIndex.TimeAndDims key,
ThreadLocal<io.druid.data.input.InputRow> rowContainer,
com.google.common.base.Supplier<io.druid.data.input.InputRow> rowSupplier) |
abstract boolean |
canAppendRow() |
void |
close() |
io.druid.data.input.InputRow |
formatRow(io.druid.data.input.InputRow row) |
AggregatorType[] |
getAggs() |
protected abstract AggregatorType[] |
getAggsForRow(int rowOffset) |
protected abstract Object |
getAggVal(AggregatorType agg,
int rowOffset,
int aggPosition) |
ColumnCapabilities |
getCapabilities(String column) |
io.druid.segment.incremental.IncrementalIndex.DimDim |
getDimension(String dimension) |
Integer |
getDimensionIndex(String dimension) |
List<String> |
getDimensions() |
io.druid.segment.incremental.IncrementalIndex.DimensionHolder |
getDimValues() |
abstract ConcurrentNavigableMap<io.druid.segment.incremental.IncrementalIndex.TimeAndDims,Integer> |
getFacts() |
org.joda.time.Interval |
getInterval() |
org.joda.time.DateTime |
getMaxIngestedEventTime() |
org.joda.time.DateTime |
getMaxTime() |
AggregatorFactory[] |
getMetricAggs() |
protected abstract float |
getMetricFloatValue(int rowOffset,
int aggOffset) |
Integer |
getMetricIndex(String metricName) |
protected abstract long |
getMetricLongValue(int rowOffset,
int aggOffset) |
List<String> |
getMetricNames() |
protected abstract Object |
getMetricObjectValue(int rowOffset,
int aggOffset) |
String |
getMetricType(String metric) |
org.joda.time.DateTime |
getMinTime() |
abstract String |
getOutOfRowsReason() |
ConcurrentNavigableMap<io.druid.segment.incremental.IncrementalIndex.TimeAndDims,Integer> |
getSubMap(io.druid.segment.incremental.IncrementalIndex.TimeAndDims start,
io.druid.segment.incremental.IncrementalIndex.TimeAndDims end) |
protected abstract AggregatorType[] |
initAggs(AggregatorFactory[] metrics,
com.google.common.base.Supplier<io.druid.data.input.InputRow> rowSupplier,
boolean deserializeComplexMetrics) |
boolean |
isEmpty() |
Iterable<io.druid.data.input.Row> |
iterableWithPostAggregations(List<PostAggregator> postAggs) |
Iterator<io.druid.data.input.Row> |
iterator() |
static ColumnSelectorFactory |
makeColumnSelectorFactory(AggregatorFactory agg,
com.google.common.base.Supplier<io.druid.data.input.InputRow> in,
boolean deserializeComplexMetrics) |
protected abstract io.druid.segment.incremental.IncrementalIndex.DimDim |
makeDimDim(String dimension) |
int |
size() |
void |
updateMaxIngestedTime(org.joda.time.DateTime eventTime) |
protected final CopyOnWriteArrayList<String> dimensions
public IncrementalIndex(IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics)
incrementalIndexSchema
- the schema to use for incremental indexdeserializeComplexMetrics
- flag whether or not to call ComplexMetricExtractor.extractValue() on the input
value for aggregators that return metrics other than float.public static ColumnSelectorFactory makeColumnSelectorFactory(AggregatorFactory agg, com.google.common.base.Supplier<io.druid.data.input.InputRow> in, boolean deserializeComplexMetrics)
public abstract ConcurrentNavigableMap<io.druid.segment.incremental.IncrementalIndex.TimeAndDims,Integer> getFacts()
public abstract boolean canAppendRow()
public abstract String getOutOfRowsReason()
protected abstract io.druid.segment.incremental.IncrementalIndex.DimDim makeDimDim(String dimension)
protected abstract AggregatorType[] initAggs(AggregatorFactory[] metrics, com.google.common.base.Supplier<io.druid.data.input.InputRow> rowSupplier, boolean deserializeComplexMetrics)
protected abstract Integer addToFacts(AggregatorFactory[] metrics, boolean deserializeComplexMetrics, io.druid.data.input.InputRow row, AtomicInteger numEntries, io.druid.segment.incremental.IncrementalIndex.TimeAndDims key, ThreadLocal<io.druid.data.input.InputRow> rowContainer, com.google.common.base.Supplier<io.druid.data.input.InputRow> rowSupplier) throws IndexSizeExceededException
IndexSizeExceededException
protected abstract AggregatorType[] getAggsForRow(int rowOffset)
protected abstract Object getAggVal(AggregatorType agg, int rowOffset, int aggPosition)
protected abstract float getMetricFloatValue(int rowOffset, int aggOffset)
protected abstract long getMetricLongValue(int rowOffset, int aggOffset)
protected abstract Object getMetricObjectValue(int rowOffset, int aggOffset)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public io.druid.data.input.InputRow formatRow(io.druid.data.input.InputRow row)
public int add(io.druid.data.input.InputRow row) throws IndexSizeExceededException
row
- the row of data to addIndexSizeExceededException
public void updateMaxIngestedTime(org.joda.time.DateTime eventTime)
public boolean isEmpty()
public int size()
public AggregatorType[] getAggs()
public AggregatorFactory[] getMetricAggs()
public io.druid.segment.incremental.IncrementalIndex.DimensionHolder getDimValues()
public org.joda.time.Interval getInterval()
public org.joda.time.DateTime getMinTime()
public org.joda.time.DateTime getMaxTime()
public io.druid.segment.incremental.IncrementalIndex.DimDim getDimension(String dimension)
public ColumnCapabilities getCapabilities(String column)
public ConcurrentNavigableMap<io.druid.segment.incremental.IncrementalIndex.TimeAndDims,Integer> getSubMap(io.druid.segment.incremental.IncrementalIndex.TimeAndDims start, io.druid.segment.incremental.IncrementalIndex.TimeAndDims end)
public Iterator<io.druid.data.input.Row> iterator()
public Iterable<io.druid.data.input.Row> iterableWithPostAggregations(List<PostAggregator> postAggs)
public org.joda.time.DateTime getMaxIngestedEventTime()
Copyright © 2011–2015. All rights reserved.