Package jetbrains.buildServer.util
Class CompactArrayOfLongs
- java.lang.Object
-
- jetbrains.buildServer.util.CompactArrayOfLongs
-
public abstract class CompactArrayOfLongs extends Object
This class allows to create a set of arrays from the given collection of longs. Each array will represent a part of provided longs, each part has an offset and compressed array of ints which represents data. Compression is performed with help of JavaFastPFOR library: https://github.com/lemire/JavaFastPFOR On top of the compression the arrays are also pooled, as tests show that this reduces memory usage quite a bit.- Since:
- 2020.2
-
-
Constructor Summary
Constructors Constructor Description CompactArrayOfLongs()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract long[]
array()
abstract List<Long>
asList()
static void
cleanupAndLogStatistics()
static List<CompactArrayOfLongs>
create(long[] sortedArray)
Creates a list of compact arrays out of provided sorted array of longs.abstract long
first()
abstract long
last()
abstract int
size()
-
-
-
Method Detail
-
create
@NotNull public static List<CompactArrayOfLongs> create(@NotNull long[] sortedArray)
Creates a list of compact arrays out of provided sorted array of longs. The provided array must be sorted in the ascending order (smaller values come first).- Parameters:
sortedArray
- sorted array of longs- Returns:
- list of objects which represent this array in a compressed form
-
array
@NotNull public abstract long[] array()
-
size
public abstract int size()
-
first
public abstract long first()
-
last
public abstract long last()
-
cleanupAndLogStatistics
public static void cleanupAndLogStatistics()
-
-