mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user