aggs = concurrentGet(priorIndex); parseExceptionMessages = doAggregate(metrics, aggs, rowContainer, row); } else { aggs = new Aggregator[metrics.length]; factorizeAggs(metrics, aggs, rowContainer, row); parseExceptionMessages = doAggregate(metrics, aggs, rowContainer, row); concurrentSet(rowIndex, aggs); if (IncrementalIndexRow.EMPTY_ROW_INDEX == prev) { numEntries.incrementAndGet(); long estimatedRowSize = estimateRowSizeInBytes(key, maxBytesPerRowForAggregators); sizeInBytes.addAndGet(estimatedRowSize); } else { aggs = concurrentGet(prev); parseExceptionMessages = doAggregate(metrics, aggs, rowContainer, row); concurrentRemove(rowIndex);
public IncrementalIndex buildOnheap() { if (maxRowCount <= 0) { throw new IllegalArgumentException("Invalid max row count: " + maxRowCount); } return new OnheapIncrementalIndex( Objects.requireNonNull(incrementalIndexSchema, "incrementIndexSchema is null"), deserializeComplexMetrics, reportParseExceptions, concurrentEventAdd, sortFacts, maxRowCount, maxBytesInMemory ); }
/** * Clear out maps to allow GC * NOTE: This is NOT thread-safe with add... so make sure all the adding is DONE before closing */ @Override public void close() { super.close(); closeAggregators(); aggregators.clear(); facts.clear(); if (selectors != null) { selectors.clear(); } }
OnheapIncrementalIndex( IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean concurrentEventAdd, boolean sortFacts, int maxRowCount, long maxBytesInMemory ) { super(incrementalIndexSchema, deserializeComplexMetrics, reportParseExceptions, concurrentEventAdd); this.maxRowCount = maxRowCount; this.maxBytesInMemory = maxBytesInMemory == 0 ? Long.MAX_VALUE : maxBytesInMemory; this.facts = incrementalIndexSchema.isRollup() ? new RollupFactsHolder(sortFacts, dimsComparator(), getDimensions()) : new PlainFactsHolder(sortFacts, dimsComparator()); maxBytesPerRowForAggregators = getMaxBytesPerRowForAggregators(incrementalIndexSchema); }
@Override protected Aggregator[] getAggsForRow(int rowOffset) { return concurrentGet(rowOffset); }
.buildOnheap(); index.add(new MapBasedInputRow( 0, Collections.singletonList("billy"), index.concurrentGet(0)[0] = mockedAggregator; index.close(); EasyMock.verify(mockedAggregator);
@Override public long getMetricLongValue(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].getLong(); }
OnheapIncrementalIndex( IncrementalIndexSchema incrementalIndexSchema, boolean deserializeComplexMetrics, boolean reportParseExceptions, boolean concurrentEventAdd, boolean sortFacts, int maxRowCount, long maxBytesInMemory ) { super(incrementalIndexSchema, deserializeComplexMetrics, reportParseExceptions, concurrentEventAdd); this.maxRowCount = maxRowCount; this.maxBytesInMemory = maxBytesInMemory == 0 ? Long.MAX_VALUE : maxBytesInMemory; this.facts = incrementalIndexSchema.isRollup() ? new RollupFactsHolder(sortFacts, dimsComparator(), getDimensions()) : new PlainFactsHolder(sortFacts, dimsComparator()); maxBytesPerRowForAggregators = getMaxBytesPerRowForAggregators(incrementalIndexSchema); }
aggs = concurrentGet(priorIndex); parseExceptionMessages = doAggregate(metrics, aggs, rowContainer, row); } else { aggs = new Aggregator[metrics.length]; factorizeAggs(metrics, aggs, rowContainer, row); parseExceptionMessages = doAggregate(metrics, aggs, rowContainer, row); concurrentSet(rowIndex, aggs); if (IncrementalIndexRow.EMPTY_ROW_INDEX == prev) { numEntries.incrementAndGet(); long estimatedRowSize = estimateRowSizeInBytes(key, maxBytesPerRowForAggregators); sizeInBytes.addAndGet(estimatedRowSize); } else { aggs = concurrentGet(prev); parseExceptionMessages = doAggregate(metrics, aggs, rowContainer, row); concurrentRemove(rowIndex);
@Override protected double getMetricDoubleValue(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].getDouble(); }
/** * Clear out maps to allow GC * NOTE: This is NOT thread-safe with add... so make sure all the adding is DONE before closing */ @Override public void close() { super.close(); closeAggregators(); aggregators.clear(); facts.clear(); if (selectors != null) { selectors.clear(); } }
public IncrementalIndex buildOnheap() { if (maxRowCount <= 0) { throw new IllegalArgumentException("Invalid max row count: " + maxRowCount); } return new OnheapIncrementalIndex( Objects.requireNonNull(incrementalIndexSchema, "incrementIndexSchema is null"), deserializeComplexMetrics, reportParseExceptions, concurrentEventAdd, sortFacts, maxRowCount, maxBytesInMemory ); }
@Override public boolean isNull(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].isNull(); }
@Override public float getMetricFloatValue(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].getFloat(); }
@Override public Object getMetricObjectValue(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].get(); }
@Override protected Aggregator[] getAggsForRow(int rowOffset) { return concurrentGet(rowOffset); }
@Override protected double getMetricDoubleValue(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].getDouble(); }
@Override public float getMetricFloatValue(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].getFloat(); }
@Override public boolean isNull(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].isNull(); }
@Override public long getMetricLongValue(int rowOffset, int aggOffset) { return concurrentGet(rowOffset)[aggOffset].getLong(); }