Skip to content

Commit

Permalink
Merge pull request apache#1541 from himanshug/fix_agg_test_helper
Browse files Browse the repository at this point in the history
dont waste memory in storing all lines from input
  • Loading branch information
fjy committed Jul 21, 2015
2 parents 9724235 + d11d9b6 commit ce5de2b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import io.druid.segment.incremental.IncrementalIndex;
import io.druid.segment.incremental.OnheapIncrementalIndex;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -156,8 +157,7 @@ public void createIndex(
{
StringInputRowParser parser = mapper.readValue(parserJson, StringInputRowParser.class);

CharSource cs = Files.asCharSource(inputDataFile, Charset.defaultCharset());
Iterator<String> iter = cs.readLines().iterator();
LineIterator iter = FileUtils.lineIterator(inputDataFile, "UTF-8");

List<AggregatorFactory> aggregatorSpecs = mapper.readValue(
aggregators,
Expand Down

0 comments on commit ce5de2b

Please sign in to comment.