cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: calc header.size() once
Date Mon, 29 Jul 2013 06:10:58 GMT
Updated Branches:
  refs/heads/trunk 605c640aa -> 6decaf4e8


calc header.size() once


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6decaf4e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6decaf4e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6decaf4e

Branch: refs/heads/trunk
Commit: 6decaf4e868658fc79a29cc4ce91d09d490b389f
Parents: 605c640
Author: Dave Brosius <dbrosius@apache.org>
Authored: Mon Jul 29 02:10:05 2013 -0400
Committer: Dave Brosius <dbrosius@apache.org>
Committed: Mon Jul 29 02:10:05 2013 -0400

----------------------------------------------------------------------
 .../org/apache/cassandra/streaming/StreamSession.java     | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6decaf4e/src/java/org/apache/cassandra/streaming/StreamSession.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamSession.java b/src/java/org/apache/cassandra/streaming/StreamSession.java
index 610fea7..c87958b 100644
--- a/src/java/org/apache/cassandra/streaming/StreamSession.java
+++ b/src/java/org/apache/cassandra/streaming/StreamSession.java
@@ -447,8 +447,9 @@ public class StreamSession implements IEndpointStateChangeSubscriber,
IFailureDe
      */
     public void fileSent(FileMessageHeader header)
     {
-        StreamingMetrics.totalOutgoingBytes.inc(header.size());
-        metrics.outgoingBytes.inc(header.size());
+        long headerSize = header.size();
+        StreamingMetrics.totalOutgoingBytes.inc(headerSize);
+        metrics.outgoingBytes.inc(headerSize);
     }
 
     /**
@@ -458,8 +459,9 @@ public class StreamSession implements IEndpointStateChangeSubscriber,
IFailureDe
      */
     public void receive(FileMessage message)
     {
-        StreamingMetrics.totalIncomingBytes.inc(message.header.size());
-        metrics.incomingBytes.inc(message.header.size());
+        long headerSize = message.header.size();
+        StreamingMetrics.totalIncomingBytes.inc(headerSize);
+        metrics.incomingBytes.inc(headerSize);
         // send back file received message
         handler.sendMessage(new ReceivedMessage(message.header.cfId, message.header.sequenceNumber));
         receivers.get(message.header.cfId).received(message.sstable);


Mime
View raw message