Throw RuntimeException if starting transfer of already completed 
OutgoingFileMessage


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

Branch: refs/heads/trunk
Commit: 88b3cfc3b6b4417a913a512b461897378b48c039
Parents: 315356c
Author: Paulo Motta <pauloricard...@gmail.com>
Authored: Fri Aug 12 22:06:27 2016 -0300
Committer: Yuki Morishita <yu...@apache.org>
Committed: Mon Aug 15 10:09:36 2016 -0500

----------------------------------------------------------------------
 .../apache/cassandra/streaming/messages/OutgoingFileMessage.java  | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/88b3cfc3/src/java/org/apache/cassandra/streaming/messages/OutgoingFileMessage.java
----------------------------------------------------------------------
diff --git 
a/src/java/org/apache/cassandra/streaming/messages/OutgoingFileMessage.java 
b/src/java/org/apache/cassandra/streaming/messages/OutgoingFileMessage.java
index a88386e..30b79f8 100644
--- a/src/java/org/apache/cassandra/streaming/messages/OutgoingFileMessage.java
+++ b/src/java/org/apache/cassandra/streaming/messages/OutgoingFileMessage.java
@@ -115,6 +115,9 @@ public class OutgoingFileMessage extends StreamMessage
     @VisibleForTesting
     public synchronized void startTransfer()
     {
+        if (completed)
+            throw new RuntimeException(String.format("Transfer of file %s 
already completed or aborted (perhaps session failed?).",
+                                                     filename));
         transferring = true;
     }
 

Reply via email to