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 and Description |
---|
StreamPlan(StreamOperation streamOperation)
Start building stream plan.
|
StreamPlan(StreamOperation streamOperation,
boolean connectSequentially) |
StreamPlan(StreamOperation streamOperation,
int connectionsPerHost,
boolean connectSequentially,
java.util.UUID pendingRepair,
PreviewKind previewKind) |
Modifier and Type | Method and Description |
---|---|
StreamPlan |
connectionFactory(StreamConnectionFactory factory)
Set custom StreamConnectionFactory to be used for establishing connection
|
StreamResultFuture |
execute()
Execute this
StreamPlan asynchronously. |
StreamPlan |
flushBeforeTransfer(boolean flushBeforeTransfer)
Set flushBeforeTransfer option.
|
StreamCoordinator |
getCoordinator() |
boolean |
getFlushBeforeTransfer() |
java.util.UUID |
getPendingRepair() |
boolean |
isEmpty() |
StreamPlan |
listeners(StreamEventHandler handler,
StreamEventHandler... handlers) |
StreamPlan |
requestRanges(InetAddressAndPort from,
java.lang.String keyspace,
RangesAtEndpoint fullRanges,
RangesAtEndpoint transientRanges)
Request data in
keyspace and ranges from specific node. |
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. |
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 . |
StreamPlan |
transferStreams(InetAddressAndPort to,
java.util.Collection<OutgoingStream> streams)
Add transfer task to send given streams
|
public StreamPlan(StreamOperation streamOperation)
streamOperation
- Stream streamOperation that describes this StreamPlanpublic StreamPlan(StreamOperation streamOperation, boolean connectSequentially)
public StreamPlan(StreamOperation streamOperation, int connectionsPerHost, boolean connectSequentially, java.util.UUID pendingRepair, PreviewKind previewKind)
public StreamPlan requestRanges(InetAddressAndPort from, java.lang.String keyspace, RangesAtEndpoint fullRanges, RangesAtEndpoint transientRanges)
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.from
- endpoint address to fetch data from.keyspace
- name of keyspacefullRanges
- ranges to fetch that from provides the full version oftransientRanges
- ranges to fetch that from provides only transient data ofpublic StreamPlan requestRanges(InetAddressAndPort from, java.lang.String keyspace, RangesAtEndpoint fullRanges, RangesAtEndpoint transientRanges, java.lang.String... columnFamilies)
columnFamilies
under keyspace
and ranges
from specific node.from
- endpoint address to fetch data from.keyspace
- name of keyspacefullRanges
- ranges to fetch that from provides the full data fortransientRanges
- ranges to fetch that from provides only transient data forcolumnFamilies
- specific column familiespublic StreamPlan transferRanges(InetAddressAndPort to, java.lang.String keyspace, RangesAtEndpoint replicas, java.lang.String... columnFamilies)
columnFamilies
under keyspace
and ranges
.to
- endpoint address of receiverkeyspace
- name of keyspacereplicas
- ranges to sendcolumnFamilies
- specific column familiespublic StreamPlan transferStreams(InetAddressAndPort to, java.util.Collection<OutgoingStream> streams)
to
- endpoint address of receiverstreams
- streams to sendpublic StreamPlan listeners(StreamEventHandler handler, StreamEventHandler... handlers)
public StreamPlan connectionFactory(StreamConnectionFactory factory)
factory
- StreamConnectionFactory to usepublic boolean isEmpty()
public StreamResultFuture execute()
StreamPlan
asynchronously.StreamState
that you can use to listen on progress of streaming.public StreamPlan flushBeforeTransfer(boolean flushBeforeTransfer)
flushBeforeTransfer
- set to true when the node should flush before transferpublic java.util.UUID getPendingRepair()
public boolean getFlushBeforeTransfer()
public StreamCoordinator getCoordinator()
Copyright © 2009- The Apache Software Foundation