Class StreamPlan


  • public class StreamPlan
    extends java.lang.Object
    StreamPlan is a helper class that builds StreamOperation of given configuration. This is the class you want to use for building streaming plan and starting streaming.
    • Constructor Detail

      • StreamPlan

        public StreamPlan​(StreamOperation streamOperation)
        Start building stream plan.
        Parameters:
        streamOperation - Stream streamOperation that describes this StreamPlan
      • StreamPlan

        public StreamPlan​(StreamOperation streamOperation,
                          boolean connectSequentially)
      • StreamPlan

        public StreamPlan​(StreamOperation streamOperation,
                          int connectionsPerHost,
                          boolean connectSequentially,
                          TimeUUID pendingRepair,
                          PreviewKind previewKind)
    • Method Detail

      • requestRanges

        public StreamPlan requestRanges​(InetAddressAndPort from,
                                        java.lang.String keyspace,
                                        RangesAtEndpoint fullRanges,
                                        RangesAtEndpoint transientRanges)
        Request data in keyspace and ranges from specific node. Here, we have to encode both _local_ range transientness (encoded in Replica itself, in RangesAtEndpoint) and _remote_ (source) range transientmess, which is encoded by splitting ranges into full and transient. At the other end the distinction between full and transient is ignored it just used the transient status of the Replica objects we send to determine what to send. The real reason we have this split down to StreamRequest is that on completion StreamRequest is used to write to the system table tracking what has already been streamed. At that point since we only have the local Replica instances so we don't know what we got from the remote. We preserve that here by splitting based on the remotes transient status.
        Parameters:
        from - endpoint address to fetch data from.
        keyspace - name of keyspace
        fullRanges - ranges to fetch that from provides the full version of
        transientRanges - ranges to fetch that from provides only transient data of
        Returns:
        this object for chaining
      • requestRanges

        public StreamPlan requestRanges​(InetAddressAndPort from,
                                        java.lang.String keyspace,
                                        RangesAtEndpoint fullRanges,
                                        RangesAtEndpoint transientRanges,
                                        java.lang.String... columnFamilies)
        Request data in columnFamilies under keyspace and ranges from specific node.
        Parameters:
        from - endpoint address to fetch data from.
        keyspace - name of keyspace
        fullRanges - ranges to fetch that from provides the full data for
        transientRanges - ranges to fetch that from provides only transient data for
        columnFamilies - specific column families
        Returns:
        this object for chaining
      • transferRanges

        public StreamPlan transferRanges​(InetAddressAndPort to,
                                         java.lang.String keyspace,
                                         RangesAtEndpoint replicas,
                                         java.lang.String... columnFamilies)
        Add transfer task to send data of specific columnFamilies under keyspace and ranges.
        Parameters:
        to - endpoint address of receiver
        keyspace - name of keyspace
        replicas - ranges to send
        columnFamilies - specific column families
        Returns:
        this object for chaining
      • transferStreams

        public StreamPlan transferStreams​(InetAddressAndPort to,
                                          java.util.Collection<OutgoingStream> streams)
        Add transfer task to send given streams
        Parameters:
        to - endpoint address of receiver
        streams - streams to send
        Returns:
        this object for chaining
      • connectionFactory

        public StreamPlan connectionFactory​(StreamingChannel.Factory factory)
        Set custom StreamConnectionFactory to be used for establishing connection
        Parameters:
        factory - StreamConnectionFactory to use
        Returns:
        self
      • isEmpty

        public boolean isEmpty()
        Returns:
        true if this plan has no plan to execute
      • flushBeforeTransfer

        public StreamPlan flushBeforeTransfer​(boolean flushBeforeTransfer)
        Set flushBeforeTransfer option. When it's true, will flush before streaming ranges. (Default: true)
        Parameters:
        flushBeforeTransfer - set to true when the node should flush before transfer
        Returns:
        this object for chaining
      • getPendingRepair

        public TimeUUID getPendingRepair()
      • getFlushBeforeTransfer

        public boolean getFlushBeforeTransfer()