public OClusterPosition readClusterPosition() throws IOException { final int serializedSize = OClusterPositionFactory.INSTANCE.getSerializedSize(); if (debug) OLogManager.instance() .info( this, "%s - Reading cluster position (%d bytes)....", socket.getRemoteSocketAddress(), serializedSize); final OClusterPosition clusterPosition = OClusterPositionFactory.INSTANCE.fromStream((InputStream) in); updateMetricReceivedBytes(serializedSize); if (debug) OLogManager.instance() .info( this, "%s - Read cluster position: %s", socket.getRemoteSocketAddress(), clusterPosition); return clusterPosition; }
public OChannelBinary writeClusterPosition(final OClusterPosition clusterPosition) throws IOException { final int serializedSize = OClusterPositionFactory.INSTANCE.getSerializedSize(); if (debug) OLogManager.instance() .info( this, "%s - Writing cluster position (%d bytes) : %s....", socket.getRemoteSocketAddress(), serializedSize, clusterPosition); out.write(clusterPosition.toStream()); updateMetricTransmittedBytes(serializedSize); return this; }