private void rehash() { // Expand the hashmap int newCapacity = capacity * 2; long[] newTable = new long[newCapacity]; Arrays.fill(newTable, EmptyItem); // Re-hash table for (int i = 0; i < table.length; i++) { long storedItem = table[i]; if (storedItem != EmptyItem && storedItem != DeletedItem) { insertKeyValueNoLock(newTable, newCapacity, storedItem); } } table = newTable; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * SetFillFactor); }
private void rehash() { // Expand the hashmap int newCapacity = capacity * 2; long[] newTable = new long[newCapacity]; Arrays.fill(newTable, EmptyItem); // Re-hash table for (int i = 0; i < table.length; i++) { long storedItem = table[i]; if (storedItem != EmptyItem && storedItem != DeletedItem) { insertKeyValueNoLock(newTable, newCapacity, storedItem); } } table = newTable; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * SetFillFactor); }
private void rehash() { // Expand the hashmap int newCapacity = capacity * 2; long[] newTable = new long[newCapacity]; Arrays.fill(newTable, EmptyItem); // Re-hash table for (int i = 0; i < table.length; i++) { long storedItem = table[i]; if (storedItem != EmptyItem && storedItem != DeletedItem) { insertKeyValueNoLock(newTable, newCapacity, storedItem); } } table = newTable; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * SetFillFactor); }
private void rehash() { // Expand the hashmap int newCapacity = capacity * 2; long[] newTable = new long[newCapacity]; Arrays.fill(newTable, EmptyItem); // Re-hash table for (int i = 0; i < table.length; i++) { long storedItem = table[i]; if (storedItem != EmptyItem && storedItem != DeletedItem) { insertKeyValueNoLock(newTable, newCapacity, storedItem); } } table = newTable; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * SetFillFactor); }
private void rehash() { // Expand the hashmap int newCapacity = capacity * 2; long[] newTable = new long[newCapacity]; Arrays.fill(newTable, EmptyItem); // Re-hash table for (int i = 0; i < table.length; i++) { long storedItem = table[i]; if (storedItem != EmptyItem && storedItem != DeletedItem) { insertKeyValueNoLock(newTable, newCapacity, storedItem); } } table = newTable; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * SetFillFactor); }
private void rehash() { // Expand the hashmap int newCapacity = capacity * 2; long[] newTable = new long[newCapacity]; Arrays.fill(newTable, EmptyItem); // Re-hash table for (int i = 0; i < table.length; i++) { long storedItem = table[i]; if (storedItem != EmptyItem && storedItem != DeletedItem) { insertKeyValueNoLock(newTable, newCapacity, storedItem); } } table = newTable; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * SetFillFactor); }
private void rehash() { // Expand the hashmap int newCapacity = capacity * 2; long[] newTable = new long[newCapacity]; Arrays.fill(newTable, EmptyItem); // Re-hash table for (int i = 0; i < table.length; i++) { long storedItem = table[i]; if (storedItem != EmptyItem && storedItem != DeletedItem) { insertKeyValueNoLock(newTable, newCapacity, storedItem); } } table = newTable; usedBuckets = size; CAPACITY_UPDATER.lazySet(this, newCapacity); resizeThreshold = (int) (newCapacity * SetFillFactor); }