mirror of https://github.com/apache/druid.git
dont waste memory in storing all lines from input
CharSource.readLines() reads all lines from input into a in-memory list Since we need an iterator here, so this wastage can be easily prevented
This commit is contained in:
parent
97242356b4
commit
d11d9b6c45
|
@ -62,6 +62,7 @@ import io.druid.segment.Segment;
|
||||||
import io.druid.segment.incremental.IncrementalIndex;
|
import io.druid.segment.incremental.IncrementalIndex;
|
||||||
import io.druid.segment.incremental.OnheapIncrementalIndex;
|
import io.druid.segment.incremental.OnheapIncrementalIndex;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.commons.io.LineIterator;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -156,8 +157,7 @@ public class AggregationTestHelper
|
||||||
{
|
{
|
||||||
StringInputRowParser parser = mapper.readValue(parserJson, StringInputRowParser.class);
|
StringInputRowParser parser = mapper.readValue(parserJson, StringInputRowParser.class);
|
||||||
|
|
||||||
CharSource cs = Files.asCharSource(inputDataFile, Charset.defaultCharset());
|
LineIterator iter = FileUtils.lineIterator(inputDataFile, "UTF-8");
|
||||||
Iterator<String> iter = cs.readLines().iterator();
|
|
||||||
|
|
||||||
List<AggregatorFactory> aggregatorSpecs = mapper.readValue(
|
List<AggregatorFactory> aggregatorSpecs = mapper.readValue(
|
||||||
aggregators,
|
aggregators,
|
||||||
|
|
Loading…
Reference in New Issue