Updated Branches: refs/heads/trunk b114ce74c -> b79b236d0
cleanup Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/175b22c1 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/175b22c1 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/175b22c1 Branch: refs/heads/trunk Commit: 175b22c153c9a0dee6f1c61df7ad9f93c1fb0128 Parents: b114ce7 Author: Jonathan Ellis <jbel...@apache.org> Authored: Tue Mar 26 15:42:58 2013 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Tue Mar 26 15:42:58 2013 -0500 ---------------------------------------------------------------------- .../cassandra/net/OutboundTcpConnection.java | 17 +++++++-------- 1 files changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/175b22c1/src/java/org/apache/cassandra/net/OutboundTcpConnection.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java index 0cc974f..dce3711 100644 --- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java +++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java @@ -183,12 +183,11 @@ public class OutboundTcpConnection extends Thread Tracing.instance().stopIfNonLocal(state); } - write(qm.message, qm.id, qm.timestamp, out, targetVersion); + writeInternal(qm.message, qm.id, qm.timestamp); + completed++; if (active.peek() == null) - { out.flush(); - } } catch (Exception e) { @@ -201,28 +200,28 @@ public class OutboundTcpConnection extends Thread } } - public static void write(MessageOut message, int id, long timestamp, DataOutputStream out, int version) throws IOException + private void writeInternal(MessageOut message, int id, long timestamp) throws IOException { out.writeInt(MessagingService.PROTOCOL_MAGIC); - if (version < MessagingService.VERSION_12) + if (targetVersion < MessagingService.VERSION_12) { - writeHeader(out, version, false); + writeHeader(out, targetVersion, false); // 0.8 included a total message size int. 1.0 doesn't need it but expects it to be there. out.writeInt(-1); } - if (version < MessagingService.VERSION_20) + if (targetVersion < MessagingService.VERSION_20) out.writeUTF(String.valueOf(id)); else out.writeInt(id); - if (version >= MessagingService.VERSION_12) + if (targetVersion >= MessagingService.VERSION_12) { // int cast cuts off the high-order half of the timestamp, which we can assume remains // the same between now and when the recipient reconstructs it. out.writeInt((int) timestamp); } - message.serialize(out, version); + message.serialize(out, targetVersion); } private static void writeHeader(DataOutputStream out, int version, boolean compressionEnabled) throws IOException