public ConcurrentLongHashMap(int expectedItems, int numSections) { checkArgument(numSections > 0); if (expectedItems < numSections) { expectedItems = numSections; } int perSectionExpectedItems = expectedItems / numSections; int perSectionCapacity = (int) (perSectionExpectedItems / MapFillFactor); this.sections = (Section<V>[]) new Section[numSections]; for (int i = 0; i < numSections; i++) { sections[i] = new Section<>(perSectionCapacity); } }
public void clear() { for (Section<V> s : sections) { s.clear(); } }
public void forEach(EntryProcessor<V> processor) { for (Section<V> s : sections) { s.forEach(processor); } }
int bucket = keyHash; long stamp = writeLock(); int capacity = this.capacity; if (usedBuckets > resizeThreshold) { try { rehash(); } finally { unlockWrite(stamp); unlockWrite(stamp);
int bucket = keyHash; long stamp = writeLock(); int capacity = this.capacity; if (usedBuckets > resizeThreshold) { try { rehash(); } finally { unlockWrite(stamp); unlockWrite(stamp);
int bucket = keyHash; long stamp = writeLock(); int capacity = this.capacity; if (usedBuckets > resizeThreshold) { try { rehash(); } finally { unlockWrite(stamp); unlockWrite(stamp);
int bucket = keyHash; long stamp = writeLock(); int capacity = this.capacity; if (usedBuckets > resizeThreshold) { try { rehash(); } finally { unlockWrite(stamp); unlockWrite(stamp);
int bucket = keyHash; long stamp = writeLock(); int capacity = this.capacity; if (usedBuckets > resizeThreshold) { try { rehash(); } finally { unlockWrite(stamp); unlockWrite(stamp);
int bucket = keyHash; long stamp = writeLock(); int capacity = this.capacity; if (usedBuckets > resizeThreshold) { try { rehash(); } finally { unlockWrite(stamp); unlockWrite(stamp);
int bucket = keyHash; long stamp = tryOptimisticRead(); boolean acquiredLock = false; V storedValue = values[bucket]; if (!acquiredLock && validate(stamp)) { stamp = readLock(); acquiredLock = true; storedKey = keys[bucket]; unlockRead(stamp);
int bucket = keyHash; long stamp = tryOptimisticRead(); boolean acquiredLock = false; V storedValue = values[bucket]; if (!acquiredLock && validate(stamp)) { stamp = readLock(); acquiredLock = true; storedKey = keys[bucket]; unlockRead(stamp);
int bucket = keyHash; long stamp = tryOptimisticRead(); boolean acquiredLock = false; V storedValue = values[bucket]; if (!acquiredLock && validate(stamp)) { stamp = readLock(); acquiredLock = true; storedKey = keys[bucket]; unlockRead(stamp);
int bucket = keyHash; long stamp = tryOptimisticRead(); boolean acquiredLock = false; V storedValue = values[bucket]; if (!acquiredLock && validate(stamp)) { stamp = readLock(); acquiredLock = true; storedKey = keys[bucket]; unlockRead(stamp);
int bucket = keyHash; long stamp = tryOptimisticRead(); boolean acquiredLock = false; V storedValue = values[bucket]; if (!acquiredLock && validate(stamp)) { stamp = readLock(); acquiredLock = true; storedKey = keys[bucket]; unlockRead(stamp);
int bucket = keyHash; long stamp = tryOptimisticRead(); boolean acquiredLock = false; V storedValue = values[bucket]; if (!acquiredLock && validate(stamp)) { stamp = readLock(); acquiredLock = true; storedKey = keys[bucket]; unlockRead(stamp);
public void forEach(EntryProcessor<V> processor) { long stamp = tryOptimisticRead(); if (!validate(stamp)) { stamp = readLock(); acquiredReadLock = true; V storedValue = values[bucket]; if (!acquiredReadLock && !validate(stamp)) { stamp = readLock(); acquiredReadLock = true; unlockRead(stamp);
public void forEach(EntryProcessor<V> processor) { long stamp = tryOptimisticRead(); if (!validate(stamp)) { stamp = readLock(); acquiredReadLock = true; V storedValue = values[bucket]; if (!acquiredReadLock && !validate(stamp)) { stamp = readLock(); acquiredReadLock = true; unlockRead(stamp);
public void forEach(EntryProcessor<V> processor) { long stamp = tryOptimisticRead(); if (!validate(stamp)) { stamp = readLock(); acquiredReadLock = true; V storedValue = values[bucket]; if (!acquiredReadLock && !validate(stamp)) { stamp = readLock(); acquiredReadLock = true; unlockRead(stamp);
public void forEach(EntryProcessor<V> processor) { long stamp = tryOptimisticRead(); if (!validate(stamp)) { stamp = readLock(); acquiredReadLock = true; V storedValue = values[bucket]; if (!acquiredReadLock && !validate(stamp)) { stamp = readLock(); acquiredReadLock = true; unlockRead(stamp);
public void forEach(EntryProcessor<V> processor) { long stamp = tryOptimisticRead(); if (!validate(stamp)) { stamp = readLock(); acquiredReadLock = true; V storedValue = values[bucket]; if (!acquiredReadLock && !validate(stamp)) { stamp = readLock(); acquiredReadLock = true; unlockRead(stamp);