public static int capacity(HashConfigWrapper conf, int size) { return capacity(conf, size, false); }
public static int capacity(HashConfigWrapper conf, int size) { return capacity(conf, size, false); }
/** For initial hash table construction and rehash to target load (shrink, tombstones purge). */ public static int capacity(HashConfigWrapper conf, int size, boolean doubleSizedArrays) { assert size >= 0 : "size must be non-negative"; return capacity(conf, size, conf.targetCapacity(size), doubleSizedArrays); }
/** For initial hash table construction and rehash to target load (shrink, tombstones purge). */ public static int capacity(HashConfigWrapper conf, int size, boolean doubleSizedArrays) { assert size >= 0 : "size must be non-negative"; return capacity(conf, size, conf.targetCapacity(size), doubleSizedArrays); }
private int targetCapacity(int size) { return QHashCapacities.capacity(configWrapper, size, doubleSizedArrays()); }
private int targetCapacity(int size) { return QHashCapacities.capacity(configWrapper, size, doubleSizedArrays()); }
private int targetCapacity(int size) { return QHashCapacities.capacity(configWrapper, size, doubleSizedArrays()); }
private int targetCapacity(int size) { return QHashCapacities.capacity(configWrapper, size, doubleSizedArrays()); }
public static long capacity(HashConfigWrapper conf, long size) { assert size >= 0L : "size must be non-negative"; long desiredCapacity = conf.targetCapacity(size); if (desiredCapacity <= (long) MAX_REGULAR_INT_CAPACITY) return (long) capacity(conf, (int) size, (int) desiredCapacity, false); if (desiredCapacity <= MAX_REGULAR_LONG_CAPACITY) { int capIndex = binarySearch(REGULAR_LONG_CAPACITIES, desiredCapacity); if (capIndex >= 0) return desiredCapacity; capIndex = ~capIndex; long lesserCapacity = capIndex > 0 ? REGULAR_LONG_CAPACITIES[capIndex - 1] : (long) MAX_REGULAR_INT_CAPACITY; long greaterCapacity = REGULAR_CHAR_CAPACITIES[capIndex]; return chooseBetter(conf, size, desiredCapacity, lesserCapacity, greaterCapacity, greaterCapacity); } return extraLargeCapacity(desiredCapacity); }
public QBlockHashTable(HashConfig config, PivotDef pivot, BufferAllocator allocator, int initialSize, int defaultVariableLengthSize, ResizeListener listener) { this.pivot = pivot; this.allocator = allocator; this.config = new HashConfigWrapper(config); this.defaultVariableLengthSize = defaultVariableLengthSize; this.fixedOnly = pivot.getVariableCount() == 0; this.listener = listener; internalInit(QHashCapacities.capacity(this.config, initialSize, false)); }
public static long capacity(HashConfigWrapper conf, long size) { assert size >= 0L : "size must be non-negative"; long desiredCapacity = conf.targetCapacity(size); if (desiredCapacity <= (long) MAX_REGULAR_INT_CAPACITY) return (long) capacity(conf, (int) size, (int) desiredCapacity, false); if (desiredCapacity <= MAX_REGULAR_LONG_CAPACITY) { int capIndex = binarySearch(REGULAR_LONG_CAPACITIES, desiredCapacity); if (capIndex >= 0) return desiredCapacity; capIndex = ~capIndex; long lesserCapacity = capIndex > 0 ? REGULAR_LONG_CAPACITIES[capIndex - 1] : (long) MAX_REGULAR_INT_CAPACITY; long greaterCapacity = REGULAR_CHAR_CAPACITIES[capIndex]; return chooseBetter(conf, size, desiredCapacity, lesserCapacity, greaterCapacity, greaterCapacity); } return extraLargeCapacity(desiredCapacity); }