org.apache.cassandra.streaming
Class StreamOut

java.lang.Object
  extended by org.apache.cassandra.streaming.StreamOut

public class StreamOut
extends java.lang.Object

This class handles streaming data from one node to another. The source node is in charge of the streaming session. It begins the stream by sending a Message with the stream bit flag in the Header turned on. Part of that Message will include a StreamHeader that includes the files that will be streamed as part of that session, as well as the first file-to-be-streamed. (Combining session list and first file like this is inconvenient, but not as inconvenient as the old three-part send-file-list, wait-for-ack, start-first-file dance.) After each file, the target will send a StreamReply indicating success (FILE_FINISHED) or failure (FILE_RETRY). When all files have been successfully transferred and integrated the source will send SESSION_FINISHED and the session is complete. For Stream requests (for bootstrap), one subtlety is that we always have to create at least one stream reply, even if the list of files is empty, otherwise the target has no way to know that it can stop waiting for an answer.


Constructor Summary
StreamOut()
           
 
Method Summary
static void transferRanges(java.net.InetAddress target, java.lang.String tableName, java.util.Collection<Range> ranges, java.lang.Runnable callback)
          Split out files for all tables on disk locally for each range and then stream them to the target endpoint.
static void transferRangesForRequest(StreamOutSession session, java.util.Collection<Range> ranges)
          Split out files for all tables on disk locally for each range and then stream them to the target endpoint.
static void transferSSTables(StreamOutSession session, java.util.Collection<SSTableReader> sstables, java.util.Collection<Range> ranges)
          Transfers matching portions of a group of sstables from a single table to the target endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamOut

public StreamOut()
Method Detail

transferRanges

public static void transferRanges(java.net.InetAddress target,
                                  java.lang.String tableName,
                                  java.util.Collection<Range> ranges,
                                  java.lang.Runnable callback)
Split out files for all tables on disk locally for each range and then stream them to the target endpoint.


transferRangesForRequest

public static void transferRangesForRequest(StreamOutSession session,
                                            java.util.Collection<Range> ranges)
Split out files for all tables on disk locally for each range and then stream them to the target endpoint.


transferSSTables

public static void transferSSTables(StreamOutSession session,
                                    java.util.Collection<SSTableReader> sstables,
                                    java.util.Collection<Range> ranges)
                             throws java.io.IOException
Transfers matching portions of a group of sstables from a single table to the target endpoint.

Throws:
java.io.IOException


Copyright © 2011 The Apache Software Foundation