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:
@@ -265,6 +265,11 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Future<V> removeLater(@NotNull K key) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public V acquireUsing(@NotNull K key, V usingValue) {
|
||||
return map1.acquireUsing(key, usingValue);
|
||||
|
||||
@@ -448,6 +448,27 @@ public class StatelessClientTest {
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testRemoveLater() throws IOException,
|
||||
InterruptedException, ExecutionException {
|
||||
|
||||
try (ChronicleMap<Integer, CharSequence> serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8056)).create()) {
|
||||
|
||||
try (ChronicleMap<Integer, CharSequence> statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, CharSequence.class)
|
||||
.statelessClient(new InetSocketAddress("localhost", 8056)).create()) {
|
||||
statelessMap.put(1, "some value");
|
||||
statelessMap.removeLater(1).get();
|
||||
Assert.assertEquals(null, statelessMap.get(1));
|
||||
Assert.assertEquals(0, statelessMap.size());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testEquals() throws IOException, InterruptedException {
|
||||
|
||||
|
||||
@@ -187,6 +187,11 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
return d.putLater(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Future<V> removeLater(@NotNull K key) {
|
||||
return d.removeLater(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public V putIfAbsent(K key, V value) {
|
||||
return d.putIfAbsent(key, value);
|
||||
|
||||
Reference in New Issue
Block a user