/** * A helper method to set a simple index schema with only metrics and default values for the other parameters. Note * that this method is normally used for testing and benchmarking; it is unlikely that you would use it in * production settings. * * @param metrics variable array of {@link AggregatorFactory} metrics * * @return this */ @VisibleForTesting public Builder setSimpleTestingIndexSchema(final AggregatorFactory... metrics) { return setSimpleTestingIndexSchema(null, metrics); }
private IncrementalIndex getIndexD3() throws Exception { IncrementalIndex toPersist1 = new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(new CountAggregatorFactory("count")) .setMaxRowCount(1000) .buildOnheap(); toPersist1.add( new MapBasedInputRow( 1, Arrays.asList("d3", "d1", "d2"), ImmutableMap.of("d1", "100", "d2", "4000", "d3", "30000") ) ); toPersist1.add( new MapBasedInputRow( 1, Arrays.asList("d3", "d1", "d2"), ImmutableMap.of("d1", "300", "d2", "2000", "d3", "40000") ) ); toPersist1.add( new MapBasedInputRow( 1, Arrays.asList("d3", "d1", "d2"), ImmutableMap.of("d1", "200", "d2", "3000", "d3", "50000") ) ); return toPersist1; }
.setSimpleTestingIndexSchema(new CountAggregatorFactory("count")) .setMaxRowCount(1000) .buildOnheap();
@Test public void testIncrementalIndexRowSizeComplex() { IncrementalIndex index = new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(new CountAggregatorFactory("cnt")) .setMaxRowCount(10000) .setMaxBytesInMemory(1000) .buildOnheap(); long time = System.currentTimeMillis(); IncrementalIndex.IncrementalIndexRowResult tndResult = index.toIncrementalIndexRow(toMapRow( time + 1, "billy", "nelson", "joe", Arrays.asList("123", "abcdef") )); IncrementalIndexRow td1 = tndResult.getIncrementalIndexRow(); Assert.assertEquals(74, td1.estimateBytesInMemory()); }
@Test public void testIncrementalIndexRowSizeArr() { IncrementalIndex index = new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(new CountAggregatorFactory("cnt")) .setMaxRowCount(10000) .setMaxBytesInMemory(1000) .buildOnheap(); long time = System.currentTimeMillis(); IncrementalIndex.IncrementalIndexRowResult tndResult = index.toIncrementalIndexRow(toMapRow( time + 1, "billy", "A", "joe", Arrays.asList("A", "B") )); IncrementalIndexRow td1 = tndResult.getIncrementalIndexRow(); Assert.assertEquals(50, td1.estimateBytesInMemory()); }
@Test public void testIncrementalIndexRowSizeBasic() { IncrementalIndex index = new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(new CountAggregatorFactory("cnt")) .setMaxRowCount(10000) .setMaxBytesInMemory(1000) .buildOnheap(); long time = System.currentTimeMillis(); IncrementalIndex.IncrementalIndexRowResult tndResult = index.toIncrementalIndexRow(toMapRow(time, "billy", "A", "joe", "B")); IncrementalIndexRow td1 = tndResult.getIncrementalIndexRow(); Assert.assertEquals(44, td1.estimateBytesInMemory()); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
public static IncrementalIndex createIndex(AggregatorFactory[] aggregatorFactories) { if (null == aggregatorFactories) { aggregatorFactories = defaultAggregatorFactories; } return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(aggregatorFactories) .setMaxRowCount(1000000) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
public static IncrementalIndex createNoRollupIndex(AggregatorFactory[] aggregatorFactories) { if (null == aggregatorFactories) { aggregatorFactories = defaultAggregatorFactories; } return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(false, aggregatorFactories) .setMaxRowCount(1000000) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex makeIncIndex(AggregatorFactory[] metrics) { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(metrics) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
@Override public IncrementalIndex createIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(new CountAggregatorFactory("cnt")) .setMaxRowCount(1000) .buildOnheap(); } }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setConcurrentEventAdd(true) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex getSingleDimIndex(String dimName, List<String> values) throws Exception { IncrementalIndex toPersist1 = new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(new CountAggregatorFactory("count")) .setMaxRowCount(1000) .buildOnheap(); addDimValuesToIndex(toPersist1, dimName, values); return toPersist1; }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(aggs) .setDeserializeComplexMetrics(false) .setReportParseExceptions(false) .setMaxRowCount(maxRows) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setSimpleTestingIndexSchema(schemaInfo.getAggsArray()) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }