Workaround for non-thread-safe use of CardinalityAggregator. (#4304)

This commit is contained in:
Gian Merlino 2017-05-23 10:33:03 +09:00 committed by GitHub
parent e043bf88ec
commit 22e5f52d00
2 changed files with 5 additions and 2 deletions

View File

@ -109,7 +109,9 @@ public class CardinalityAggregator implements Aggregator
@Override
public Object get()
{
return collector;
// Workaround for non-thread-safe use of HyperLogLogCollector.
// OnheapIncrementalIndex has a penchant for calling "aggregate" and "get" simultaneously.
return HyperLogLogCollector.makeCollectorSharingStorage(collector);
}
@Override

View File

@ -55,7 +55,8 @@ public class HyperUniquesAggregator implements Aggregator
@Override
public Object get()
{
// Workaround for OnheapIncrementalIndex's penchant for calling "aggregate" and "get" simultaneously.
// Workaround for non-thread-safe use of HyperLogLogCollector.
// OnheapIncrementalIndex has a penchant for calling "aggregate" and "get" simultaneously.
return HyperLogLogCollector.makeCollectorSharingStorage(collector);
}