HCOLL-185 refactored VanillaChronicleMap and ReplicatedChronicleMap; split BytesMapEventListener from MapEventListener; many bug fixes and optimizations; Stateless client queries without serialization/deserialization not working yet

This commit is contained in:
leventov
2014-11-28 00:05:49 +07:00
parent 38a058e3ce
commit 40a3080ac9
28 changed files with 2527 additions and 1877 deletions
@@ -22,6 +22,7 @@ import net.openhft.chronicle.hash.replication.ThrottlingConfig;
import net.openhft.lang.io.ByteBufferBytes;
import net.openhft.lang.io.Bytes;
import net.openhft.lang.thread.NamedThreadFactory;
import net.openhft.lang.threadlocal.ThreadLocalCopies;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
@@ -69,6 +70,9 @@ abstract class AbstractChannelReplicator implements Closeable {
volatile boolean isClosed = false;
ThreadLocalCopies copies;
VanillaChronicleMap.SegmentState segmentState;
AbstractChannelReplicator(String name, ThrottlingConfig throttlingConfig,
int maxEntrySizeBytes)
throws IOException {
@@ -211,6 +215,8 @@ abstract class AbstractChannelReplicator implements Closeable {
@Override
public void run() {
try {
copies = VanillaChronicleMap.SegmentState.getCopies(null);
segmentState = VanillaChronicleMap.SegmentState.get(copies);
processEvent();
} catch (Exception e) {
LOG.error("", e);
@@ -227,7 +233,7 @@ abstract class AbstractChannelReplicator implements Closeable {
executorService.shutdown();
closeables.closeQuietly();
executorService.shutdownNow();
segmentState.close();
try {
// we HAVE to be sure we have terminated before calling close() on the