DOC-14 Stateless Client : enhancing the synchronous writes so we don't need a thread local client for each thread

This commit is contained in:
Rob Austin
2014-11-24 08:29:44 +00:00
parent 5fb243e301
commit a5fe252478
7 changed files with 92 additions and 21 deletions
@@ -26,6 +26,7 @@ import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Future;
/**
* @author Rob Austin.
@@ -254,6 +255,11 @@ public class ReplicationCheckingMap<K, V> implements ChronicleMap<K, V> {
return map1.updateForKey(key, mutator);
}
@Override
public Future<V> getLater(K key) {
throw new UnsupportedOperationException();
}
@Override
public V acquireUsing(@NotNull K key, V usingValue) {
return map1.acquireUsing(key, usingValue);
@@ -233,7 +233,7 @@ public class StatelessClientTest {
@Test
public void testStringKeyMap() throws IOException, InterruptedException {
public void testServerPutStringKeyMap() throws IOException, InterruptedException {
try (ChronicleMap<String, Map> serverMap = ChronicleMapBuilder.of(String.class, Map
.class)
@@ -259,7 +259,7 @@ public class StatelessClientTest {
@Test
public void testStringKeyMapPutIntoStatelesMap() throws IOException, InterruptedException {
public void testStringKeyMapPutIntoStatelessMap() throws IOException, InterruptedException {
final Map<String, String> data = new HashMap<String, String>();
@@ -31,6 +31,7 @@ import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.concurrent.Future;
import static org.junit.Assert.*;
@@ -176,6 +177,11 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
return d.updateForKey(key, mutator);
}
@Override
public Future<V> getLater(K key) {
return d.getLater(key);
}
@Override
public V putIfAbsent(K key, V value) {
return d.putIfAbsent(key, value);