Great refactoring

This commit is contained in:
leventov
2015-01-17 03:19:35 +07:00
parent 8a4ad9ade2
commit d897891bfb
72 changed files with 5612 additions and 6382 deletions
@@ -19,6 +19,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.hash.replication.ThrottlingConfig;
import net.openhft.chronicle.map.ReplicatedChronicleMap.BytesReplicatedContextFactory;
import net.openhft.lang.io.ByteBufferBytes;
import net.openhft.lang.io.Bytes;
import net.openhft.lang.thread.NamedThreadFactory;
@@ -75,8 +76,7 @@ abstract class AbstractChannelReplicator implements Closeable {
private final Throttler throttler;
volatile boolean isClosed = false;
ThreadLocalCopies copies;
VanillaChronicleMap.SegmentState segmentState;
ReplicatedChronicleMap.BytesReplicatedContext context;
AbstractChannelReplicator(String name, ThrottlingConfig throttlingConfig)
throws IOException {
@@ -215,8 +215,7 @@ abstract class AbstractChannelReplicator implements Closeable {
@Override
public void run() {
try {
copies = VanillaChronicleMap.SegmentState.getCopies(null);
segmentState = VanillaChronicleMap.SegmentState.get(copies);
context = VanillaContext.get(BytesReplicatedContextFactory.INSTANCE);
processEvent();
} catch (Exception e) {
LOG.error("", e);
@@ -259,10 +258,10 @@ abstract class AbstractChannelReplicator implements Closeable {
public void closeResources() {
isClosed = true;
// context.close();
executorService.shutdown();
closeables.closeQuietly();
if (segmentState != null)
segmentState.close();
}
private void dumpThreadStackTrace(long start) {
@@ -438,6 +437,7 @@ abstract class AbstractChannelReplicator implements Closeable {
}
@Override
public Bytes resizeBuffer(int size) {
if (LOG.isDebugEnabled())
@@ -466,6 +466,7 @@ abstract class AbstractChannelReplicator implements Closeable {
return in;
}
@Override
public boolean shouldBeIgnored(final Bytes entry, final int chronicleId) {
return !externalizable.identifierCheck(entry, chronicleId);
}