public abstract class IncrementalIndex<AggregatorType> extends Object implements Iterable<Row>, Closeable
Modifier and Type | Class and Description |
---|---|
static class |
IncrementalIndex.DimensionDesc |
static class |
IncrementalIndex.FactsEntry |
static class |
IncrementalIndex.MetricDesc |
static class |
IncrementalIndex.TimeAndDims |
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(InputRow row)
Adds a new row.
|
protected abstract Integer |
addToFacts(AggregatorFactory[] metrics,
boolean deserializeComplexMetrics,
boolean reportParseExceptions,
InputRow row,
AtomicInteger numEntries,
IncrementalIndex.TimeAndDims key,
ThreadLocal<InputRow> rowContainer,
com.google.common.base.Supplier<InputRow> rowSupplier) |
abstract boolean |
canAppendRow() |
void |
close() |
protected Comparator<IncrementalIndex.TimeAndDims> |
dimsComparator() |
InputRow |
formatRow(InputRow row) |
AggregatorType[] |
getAggs() |
protected abstract AggregatorType[] |
getAggsForRow(int rowOffset) |
protected abstract Object |
getAggVal(AggregatorType agg,
int rowOffset,
int aggPosition) |
ColumnCapabilities |
getCapabilities(String column) |
Map<String,ColumnCapabilitiesImpl> |
getColumnCapabilities() |
IncrementalIndex.DimensionDesc |
getDimension(String dimension) |
Map<String,DimensionHandler> |
getDimensionHandlers() |
Integer |
getDimensionIndex(String dimension) |
List<String> |
getDimensionNames() |
List<String> |
getDimensionOrder() |
List<IncrementalIndex.DimensionDesc> |
getDimensions() |
abstract io.druid.segment.incremental.IncrementalIndex.FactsHolder |
getFacts() |
org.joda.time.Interval |
getInterval() |
org.joda.time.DateTime |
getMaxIngestedEventTime() |
org.joda.time.DateTime |
getMaxTime() |
Metadata |
getMetadata() |
AggregatorFactory[] |
getMetricAggs() |
Class |
getMetricClass(String metric) |
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() |
protected abstract AggregatorType[] |
initAggs(AggregatorFactory[] metrics,
com.google.common.base.Supplier<InputRow> rowSupplier,
boolean deserializeComplexMetrics) |
boolean |
isEmpty() |
boolean |
isRollup() |
Iterable<Row> |
iterableWithPostAggregations(List<PostAggregator> postAggs,
boolean descending) |
Iterator<Row> |
iterator() |
void |
loadDimensionIterable(Iterable<String> oldDimensionOrder,
Map<String,ColumnCapabilitiesImpl> oldColumnCapabilities) |
protected ColumnSelectorFactory |
makeColumnSelectorFactory(AggregatorFactory agg,
com.google.common.base.Supplier<InputRow> in,
boolean deserializeComplexMetrics) |
static ColumnSelectorFactory |
makeColumnSelectorFactory(VirtualColumns virtualColumns,
AggregatorFactory agg,
com.google.common.base.Supplier<InputRow> in,
boolean deserializeComplexMetrics)
Column selector used at ingestion time for inputs to aggregators.
|
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(VirtualColumns virtualColumns, AggregatorFactory agg, com.google.common.base.Supplier<InputRow> in, boolean deserializeComplexMetrics)
agg
- the aggregatorin
- ingestion-time input row supplierdeserializeComplexMetrics
- whether complex objects should be deserialized by a ComplexMetricExtractor
public boolean isRollup()
public abstract io.druid.segment.incremental.IncrementalIndex.FactsHolder getFacts()
public abstract boolean canAppendRow()
public abstract String getOutOfRowsReason()
protected abstract AggregatorType[] initAggs(AggregatorFactory[] metrics, com.google.common.base.Supplier<InputRow> rowSupplier, boolean deserializeComplexMetrics)
protected abstract Integer addToFacts(AggregatorFactory[] metrics, boolean deserializeComplexMetrics, boolean reportParseExceptions, InputRow row, AtomicInteger numEntries, IncrementalIndex.TimeAndDims key, ThreadLocal<InputRow> rowContainer, com.google.common.base.Supplier<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 Map<String,ColumnCapabilitiesImpl> getColumnCapabilities()
public int add(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 void loadDimensionIterable(Iterable<String> oldDimensionOrder, Map<String,ColumnCapabilitiesImpl> oldColumnCapabilities)
public List<IncrementalIndex.MetricDesc> getMetrics()
public ColumnCapabilities getCapabilities(String column)
public Metadata getMetadata()
public Map<String,DimensionHandler> getDimensionHandlers()
public Iterable<Row> iterableWithPostAggregations(List<PostAggregator> postAggs, boolean descending)
public org.joda.time.DateTime getMaxIngestedEventTime()
protected ColumnSelectorFactory makeColumnSelectorFactory(AggregatorFactory agg, com.google.common.base.Supplier<InputRow> in, boolean deserializeComplexMetrics)
protected final Comparator<IncrementalIndex.TimeAndDims> dimsComparator()
Copyright © 2011–2017. All rights reserved.