public static long capacity(HashConfigWrapper conf, long size) { return capacity(conf, size, false); }
public static long capacity(HashConfigWrapper conf, long size) { return capacity(conf, size, false); }
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); }
private int targetCapacity(int size) { return LHashCapacities.capacity(configWrapper, size, doubleSizedArrays()); }
private int targetCapacity(int size) { return LHashCapacities.capacity(configWrapper, size, doubleSizedArrays()); }
private int targetCapacity(int size) { return LHashCapacities.capacity(configWrapper, size, doubleSizedArrays()); }
private boolean tryRehashForExpansion() { int newCapacity = LHashCapacities.capacity(config, capacity(), false); if (newCapacity > capacity()) { rehashTimer.start(); rehash(newCapacity); rehashCount++; rehashTimer.stop(); return true; } else { return false; } }
final void postInsertHook() { if (++size > maxSize) { /* if LHash hash */ int capacity = capacity(); if (!isMaxCapacity(capacity)) { rehash(capacity << 1); } /* elif !(LHash hash) */ tryRehashForExpansion(grownCapacity()); /* endif */ } }
public LBlockHashTableEight(HashConfig config, BufferAllocator allocator, int initialSize) { this.allocator = allocator; this.config = new HashConfigWrapper(config); internalInit(LHashCapacities.capacity(this.config, initialSize, false)); }
private boolean tryRehashForExpansion() { int newCapacity = LHashCapacities.capacity(config, capacity(), false); if (newCapacity > capacity()) { rehashTimer.start(); rehash(newCapacity); rehashCount++; rehashTimer.stop(); return true; } else { return false; } }
final void postInsertHook() { if (++size > maxSize) { /* if LHash hash */ int capacity = capacity(); if (!isMaxCapacity(capacity)) { rehash(capacity << 1); } /* elif !(LHash hash) */ tryRehashForExpansion(grownCapacity()); /* endif */ } }
public LBlockHashTableNoSpill(HashConfig config, PivotDef pivot, BufferAllocator allocator, int initialSize, int defaultVariableLengthSize, ResizeListenerNoSpill listener) { this.pivot = pivot; this.allocator = allocator; this.config = new HashConfigWrapper(config); this.defaultVariableLengthSize = defaultVariableLengthSize; this.fixedOnly = pivot.getVariableCount() == 0; this.listener = listener; internalInit(LHashCapacities.capacity(this.config, initialSize, false)); }
private void tryRehashForExpansion() { int newCapacity = LHashCapacities.capacity(config, capacity(), false); if (newCapacity > capacity()) { try { rehashTimer.start(); rehash(newCapacity); rehashCount++; } finally { rehashTimer.stop(); } } else { throw new HashTableMaxCapacityReachedException(capacity()); } }
public LBlockHashTable(HashConfig config, PivotDef pivot, BufferAllocator allocator, int initialSize, int defaultVariableLengthSize, boolean enforceVarWidthBufferLimit, ResizeListener listener, final int maxHashTableBatchSize) { this.pivot = pivot; this.allocator = allocator; this.config = new HashConfigWrapper(config); this.fixedOnly = pivot.getVariableCount() == 0; this.enforceVarWidthBufferLimit = enforceVarWidthBufferLimit; this.listener = listener; /* maximum records that can be stored in hashtable block/chunk */ this.MAX_VALUES_PER_BATCH = maxHashTableBatchSize; this.variableBlockMaxLength = (pivot.getVariableCount() == 0) ? 0 : (MAX_VALUES_PER_BATCH * (((defaultVariableLengthSize + VAR_OFFSET_SIZE) * pivot.getVariableCount()) + VAR_LENGTH_SIZE)); this.preallocatedSingleBatch = false; this.allocatedForFixedBlocks = 0; this.allocatedForVarBlocks = 0; this.unusedForFixedBlocks = 0; this.unusedForVarBlocks = 0; internalInit(LHashCapacities.capacity(this.config, initialSize, false)); logger.debug("initialized hashtable, maxSize:{}, capacity:{}, batches:{}, maxVariableBlockLength:{}, maxValuesPerBatch:{}", maxSize, capacity, batches, variableBlockMaxLength, MAX_VALUES_PER_BATCH); }