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:
@@ -37,6 +37,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import static java.nio.ByteBuffer.allocateDirect;
|
||||
import static net.openhft.chronicle.map.AbstractChannelReplicator.SIZE_OF_SIZE;
|
||||
@@ -392,6 +393,10 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
|
||||
return blockingFetch(writeEventAnSkip(LONG_SIZE)).readLong();
|
||||
}
|
||||
|
||||
public synchronized Future<V> getLater(K key) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
public synchronized V get(Object key) {
|
||||
final long sizeLocation = writeEventAnSkip(GET);
|
||||
@@ -951,8 +956,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
|
||||
|
||||
private Bytes blockingFetch(long timeoutTime, long transactionId) throws IOException {
|
||||
|
||||
// bytes.buffer().position(0);
|
||||
|
||||
// the number of bytes in the response
|
||||
final int size = receive(SIZE_OF_SIZE, timeoutTime).readInt();
|
||||
|
||||
@@ -979,7 +982,7 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
|
||||
", does not match the expected transaction-id=" + transactionId);
|
||||
|
||||
if (isException) {
|
||||
Throwable throwable = (Throwable) bytes.readObject();
|
||||
Throwable throwable = (Throwable) bytes.readObject();
|
||||
try {
|
||||
Field stackTrace = Throwable.class.getDeclaredField("stackTrace");
|
||||
stackTrace.setAccessible(true);
|
||||
|
||||
Reference in New Issue
Block a user