mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Remove double and triple blank lines
This commit is contained in:
@@ -173,7 +173,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
|
||||
final SelectionKey[] keys = selectedKeys.flip();
|
||||
|
||||
|
||||
try {
|
||||
for (int i = 0; i < keys.length && keys[i] != null; i++) {
|
||||
final SelectionKey key = keys[i];
|
||||
@@ -289,7 +288,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
return selector.select(selectorTimeout);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* checks that we receive heartbeats and send out heart beats.
|
||||
*
|
||||
@@ -411,7 +409,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
closeEarlyAndQuietly(key.channel());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* called when the selector receives a OP_CONNECT message
|
||||
*/
|
||||
@@ -491,7 +488,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
closeables.add(channel);
|
||||
}
|
||||
|
||||
|
||||
channel.configureBlocking(false);
|
||||
channel.socket().setReuseAddress(true);
|
||||
channel.socket().setTcpNoDelay(true);
|
||||
@@ -542,7 +538,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
|
||||
if (attached.remoteIdentifier == Byte.MIN_VALUE) {
|
||||
|
||||
|
||||
final byte remoteIdentifier = reader.identifierFromBuffer();
|
||||
|
||||
if (remoteIdentifier == STATELESS_CLIENT) {
|
||||
@@ -584,7 +579,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
LOG.debug("handshaking for localIdentifier=" + localIdentifier + "," +
|
||||
"remoteIdentifier=" + remoteIdentifier);
|
||||
|
||||
|
||||
attached.remoteModificationIterator = replica.acquireModificationIterator(remoteIdentifier,
|
||||
attached);
|
||||
|
||||
@@ -791,7 +785,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
SelectableChannel doConnect() throws
|
||||
IOException, InterruptedException {
|
||||
|
||||
|
||||
final ServerSocketChannel serverChannel = openServerSocketChannel();
|
||||
|
||||
serverChannel.socket().setReceiveBufferSize(BUFFER_SIZE);
|
||||
@@ -805,7 +798,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
closeables.add(serverSocket);
|
||||
}
|
||||
|
||||
|
||||
serverSocket.setReuseAddress(true);
|
||||
|
||||
serverSocket.bind(details.address());
|
||||
@@ -840,7 +832,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
this.details = details;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ClientConnector{" + details + '}';
|
||||
@@ -909,7 +900,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -954,7 +944,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
TcpReplicator.this.opWriteUpdater.set(remoteIdentifier);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -984,7 +973,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
uncompletedWork = null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* writes the timestamp into the buffer
|
||||
*
|
||||
@@ -1062,7 +1050,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
int size = (int) in.position();
|
||||
out.limit(size);
|
||||
|
||||
|
||||
final int len = socketChannel.write(out);
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
@@ -1099,7 +1086,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
in.writeLong(localHeartbeatInterval);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* removes back in the OP_WRITE from the selector, otherwise it'll spin loop. The OP_WRITE
|
||||
* will get added back in as soon as we have data to write
|
||||
@@ -1126,7 +1112,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean doWork() {
|
||||
return uncompletedWork.doWork(in);
|
||||
}
|
||||
@@ -1147,7 +1132,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
private long sizeInBytes;
|
||||
private byte state;
|
||||
|
||||
|
||||
private TcpSocketChannelEntryReader() {
|
||||
in = ByteBuffer.allocateDirect(replicationConfig.packetSize() + maxEntrySizeBytes);
|
||||
out = new ByteBufferBytes(in.slice());
|
||||
@@ -1155,7 +1139,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
in.clear();
|
||||
}
|
||||
|
||||
|
||||
void resizeBuffer(long size) {
|
||||
|
||||
assert size < Integer.MAX_VALUE;
|
||||
@@ -1165,7 +1148,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
|
||||
final ByteBuffer buffer = ByteBuffer.allocateDirect((int) size).order(ByteOrder.nativeOrder());
|
||||
|
||||
|
||||
final int inPosition = in.position();
|
||||
|
||||
long outPosition = out.position();
|
||||
@@ -1293,7 +1275,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* compacts the buffer and updates the {@code in} and {@code out} accordingly
|
||||
*/
|
||||
@@ -1351,7 +1332,6 @@ class StatelessServerConnector<K, V> {
|
||||
public static final int SIZE_OF_IS_EXCEPTION = 1;
|
||||
public static final int HEADER_SIZE = SIZE_OF_SIZE + SIZE_OF_IS_EXCEPTION + SIZE_OF_TRANSACTION_ID;
|
||||
|
||||
|
||||
private final ReaderWithSize<K> keyReaderWithSize;
|
||||
private final WriterWithSize<K> keyWriterWithSize;
|
||||
private final ReaderWithSize<V> valueReaderWithSize;
|
||||
@@ -1359,7 +1339,6 @@ class StatelessServerConnector<K, V> {
|
||||
private final VanillaChronicleMap<K, ?, ?, V, ?, ?> map;
|
||||
private double maxEntrySizeBytes;
|
||||
|
||||
|
||||
StatelessServerConnector(
|
||||
SerializationBuilder<K> keySerializationBuilder,
|
||||
SerializationBuilder<V> valueSerializationBuilder,
|
||||
@@ -1377,7 +1356,6 @@ class StatelessServerConnector<K, V> {
|
||||
@NotNull final Bytes writer,
|
||||
@NotNull final ByteBufferBytes reader) {
|
||||
|
||||
|
||||
final StatelessChronicleMap.EventId event = VALUES[eventId];
|
||||
|
||||
// these methods don't return a result
|
||||
@@ -1405,7 +1383,6 @@ class StatelessServerConnector<K, V> {
|
||||
|
||||
final long sizeLocation = reflectTransactionId(reader, writer);
|
||||
|
||||
|
||||
// these methods return a result
|
||||
|
||||
switch (event) {
|
||||
@@ -1468,7 +1445,6 @@ class StatelessServerConnector<K, V> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Work mapForKey(ByteBufferBytes reader, Bytes writer, long sizeLocation) {
|
||||
final K key = keyReaderWithSize.read(reader, null);
|
||||
final Function<V, ?> function = (Function<V, ?>) reader.readObject();
|
||||
@@ -1538,7 +1514,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work longSize(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
|
||||
try {
|
||||
@@ -1550,7 +1525,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work hashCode(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
|
||||
try {
|
||||
@@ -1563,7 +1537,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work toString(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
|
||||
final String str;
|
||||
@@ -1587,7 +1560,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work sendException(Bytes writer, long sizeLocation, Throwable e) {
|
||||
|
||||
// move the position to ignore any bytes written so far
|
||||
@@ -1599,7 +1571,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work isEmpty(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
|
||||
try {
|
||||
@@ -1657,7 +1628,6 @@ class StatelessServerConnector<K, V> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Work put(Bytes reader) {
|
||||
if (MAP_SUPPORTS_BYTES) {
|
||||
map.put(reader);
|
||||
@@ -1701,7 +1671,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work remove(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
try {
|
||||
if (MAP_SUPPORTS_BYTES) {
|
||||
@@ -1746,7 +1715,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work clear(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
|
||||
try {
|
||||
@@ -1759,7 +1727,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work values(Bytes reader, Bytes writer) {
|
||||
|
||||
final long transactionId = reader.readLong();
|
||||
@@ -1895,7 +1862,6 @@ class StatelessServerConnector<K, V> {
|
||||
valueWriterWithSize.writeInLoop(out, next.getValue(), valueWriter, copies);
|
||||
}
|
||||
|
||||
|
||||
writeHeader(out, sizeLocation, count, false);
|
||||
return true;
|
||||
}
|
||||
@@ -1903,7 +1869,6 @@ class StatelessServerConnector<K, V> {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private Work putIfAbsent(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
try {
|
||||
if (MAP_SUPPORTS_BYTES) {
|
||||
@@ -1922,7 +1887,6 @@ class StatelessServerConnector<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private Work replace(Bytes reader, Bytes writer, final long sizeLocation) {
|
||||
try {
|
||||
if (MAP_SUPPORTS_BYTES) {
|
||||
@@ -1976,13 +1940,11 @@ class StatelessServerConnector<K, V> {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private Work sendException(Bytes reader, Bytes writer, Throwable e) {
|
||||
final long sizeLocation = reflectTransactionId(reader, writer);
|
||||
return sendException(writer, sizeLocation, e);
|
||||
}
|
||||
|
||||
|
||||
private long header(Bytes writer, final long transactionId) {
|
||||
final long sizeLocation = writer.position();
|
||||
|
||||
@@ -2023,4 +1985,3 @@ class StatelessServerConnector<K, V> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user