public abstract class IncrementalIndex<AggregatorType> extends Object implements Iterable<io.druid.data.input.Row>, Closeable
Modifier and Type | Class and Description |
---|---|
static class |
IncrementalIndex.DimensionDesc |
static class |
IncrementalIndex.MetricDesc |
Constructor and Description |
---|
IncrementalIndex(IncrementalIndexSchema incrementalIndexSchema,
boolean deserializeComplexMetrics,
boolean reportParseExceptions)
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,
boolean reportParseExceptions,
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() |
protected Comparator<io.druid.segment.incremental.IncrementalIndex.TimeAndDims> |
dimsComparator() |
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) |
IncrementalIndex.DimensionDesc |
getDimension(String dimension) |
List<String> |
getDimensionNames() |
List<String> |
getDimensionOrder() |
List<IncrementalIndex.DimensionDesc> |
getDimensions() |
io.druid.segment.incremental.IncrementalIndex.DimDim |
getDimensionValues(String dimension) |
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() |
Metadata |
getMetadata() |
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) |
List<IncrementalIndex.MetricDesc> |
getMetrics() |
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,
boolean descending) |
Iterator<io.druid.data.input.Row> |
iterator() |
void |
loadDimensionIterable(Iterable<String> oldDimensionOrder) |
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,
Object lock) |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public IncrementalIndex(IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics, boolean reportParseExceptions)
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.reportParseExceptions
- flag whether or not to report ParseExceptions that occur while extracting values
from input rowspublic 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, Object lock)
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, boolean reportParseExceptions, 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
Calls to add() are thread safe.
row
- the row of data to addIndexSizeExceededException
public boolean isEmpty()
public int size()
public AggregatorType[] getAggs()
public AggregatorFactory[] getMetricAggs()
public List<IncrementalIndex.DimensionDesc> getDimensions()
public IncrementalIndex.DimensionDesc getDimension(String dimension)
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 getDimensionValues(String dimension)
public List<IncrementalIndex.MetricDesc> getMetrics()
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 Metadata getMetadata()
public Iterator<io.druid.data.input.Row> iterator()
public Iterable<io.druid.data.input.Row> iterableWithPostAggregations(List<PostAggregator> postAggs, boolean descending)
public org.joda.time.DateTime getMaxIngestedEventTime()
protected final Comparator<io.druid.segment.incremental.IncrementalIndex.TimeAndDims> dimsComparator()
Copyright © 2011–2016. All rights reserved.