cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r953348 - in /cassandra/trunk/src/java/org/apache/cassandra: net/FileStreamTask.java net/MessagingService.java streaming/IncomingStreamReader.java streaming/StreamOutManager.java
Date Thu, 10 Jun 2010 15:30:21 GMT
Author: gdusbabek
Date: Thu Jun 10 15:30:21 2010
New Revision: 953348

URL: http://svn.apache.org/viewvc?rev=953348&view=rev
Log:
remove some unused fields. patch by gdusbabek, reviewed by jbellis. CASSANDRA-956

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/net/FileStreamTask.java
    cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutManager.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/FileStreamTask.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/FileStreamTask.java?rev=953348&r1=953347&r2=953348&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/FileStreamTask.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/FileStreamTask.java Thu Jun 10 15:30:21
2010
@@ -45,8 +45,13 @@ public class FileStreamTask extends Wrap
     private final long startPosition;
     private final long endPosition;
     private final InetAddress to;
+    
+    FileStreamTask(String file, InetAddress to)
+    {
+        this(file, 0, new File(file).length(), to);
+    }
 
-    FileStreamTask(String file, long startPosition, long endPosition, InetAddress from, InetAddress
to)
+    private FileStreamTask(String file, long startPosition, long endPosition, InetAddress
to)
     {
         this.file = file;
         this.startPosition = startPosition;

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=953348&r1=953347&r2=953348&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Thu Jun 10 15:30:21
2010
@@ -306,15 +306,13 @@ public class MessagingService implements
      * Stream a file from source to destination. This is highly optimized
      * to not hold any of the contents of the file in memory.
      * @param file name of file to stream.
-     * @param startPosition position inside the file
-     * @param endPosition
      * @param to endpoint to which we need to stream the file.
     */
 
-    public void stream(String file, long startPosition, long endPosition, InetAddress from,
InetAddress to)
+    public void stream(String file, InetAddress to)
     {
         /* Streaming asynchronously on streamExector_ threads. */
-        Runnable streamingTask = new FileStreamTask(file, startPosition, endPosition, from,
to);
+        Runnable streamingTask = new FileStreamTask(file, to);
         streamExecutor_.execute(streamingTask);
     }
     

Modified: cassandra/trunk/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java?rev=953348&r1=953347&r2=953348&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/streaming/IncomingStreamReader.java Thu
Jun 10 15:30:21 2010
@@ -40,7 +40,8 @@ public class IncomingStreamReader
     {
         this.socketChannel = socketChannel;
         InetSocketAddress remoteAddress = (InetSocketAddress)socketChannel.socket().getRemoteSocketAddress();
-        // this is the part where we are assuming files come in order from a particular host.
+        // this is the part where we are assuming files come in order from a particular host.
it is brittle because
+        // any node could send a stream message to this host and it would just assume it
is receiving the next file.
         pendingFile = StreamInManager.getNextIncomingFile(remoteAddress.getAddress());
         StreamInManager.activeStreams.put(remoteAddress.getAddress(), pendingFile);
         assert pendingFile != null;

Modified: cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutManager.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutManager.java?rev=953348&r1=953347&r2=953348&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutManager.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamOutManager.java Thu Jun
10 15:30:21 2010
@@ -130,7 +130,7 @@ public class StreamOutManager
             File file = new File(files.get(0).getFilename());
             if (logger.isDebugEnabled())
               logger.debug("Streaming " + file.length() + " length file " + file + " ...");
-            MessagingService.instance.stream(file.getAbsolutePath(), 0L, file.length(), FBUtilities.getLocalAddress(),
to);
+            MessagingService.instance.stream(file.getAbsolutePath(), to);
         }
     }
 



Mime
View raw message