V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V getOrCompute(K key) throws ExecutionException { int hash = hash(checkNotNull(key)); return segmentFor(hash).getOrCompute(key, hash, computingFunction); }
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
ReferenceEntry<K, V> e = getEntry(key, hash); if (e != null) { V value = getLiveValue(e); if (value != null) { recordRead(e); return value; boolean createNewEntry = true; ComputingValueReference<K, V> computingValueReference = null; lock(); try { preWriteCleanup(); V value = e.getValueReference().get(); if (value == null) { enqueueNotification(entryKey, hash, value, RemovalCause.COLLECTED); } else if (map.expires() && map.isExpired(e)) { enqueueNotification(entryKey, hash, value, RemovalCause.EXPIRED); } else { recordLockedRead(e); return value; e = newEntry(key, hash, first); e.setValueReference(computingValueReference); table.set(index, e); unlock(); postWriteCleanup();
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
V oldValue = put(key, hash, value, true); if (oldValue != null) { enqueueNotification(key, hash, value, RemovalCause.REPLACED); clearValue(key, hash, computingValueReference);
@Override Segment createSegment(int initialCapacity, int maxSegmentSize) { return new ComputingSegment(initialCapacity, maxSegmentSize); }