mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Remove blank lines before }
This commit is contained in:
@@ -50,7 +50,6 @@ public abstract class AbstractReplication implements Serializable {
|
||||
", tcpConfig=" + tcpConfig +
|
||||
", udpConfig=" + udpConfig +
|
||||
", remoteNodeValidator=" + remoteNodeValidator;
|
||||
|
||||
}
|
||||
|
||||
public byte identifier() {
|
||||
@@ -140,7 +139,6 @@ public abstract class AbstractReplication implements Serializable {
|
||||
public String toString() {
|
||||
return ", udpConfig=" + udpConfig +
|
||||
", remoteNodeValidator=" + remoteNodeValidator;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,6 @@ public final class ReplicationHub extends AbstractReplication {
|
||||
check(identifier);
|
||||
return new ReplicationHub(identifier, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -116,11 +116,9 @@ abstract class AbstractChannelReplicator implements Closeable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
return openSelector(result, selectedKeys);
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -132,7 +130,6 @@ abstract class AbstractChannelReplicator implements Closeable {
|
||||
try {
|
||||
result = SocketChannel.open();
|
||||
result.socket().setTcpNoDelay(true);
|
||||
|
||||
} finally {
|
||||
if (result != null)
|
||||
try {
|
||||
@@ -252,7 +249,6 @@ abstract class AbstractChannelReplicator implements Closeable {
|
||||
dumpThreadStackTrace(start);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
dumpThreadStackTrace(start);
|
||||
LOG.error("", e);
|
||||
@@ -360,7 +356,6 @@ abstract class AbstractChannelReplicator implements Closeable {
|
||||
final SelectionKey selectionKey = selectableChannel.keyFor(selector);
|
||||
if (selectionKey != null)
|
||||
selectionKey.interestOps(selectionKey.interestOps() | OP_WRITE);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +522,6 @@ abstract class AbstractChannelReplicator implements Closeable {
|
||||
}
|
||||
|
||||
AbstractConnector.this.socketChannel = socketChannel;
|
||||
|
||||
} catch (Exception e) {
|
||||
closeQuietly(socketChannel);
|
||||
LOG.debug("", e);
|
||||
@@ -548,7 +542,6 @@ abstract class AbstractChannelReplicator implements Closeable {
|
||||
thread.setName(name);
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
|
||||
}
|
||||
|
||||
public void setSuccessfullyConnected() {
|
||||
|
||||
@@ -399,7 +399,6 @@ abstract class AbstractChronicleMapBuilder<K, V,
|
||||
|
||||
private int estimateSegments() {
|
||||
return (int) Math.min(Maths.nextPower2(entries / 32, 1), estimateSegementBasedOnSize());
|
||||
|
||||
}
|
||||
|
||||
private int estimateSegementBasedOnSize() {
|
||||
|
||||
@@ -365,7 +365,6 @@ final class ChannelProvider implements Closeable {
|
||||
LOG.debug("sending bootstrap message received for localIdentifier=" + localIdentifier + ", " +
|
||||
"remoteIdentifier=" + remoteIdentifier + ",chronicleChannel=" + chronicleChannel + "," +
|
||||
"lastModificationTime=" + lastModificationTime);
|
||||
|
||||
}
|
||||
} finally {
|
||||
channelDataLock.writeLock().unlock();
|
||||
@@ -463,7 +462,6 @@ final class ChannelProvider implements Closeable {
|
||||
systemModificationIteratorBitSet.set(remoteIdentifier);
|
||||
|
||||
return iterator;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -539,6 +537,5 @@ final class ChannelProvider implements Closeable {
|
||||
channelDataLock.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -361,7 +361,6 @@ public final class ChronicleMapBuilder<K, V> implements ChronicleMapBuilderI<K,
|
||||
@Override
|
||||
public ChronicleMap<K, V> create() {
|
||||
return delegate.create();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,7 +72,6 @@ public class NodeDiscovery {
|
||||
mask = null;
|
||||
}
|
||||
IP_MULIT_CAST_GROUP = mask;
|
||||
|
||||
}
|
||||
|
||||
private final DiscoveryNodeBytesMarshallable discoveryNodeBytesMarshallable;
|
||||
@@ -146,7 +145,6 @@ public class NodeDiscovery {
|
||||
}
|
||||
countDownLatch.get().countDown();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
nodeDiscoveryEventListenerAtomicReference.set(nodeDiscoveryEventListener);
|
||||
@@ -208,7 +206,6 @@ public class NodeDiscovery {
|
||||
LOG.debug("timed-out getting a response from the server so sending another boot-strap " +
|
||||
"message");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
LOG.info("looks like we are the only node in the grid, so going to use identifier=" + identifier);
|
||||
@@ -258,7 +255,6 @@ public class NodeDiscovery {
|
||||
.createWithId(identifier);
|
||||
|
||||
return new ReplicationHubFindByName(replicationHub);
|
||||
|
||||
}
|
||||
|
||||
private static Collection<InetSocketAddress> toInetSocketCollection(Set<AddressAndPort> source)
|
||||
@@ -453,7 +449,6 @@ class NodeDiscoveryBroadcaster extends UdpChannelReplicator {
|
||||
|
||||
externalizable.readMarshallable(out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class UdpSocketChannelEntryWriter implements EntryWriter {
|
||||
@@ -580,7 +575,6 @@ class KnownNodes implements BytesMarshallable {
|
||||
|
||||
activeIdentifiersBitSetBytes.clear();
|
||||
activeIdentifiersBitSetBytes.writeMarshallable(out);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -602,7 +596,6 @@ class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
|
||||
}
|
||||
|
||||
public AddressAndPort() {
|
||||
|
||||
}
|
||||
|
||||
public byte[] getAddress() {
|
||||
@@ -678,7 +671,6 @@ class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -690,7 +682,6 @@ class AddressAndPort implements Comparable<AddressAndPort>, BytesMarshallable {
|
||||
address[i] = in.readByte();
|
||||
}
|
||||
port = in.readShort();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -767,7 +758,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
|
||||
proposedIdentifiersWithHost.expireEntries(System.currentTimeMillis() - SECONDS.toMillis(1));
|
||||
|
||||
proposedIdentifiersWithHost.writeMarshallable(out);
|
||||
|
||||
}
|
||||
|
||||
private boolean writeBootstrap(Bytes out) {
|
||||
@@ -811,7 +801,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
|
||||
result.readMarshallable(in);
|
||||
|
||||
return result;
|
||||
|
||||
} finally {
|
||||
in.position(start);
|
||||
}
|
||||
@@ -868,7 +857,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
|
||||
private AddressAndPort addressAndPort;
|
||||
|
||||
public ProposedNodes() {
|
||||
|
||||
}
|
||||
|
||||
public byte identifier() {
|
||||
@@ -892,7 +880,6 @@ class DiscoveryNodeBytesMarshallable implements BytesMarshallable {
|
||||
addressAndPort.readMarshallable(in);
|
||||
timestamp = in.readLong();
|
||||
identifier = in.readByte();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -989,7 +976,6 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
|
||||
} catch (Exception e) {
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1110,7 +1096,6 @@ class ConcurrentExpiryMap<K extends BytesMarshallable, V extends BytesMarshallab
|
||||
return null;
|
||||
|
||||
return networkInterfaces.nextElement();
|
||||
|
||||
}
|
||||
|
||||
public static InetAddress getDefaultAddress() throws SocketException {
|
||||
|
||||
@@ -145,7 +145,6 @@ interface Replica extends Closeable {
|
||||
void readExternalEntry(
|
||||
@NotNull ThreadLocalCopies copies,
|
||||
@NotNull VanillaChronicleMap.SegmentState segmentState, @NotNull Bytes source);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -173,7 +172,6 @@ interface Replica extends Closeable {
|
||||
V value(@NotNull Bytes entry, V usingValue);
|
||||
|
||||
boolean wasRemoved(@NotNull Bytes entry);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -114,7 +114,6 @@ final class ReplicatedChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? supe
|
||||
if (localIdentifier == -1) {
|
||||
throw new IllegalStateException("localIdentifier should not be -1");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private int assignedModIterBitSetSizeInBytes() {
|
||||
@@ -528,7 +527,6 @@ final class ReplicatedChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? supe
|
||||
source.position(valuePosition);
|
||||
LOG.debug(message + "value=" + source.toString().trim() + ")");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -546,7 +544,6 @@ final class ReplicatedChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? supe
|
||||
} finally {
|
||||
entry.position(start);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -950,7 +947,6 @@ final class ReplicatedChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? supe
|
||||
|
||||
// check the identifier
|
||||
return entry.readByte() > identifier;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -86,9 +86,7 @@ class ReplicationHubFindByName<K> implements FindByName {
|
||||
} catch (IOException e) {
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
this.map = (Map) of(CharSequence.class, ChronicleMapBuilderWithChannelId.class)
|
||||
@@ -114,7 +112,6 @@ class ReplicationHubFindByName<K> implements FindByName {
|
||||
map.put(builder.name(), builderWithChannelId);
|
||||
|
||||
return (T) get(builder.name()).chronicleMapBuilder.create();
|
||||
|
||||
}
|
||||
|
||||
public <T extends ChronicleHash> T from(String name) throws IllegalArgumentException,
|
||||
@@ -149,7 +146,6 @@ class ReplicationHubFindByName<K> implements FindByName {
|
||||
Thread.sleep(1);
|
||||
}
|
||||
throw new TimeoutException("timed out wait for map name=" + name);
|
||||
|
||||
}
|
||||
|
||||
private ChronicleHashInstanceConfig replicatedViaChannel(String name) throws TimeoutException, InterruptedException {
|
||||
|
||||
@@ -249,7 +249,6 @@ final class SerializationBuilder<E> implements Cloneable, Serializable{
|
||||
public SerializationBuilder<E> reader(BytesReader<E> reader) {
|
||||
this.reader = reader;
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
public Object interop() {
|
||||
|
||||
@@ -264,7 +264,6 @@ class ShortShortMultiMap implements MultiMap {
|
||||
int entry = bytes.readInt(pos);
|
||||
if (entry != UNSET_ENTRY)
|
||||
sb.append(key(entry)).append('=').append(value(entry)).append(", ");
|
||||
|
||||
}
|
||||
if (sb.length() > 2) {
|
||||
sb.setLength(sb.length() - 2);
|
||||
|
||||
@@ -222,7 +222,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
closeables.closeQuietly();
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -251,11 +250,9 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
clientChannel = AbstractChannelReplicator.openSocketChannel(closeables);
|
||||
clientChannel.connect(remoteAddress);
|
||||
doHandShaking(clientChannel);
|
||||
|
||||
} catch (IOException e) {
|
||||
closeables.closeQuietly();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -303,7 +300,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Attached to a map with a remote identifier=" + remoteIdentifier);
|
||||
|
||||
}
|
||||
|
||||
public File file() {
|
||||
@@ -325,7 +321,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
LOG.error("", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -417,7 +412,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
final Set<Map.Entry<K, V>> entries = entrySet();
|
||||
|
||||
return that.entrySet().equals(entries);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -442,7 +436,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
|
||||
// get the data back from the server
|
||||
return blockingFetch(sizeLocation).readBoolean();
|
||||
|
||||
}
|
||||
|
||||
private static NullPointerException keyNotNullNPE() {
|
||||
@@ -469,7 +462,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
|
||||
// get the data back from the server
|
||||
return readValue(sizeLocation, copies);
|
||||
|
||||
}
|
||||
|
||||
public synchronized V getUsing(K key, V usingValue) {
|
||||
@@ -527,7 +519,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
} else
|
||||
// get the data back from the server
|
||||
return readValue(sizeLocation, copies);
|
||||
|
||||
}
|
||||
|
||||
public synchronized <R> R mapForKey(K key, @NotNull Function<? super V, R> function) {
|
||||
@@ -562,10 +553,8 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
if (cause instanceof IOException && cause.getMessage().contains("Not enough available space")) {
|
||||
LOG.debug("resizing buffer");
|
||||
resizeBuffer(buffer.capacity() + maxEntrySize, start);
|
||||
|
||||
} else
|
||||
throw e;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -581,7 +570,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
sendWithoutAcc(bytes, sizeLocation);
|
||||
else
|
||||
blockingFetch(sizeLocation);
|
||||
|
||||
}
|
||||
|
||||
private synchronized void sendWithoutAcc(final Bytes bytes, long sizeLocation) {
|
||||
@@ -920,7 +908,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
public final String toString() {
|
||||
return getKey() + "=" + getValue();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Bytes blockingFetch(long sizeLocation) {
|
||||
@@ -936,7 +923,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
close();
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Bytes blockingFetch0(long sizeLocation, final long transactionId, long startTime) {
|
||||
@@ -950,7 +936,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
close();
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Bytes blockingFetchThrowable(long sizeLocation, long timeOutMs, final long transactionId, final long startTime) throws IOException {
|
||||
@@ -976,7 +961,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
bytes.buffer().clear();
|
||||
|
||||
return blockingFetch(timeoutTime, transactionId);
|
||||
|
||||
} catch (java.nio.channels.ClosedChannelException | ClosedConnectionException e) {
|
||||
checkTimeout(timeoutTime);
|
||||
clientChannel = lazyConnect(config.timeoutMs(), config.remoteAddress());
|
||||
@@ -995,7 +979,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
close();
|
||||
throw e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Bytes blockingFetch(long timeoutTime, long transactionId) throws IOException {
|
||||
@@ -1011,7 +994,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable, Clon
|
||||
long limit = bytes.position();
|
||||
bytes.position(limit);
|
||||
resizeBuffer(requiredSize, pos);
|
||||
|
||||
} else
|
||||
bytes.limit(bytes.capacity());
|
||||
|
||||
|
||||
@@ -183,7 +183,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
if (!isClosed)
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
} finally {
|
||||
for (int i = 0; i < keys.length && keys[i] != null; i++) {
|
||||
@@ -191,7 +190,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (CancelledKeyException e) {
|
||||
if (LOG.isDebugEnabled())
|
||||
@@ -266,7 +264,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
if (!isClosed)
|
||||
closeEarlyAndQuietly(key.channel());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -282,7 +279,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
final int keys = selector.selectNow();
|
||||
if (keys != 0)
|
||||
return keys;
|
||||
|
||||
}
|
||||
|
||||
return selector.select(selectorTimeout);
|
||||
@@ -321,7 +317,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("", e);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("", e);
|
||||
@@ -350,7 +345,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("sending heartbeat");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,7 +633,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
|
||||
if (completed)
|
||||
attached.entryWriter.workCompleted();
|
||||
|
||||
} else if (attached.remoteModificationIterator != null)
|
||||
attached.entryWriter.entriesToBuffer(attached.remoteModificationIterator, key);
|
||||
|
||||
@@ -653,7 +646,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
if (!attached.entryWriter.hasBytesToWrite() && !attached.entryWriter.isWorkIncomplete())
|
||||
// TURN OP_WRITE_OFF
|
||||
key.interestOps(key.interestOps() & ~OP_WRITE);
|
||||
|
||||
} catch (IOException e) {
|
||||
quietClose(key, e);
|
||||
if (!attached.isServer)
|
||||
@@ -691,7 +683,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
|
||||
if (attached.entryWriter.isWorkIncomplete())
|
||||
return;
|
||||
|
||||
} catch (IOException e) {
|
||||
if (!attached.isServer)
|
||||
attached.connector.connectLater();
|
||||
@@ -813,7 +804,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
} catch (ClosedChannelException e) {
|
||||
LOG.debug("", e);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -876,14 +866,12 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
if (socketChannel.isOpen())
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
selector.wakeup();
|
||||
success = true;
|
||||
return socketChannel;
|
||||
|
||||
} finally {
|
||||
if (!success) {
|
||||
try {
|
||||
@@ -899,7 +887,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -943,7 +930,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
if (remoteIdentifier != Byte.MIN_VALUE)
|
||||
TcpReplicator.this.opWriteUpdater.set(remoteIdentifier);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1029,7 +1015,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
// if we have space in the buffer to write more data and we just wrote data into the
|
||||
// buffer then let try and write some more
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1106,7 +1091,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
key.interestOps(key.interestOps() & ~OP_WRITE);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LOG.error("", e);
|
||||
}
|
||||
@@ -1257,10 +1241,8 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
} catch (Exception e) {
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
externalizable.readExternalEntry(copies, segmentState, out);
|
||||
|
||||
@@ -1272,7 +1254,6 @@ final class TcpReplicator extends AbstractChannelReplicator implements Closeable
|
||||
state = NOT_SET;
|
||||
sizeInBytes = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1349,7 +1330,6 @@ class StatelessServerConnector<K, V> {
|
||||
valueWriterWithSize = new WriterWithSize<>(valueSerializationBuilder);
|
||||
this.map = map;
|
||||
this.maxEntrySizeBytes = maxEntrySizeBytes;
|
||||
|
||||
}
|
||||
|
||||
Work processStatelessEvent(final byte eventId,
|
||||
@@ -1378,7 +1358,6 @@ class StatelessServerConnector<K, V> {
|
||||
|
||||
case REMOVE_WITHOUT_ACC:
|
||||
return remove(reader);
|
||||
|
||||
}
|
||||
|
||||
final long sizeLocation = reflectTransactionId(reader, writer);
|
||||
@@ -1440,9 +1419,7 @@ class StatelessServerConnector<K, V> {
|
||||
|
||||
default:
|
||||
throw new IllegalStateException("unsupported event=" + event);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Work mapForKey(ByteBufferBytes reader, Bytes writer, long sizeLocation) {
|
||||
@@ -1451,7 +1428,6 @@ class StatelessServerConnector<K, V> {
|
||||
try {
|
||||
Object result = map.mapForKey(key, function);
|
||||
writer.writeObject(result);
|
||||
|
||||
} catch (Throwable e) {
|
||||
LOG.info("", e);
|
||||
return sendException(writer, sizeLocation, e);
|
||||
@@ -1467,7 +1443,6 @@ class StatelessServerConnector<K, V> {
|
||||
try {
|
||||
Object result = map.updateForKey(key, mutator);
|
||||
writer.writeObject(result);
|
||||
|
||||
} catch (Throwable e) {
|
||||
LOG.info("", e);
|
||||
return sendException(writer, sizeLocation, e);
|
||||
@@ -1625,7 +1600,6 @@ class StatelessServerConnector<K, V> {
|
||||
}
|
||||
writeSizeAndFlags(sizeLocation, false, writer);
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
private Work put(Bytes reader) {
|
||||
@@ -1865,7 +1839,6 @@ class StatelessServerConnector<K, V> {
|
||||
writeHeader(out, sizeLocation, count, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,6 @@ class UdpChannelReplicator extends AbstractChannelReplicator implements Replica.
|
||||
serverConnector.connectLater();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LOG.error("", e);
|
||||
if (!isClosed)
|
||||
@@ -205,7 +204,6 @@ class UdpChannelReplicator extends AbstractChannelReplicator implements Replica.
|
||||
public void onChange() {
|
||||
// the write have to be enabled on the same thread as the selector
|
||||
shouldEnableOpWrite = true;
|
||||
|
||||
}
|
||||
|
||||
private void enableWrites() {
|
||||
@@ -282,13 +280,11 @@ class UdpChannelReplicator extends AbstractChannelReplicator implements Replica.
|
||||
} catch (ClosedChannelException e) {
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -114,7 +114,6 @@ final class UdpReplicator extends UdpChannelReplicator implements Replica.Modifi
|
||||
|
||||
externalizable.readExternalEntry(copies, segmentState, out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class UdpSocketChannelEntryWriter implements EntryWriter {
|
||||
@@ -173,7 +172,6 @@ final class UdpReplicator extends UdpChannelReplicator implements Replica.Modifi
|
||||
out.limit((int) in.position());
|
||||
|
||||
return socketChannel.write(out);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,6 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
* called when the header is created
|
||||
*/
|
||||
void onHeaderCreated() {
|
||||
|
||||
}
|
||||
|
||||
long getHeaderSize() {
|
||||
@@ -679,7 +678,6 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
try (FileOutputStream out = new FileOutputStream(toFile)) {
|
||||
xstream.toXML(entrySet(), out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -694,7 +692,6 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
try (FileInputStream out = new FileInputStream(fromFile)) {
|
||||
xstream.fromXML(out);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private XStreamConverter xStreamConverter;
|
||||
@@ -761,7 +758,6 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
writer.addAttribute("type", value.getClass().getCanonicalName());
|
||||
marshallingContext.convertAnother(value);
|
||||
writer.endNode();
|
||||
|
||||
} else if (EntrySet.class
|
||||
.isAssignableFrom(o.getClass())) {
|
||||
|
||||
@@ -770,7 +766,6 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
marshallingContext.convertAnother(e);
|
||||
writer.endNode();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -838,7 +833,6 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, ? super KI>,
|
||||
throw new ConversionException(e);
|
||||
}
|
||||
} else return (E) unmarshallingContext.convertAnother(null, clazz);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user