Package org.roaringbitmap.buffer
Class BufferParallelAggregation
java.lang.Object
org.roaringbitmap.buffer.BufferParallelAggregation
These utility methods provide parallel implementations of
logical aggregation operators. AND is not implemented
because it is unlikely to be profitable.
There is a temporary memory overhead in using these methods,
since a materialisation of the rotated containers grouped by key
is created in each case.
Each method executes on the default fork join pool by default.
If this is undesirable (it usually is) wrap the call inside
a submission of a runnable to your own thread pool.
//...
ExecutorService executor = ...
ImmutableRoaringBitmap[] bitmaps = ...
// executes on executors threads
MutableRoaringBitmap result = executor.submit(
() -> BufferParallelAggregation.or(bitmaps)).get();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Collects containers grouped by their key into a RoaringBitmap, applying the supplied aggregation function to each group.static class
Collects a list of containers into a single container. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic SortedMap<Character,
List<MappeableContainer>> groupByKey
(ImmutableRoaringBitmap... bitmaps) Groups the containers by their keysstatic MutableRoaringBitmap
or
(ImmutableRoaringBitmap... bitmaps) Computes the bitwise union of the input bitmapsstatic MutableRoaringBitmap
xor
(ImmutableRoaringBitmap... bitmaps) Computes the bitwise symmetric difference of the input bitmaps
-
Constructor Details
-
BufferParallelAggregation
public BufferParallelAggregation()
-
-
Method Details
-
groupByKey
public static SortedMap<Character,List<MappeableContainer>> groupByKey(ImmutableRoaringBitmap... bitmaps) Groups the containers by their keys- Parameters:
bitmaps
- input bitmaps- Returns:
- The containers from the bitmaps grouped by key
-
or
Computes the bitwise union of the input bitmaps- Parameters:
bitmaps
- the input bitmaps- Returns:
- the union of the bitmaps
-
xor
Computes the bitwise symmetric difference of the input bitmaps- Parameters:
bitmaps
- the input bitmaps- Returns:
- the symmetric difference of the bitmaps
-