HCOLL-329 fixing the bootstrapping timestamp issue

Conflicts:
	src/main/java/net/openhft/chronicle/map/ChannelProvider.java
	src/main/java/net/openhft/chronicle/map/Replica.java
	src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java
	src/main/java/net/openhft/chronicle/map/SharedSegment.java
	src/main/java/net/openhft/chronicle/map/TcpReplicator.java
	src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java
This commit is contained in:
Rob Austin
2015-07-25 22:33:24 +03:00
committed by leventov
parent da06ba106e
commit fcd872c643
9 changed files with 110 additions and 43 deletions
@@ -1282,6 +1282,7 @@ public final class TcpReplicator<K, V> extends AbstractChannelReplicator impleme
*/
class TcpSocketChannelEntryReader {
public static final int HEADROOM = 1024;
public static final int SIZE_OF_BOOTSTRAP_TIMESTAMP = 8;
public long lastHeartBeatReceived = System.currentTimeMillis();
ByteBuffer in;
ByteBufferBytes out;
@@ -1367,7 +1368,8 @@ public final class TcpReplicator<K, V> extends AbstractChannelReplicator impleme
// if the buffer is too small to read this payload we will have to grow the
// size of the buffer
long requiredSize = sizeInBytes + SIZE_OF_SIZE + 1;
long requiredSize = sizeInBytes + SIZE_OF_SIZE + 1 +
SIZE_OF_BOOTSTRAP_TIMESTAMP;
if (out.capacity() < requiredSize) {
attached.entryReader.resizeBuffer(requiredSize + HEADROOM);
}