final StateTableEntry<K, N, S>[] copy = new StateTableEntry[copiedArraySize]; if (isRehashing()) {
/** * Doubles the capacity of the hash table. Existing entries are placed in * the correct bucket on the enlarged table. If the current capacity is, * MAXIMUM_CAPACITY, this method is a no-op. Returns the table, which * will be new unless we were already at MAXIMUM_CAPACITY. */ private void doubleCapacity() { // There can only be one rehash in flight. From the amount of incremental rehash steps we take, this should always hold. Preconditions.checkState(!isRehashing(), "There is already a rehash in progress."); StateTableEntry<K, N, S>[] oldTable = primaryTable; int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { return; } incrementalRehashTable = makeTable(oldCapacity * 2); }
/** * Doubles the capacity of the hash table. Existing entries are placed in * the correct bucket on the enlarged table. If the current capacity is, * MAXIMUM_CAPACITY, this method is a no-op. Returns the table, which * will be new unless we were already at MAXIMUM_CAPACITY. */ private void doubleCapacity() { // There can only be one rehash in flight. From the amount of incremental rehash steps we take, this should always hold. Preconditions.checkState(!isRehashing(), "There is already a rehash in progress."); StateTableEntry<K, N, S>[] oldTable = primaryTable; int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { return; } incrementalRehashTable = makeTable(oldCapacity * 2); }
/** * Doubles the capacity of the hash table. Existing entries are placed in * the correct bucket on the enlarged table. If the current capacity is, * MAXIMUM_CAPACITY, this method is a no-op. Returns the table, which * will be new unless we were already at MAXIMUM_CAPACITY. */ private void doubleCapacity() { // There can only be one rehash in flight. From the amount of incremental rehash steps we take, this should always hold. Preconditions.checkState(!isRehashing(), "There is already a rehash in progress."); StateTableEntry<K, N, S>[] oldTable = primaryTable; int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { return; } incrementalRehashTable = makeTable(oldCapacity * 2); }
/** * Doubles the capacity of the hash table. Existing entries are placed in * the correct bucket on the enlarged table. If the current capacity is, * MAXIMUM_CAPACITY, this method is a no-op. Returns the table, which * will be new unless we were already at MAXIMUM_CAPACITY. */ private void doubleCapacity() { // There can only be one rehash in flight. From the amount of incremental rehash steps we take, this should always hold. Preconditions.checkState(!isRehashing(), "There is already a rehash in progress."); StateTableEntry<K, N, S>[] oldTable = primaryTable; int oldCapacity = oldTable.length; if (oldCapacity == MAXIMUM_CAPACITY) { return; } incrementalRehashTable = makeTable(oldCapacity * 2); }
/** * Computes the hash for the composite of key and namespace and performs some steps of incremental rehash if * incremental rehashing is in progress. */ private int computeHashForOperationAndDoIncrementalRehash(K key, N namespace) { checkKeyNamespacePreconditions(key, namespace); if (isRehashing()) { incrementalRehash(); } return compositeHash(key, namespace); }
final StateTableEntry<K, N, S>[] copy = new StateTableEntry[copiedArraySize]; if (isRehashing()) {
/** * Computes the hash for the composite of key and namespace and performs some steps of incremental rehash if * incremental rehashing is in progress. */ private int computeHashForOperationAndDoIncrementalRehash(K key, N namespace) { checkKeyNamespacePreconditions(key, namespace); if (isRehashing()) { incrementalRehash(); } return compositeHash(key, namespace); }
/** * Computes the hash for the composite of key and namespace and performs some steps of incremental rehash if * incremental rehashing is in progress. */ private int computeHashForOperationAndDoIncrementalRehash(K key, N namespace) { checkKeyNamespacePreconditions(key, namespace); if (isRehashing()) { incrementalRehash(); } return compositeHash(key, namespace); }
/** * Computes the hash for the composite of key and namespace and performs some steps of incremental rehash if * incremental rehashing is in progress. */ private int computeHashForOperationAndDoIncrementalRehash(K key, N namespace) { checkKeyNamespacePreconditions(key, namespace); if (isRehashing()) { incrementalRehash(); } return compositeHash(key, namespace); }