mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-216 added removeLater
This commit is contained in:
@@ -155,6 +155,18 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Future<V> removeLater(@NotNull final K key) {
|
||||
return lazyExecutorService().submit(new Callable<V>() {
|
||||
@Override
|
||||
public V call() throws Exception {
|
||||
|
||||
V oldValue = StatelessChronicleMap.this.remove(key);
|
||||
return oldValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private ExecutorService lazyExecutorService() {
|
||||
|
||||
@@ -485,7 +497,7 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
if (key == null)
|
||||
throw new NullPointerException("key can not be null");
|
||||
|
||||
final long sizeLocation = (removeReturnsNull) ? writeEvent(REMOVE_WITHOUT_ACC) : writeEventAnSkip(REMOVE);
|
||||
final long sizeLocation = removeReturnsNull ? writeEvent(REMOVE_WITHOUT_ACC) : writeEventAnSkip(REMOVE);
|
||||
|
||||
|
||||
writeKey((K) key);
|
||||
|
||||
Reference in New Issue
Block a user