Merge pull request #2197 from metamx/clearIncIndexClose

Make OnHeapIncrementalIndex clean maps on close()
This commit is contained in:
Fangjin Yang 2016-01-07 15:43:47 -08:00
commit d0b10c29d7
1 changed files with 12 additions and 0 deletions

View File

@ -243,6 +243,18 @@ public class OnheapIncrementalIndex extends IncrementalIndex<Aggregator>
return concurrentGet(rowOffset)[aggOffset].get();
}
/**
* Clear out maps to allow GC
* NOTE: This is NOT thread-safe with add... so make sure all the adding is DONE before closing
*/
@Override
public void close()
{
super.close();
aggregators.clear();
facts.clear();
}
private static class OnHeapDimDim implements DimDim
{
private final Map<String, Integer> falseIds;