/** * A helper method to set a simple index schema with controllable metrics and rollup, 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(@Nullable Boolean rollup, final AggregatorFactory... metrics) { IncrementalIndexSchema.Builder builder = new IncrementalIndexSchema.Builder().withMetrics(metrics); this.incrementalIndexSchema = rollup != null ? builder.withRollup(rollup).build() : builder.build(); return this; }
private static IncrementalIndex newIndex(String minTimeStamp, int maxRowCount) { final IncrementalIndexSchema schema = new IncrementalIndexSchema.Builder() .withMinTimestamp(DateTimes.of(minTimeStamp).getMillis()) .withQueryGranularity(Granularities.HOUR) .withMetrics(TestIndex.METRIC_AGGS) .build(); return new IncrementalIndex.Builder() .setIndexSchema(schema) .setMaxRowCount(maxRowCount) .buildOnheap(); }
private static IncrementalIndex newIndex(String minTimeStamp, int maxRowCount) { final IncrementalIndexSchema schema = new IncrementalIndexSchema.Builder() .withMinTimestamp(DateTimes.of(minTimeStamp).getMillis()) .withQueryGranularity(Granularities.HOUR) .withMetrics(TestIndex.METRIC_AGGS) .build(); return new IncrementalIndex.Builder() .setIndexSchema(schema) .setMaxRowCount(maxRowCount) .buildOnheap(); }
private IncrementalIndex makeIncIndex(boolean withRollup) { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(new DimensionsSpec( Arrays.asList( new StringDimensionSchema("dimA"), new LongDimensionSchema("metA") ), null, null )) .withRollup(withRollup) .build() ) .setReportParseExceptions(false) .setConcurrentEventAdd(true) .setMaxRowCount(1000) .buildOnheap(); }
public FloatAndDoubleFilteringTest( String testName, IndexBuilder indexBuilder, Function<IndexBuilder, Pair<StorageAdapter, Closeable>> finisher, boolean cnf, boolean optimize ) { super( testName, ROWS, indexBuilder.schema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(PARSER.getParseSpec().getDimensionsSpec()) .build() ), finisher, cnf, optimize ); }
private IncrementalIndex makeIncIndex(boolean withRollup) { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(new DimensionsSpec( Arrays.asList( new StringDimensionSchema("dimA"), new LongDimensionSchema("metA") ), null, null )) .withRollup(withRollup) .build() ) .setReportParseExceptions(false) .setConcurrentEventAdd(true) .setMaxRowCount(1000) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(new DimensionsSpec( Arrays.asList( new StringDimensionSchema("dimA"), new StringDimensionSchema("dimB"), new LongDimensionSchema("metA"), new LongDimensionSchema("metB") ), null, null )) .build() ) .setReportParseExceptions(false) .setConcurrentEventAdd(true) .setMaxRowCount(1000) .buildOnheap(); }
public LongFilteringTest( String testName, IndexBuilder indexBuilder, Function<IndexBuilder, Pair<StorageAdapter, Closeable>> finisher, boolean cnf, boolean optimize ) { super( testName, ROWS, indexBuilder.schema( new IncrementalIndexSchema.Builder() .withMetrics(new LongSumAggregatorFactory(LONG_COLUMN, LONG_COLUMN)) .build() ), finisher, cnf, optimize ); }
public ExpressionFilterTest( String testName, IndexBuilder indexBuilder, Function<IndexBuilder, Pair<StorageAdapter, Closeable>> finisher, boolean cnf, boolean optimize ) { super( testName, ROWS, indexBuilder.schema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(PARSER.getParseSpec().getDimensionsSpec()).build() ), finisher, cnf, optimize ); }
public SelectorFilterTest( String testName, IndexBuilder indexBuilder, Function<IndexBuilder, Pair<StorageAdapter, Closeable>> finisher, boolean cnf, boolean optimize ) { super( testName, ROWS, indexBuilder.schema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(PARSER.getParseSpec().getDimensionsSpec()).build() ), finisher, cnf, optimize ); }
public static IncrementalIndex createIndex( AggregatorFactory[] aggregatorFactories, DimensionsSpec dimensionsSpec ) { if (null == aggregatorFactories) { aggregatorFactories = defaultAggregatorFactories; } return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(dimensionsSpec) .withMetrics(aggregatorFactories) .build() ) .setMaxRowCount(1000000) .buildOnheap(); }
private IncrementalIndex makeIncIndex(boolean withRollup) { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withMetrics(schemaInfo.getAggsArray()) .withRollup(withRollup) .build() ) .setReportParseExceptions(false) .setConcurrentEventAdd(true) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withMetrics(schemaInfo.getAggsArray()) .withRollup(rollup) .build() ) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withMetrics(schemaInfo.getAggsArray()) .withRollup(rollup) .build() ) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private static IncrementalIndex newIndex(String minTimeStamp, int maxRowCount) { final IncrementalIndexSchema schema = new IncrementalIndexSchema.Builder() .withMinTimestamp(DateTimes.of(minTimeStamp).getMillis()) .withQueryGranularity(Granularities.HOUR) .withMetrics(TestIndex.METRIC_AGGS) .build(); return new IncrementalIndex.Builder() .setIndexSchema(schema) .setMaxRowCount(maxRowCount) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withMetrics(schemaInfo.getAggsArray()) .withRollup(rollup) .build() ) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment) .buildOnheap(); }
private IncrementalIndex makeIncIndex() { return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withMetrics(schemaInfo.getAggsArray()) .withRollup(rollup) .build() ) .setReportParseExceptions(false) .setMaxRowCount(rowsPerSegment * 2) .buildOnheap(); }
private IncrementalIndex getIndexWithDims(List<String> dims) { IncrementalIndexSchema schema = new IncrementalIndexSchema.Builder() .withDimensionsSpec(new DimensionsSpec(makeDimensionSchemas(dims), null, null)) .withMetrics(new CountAggregatorFactory("count")) .build(); return new IncrementalIndex.Builder() .setIndexSchema(schema) .setMaxRowCount(1000) .buildOnheap(); }
private IncrementalIndex getIndexWithDimsFromSchemata(List<DimensionSchema> dims) { IncrementalIndexSchema schema = new IncrementalIndexSchema.Builder() .withDimensionsSpec(new DimensionsSpec(dims, null, null)) .withMetrics(new CountAggregatorFactory("count")) .build(); return new IncrementalIndex.Builder() .setIndexSchema(schema) .setMaxRowCount(1000) .buildOnheap(); }
private static IndexBuilder overrideIndexBuilderSchema(IndexBuilder indexBuilder) { IncrementalIndexSchema schema = new IncrementalIndexSchema.Builder() .withMetrics( new CountAggregatorFactory("count"), new HyperUniquesAggregatorFactory("hyperion", "dim1"), new DoubleMaxAggregatorFactory("dmax", "dim0") ).build(); return indexBuilder.schema(schema); }