mirror of https://github.com/apache/druid.git
fixed createIndex
This commit is contained in:
parent
3c107c5757
commit
e0860661b1
|
@ -244,7 +244,13 @@ public class AggregationTestHelper
|
||||||
index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount);
|
index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount);
|
||||||
while (rows.hasNext()) {
|
while (rows.hasNext()) {
|
||||||
Object row = rows.next();
|
Object row = rows.next();
|
||||||
try {
|
if (!index.canAppendRow()) {
|
||||||
|
File tmp = tempFolder.newFolder();
|
||||||
|
toMerge.add(tmp);
|
||||||
|
indexMerger.persist(index, tmp, null, new IndexSpec());
|
||||||
|
index.close();
|
||||||
|
index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount);
|
||||||
|
}
|
||||||
if (row instanceof String && parser instanceof StringInputRowParser) {
|
if (row instanceof String && parser instanceof StringInputRowParser) {
|
||||||
//Note: this is required because StringInputRowParser is InputRowParser<ByteBuffer> as opposed to
|
//Note: this is required because StringInputRowParser is InputRowParser<ByteBuffer> as opposed to
|
||||||
//InputRowsParser<String>
|
//InputRowsParser<String>
|
||||||
|
@ -253,14 +259,6 @@ public class AggregationTestHelper
|
||||||
index.add(parser.parse(row));
|
index.add(parser.parse(row));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IndexSizeExceededException ex) {
|
|
||||||
File tmp = tempFolder.newFolder();
|
|
||||||
toMerge.add(tmp);
|
|
||||||
indexMerger.persist(index, tmp, null, new IndexSpec());
|
|
||||||
index.close();
|
|
||||||
index = new OnheapIncrementalIndex(minTimestamp, gran, metrics, deserializeComplexMetrics, maxRowCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (toMerge.size() > 0) {
|
if (toMerge.size() > 0) {
|
||||||
File tmp = tempFolder.newFolder();
|
File tmp = tempFolder.newFolder();
|
||||||
|
|
Loading…
Reference in New Issue