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(java.lang.String description)
Start building stream plan.
|
StreamPlan(java.lang.String description,
boolean keepSSTableLevels) |
StreamPlan(java.lang.String description,
long repairedAt,
int connectionsPerHost,
boolean keepSSTableLevels,
boolean isIncremental) |
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.
|
boolean |
isEmpty() |
StreamPlan |
listeners(StreamEventHandler handler,
StreamEventHandler... handlers) |
StreamPlan |
requestRanges(java.net.InetAddress from,
java.net.InetAddress connecting,
java.lang.String keyspace,
java.util.Collection<Range<Token>> ranges)
Request data in
keyspace and ranges from specific node. |
StreamPlan |
requestRanges(java.net.InetAddress from,
java.net.InetAddress connecting,
java.lang.String keyspace,
java.util.Collection<Range<Token>> ranges,
java.lang.String... columnFamilies)
Request data in
columnFamilies under keyspace and ranges from specific node. |
StreamPlan |
transferFiles(java.net.InetAddress to,
java.util.Collection<StreamSession.SSTableStreamingSections> sstableDetails)
Add transfer task to send given SSTable files.
|
StreamPlan |
transferRanges(java.net.InetAddress to,
java.net.InetAddress connecting,
java.lang.String keyspace,
java.util.Collection<Range<Token>> ranges)
Add transfer task to send data of specific keyspace and ranges.
|
StreamPlan |
transferRanges(java.net.InetAddress to,
java.net.InetAddress connecting,
java.lang.String keyspace,
java.util.Collection<Range<Token>> ranges,
java.lang.String... columnFamilies)
Add transfer task to send data of specific
columnFamilies under keyspace and ranges . |
StreamPlan |
transferRanges(java.net.InetAddress to,
java.lang.String keyspace,
java.util.Collection<Range<Token>> ranges,
java.lang.String... columnFamilies)
Add transfer task to send data of specific
columnFamilies under keyspace and ranges . |
public StreamPlan(java.lang.String description)
description
- Stream type that describes this StreamPlanpublic StreamPlan(java.lang.String description, boolean keepSSTableLevels)
public StreamPlan(java.lang.String description, long repairedAt, int connectionsPerHost, boolean keepSSTableLevels, boolean isIncremental)
public StreamPlan requestRanges(java.net.InetAddress from, java.net.InetAddress connecting, java.lang.String keyspace, java.util.Collection<Range<Token>> ranges)
keyspace
and ranges
from specific node.from
- endpoint address to fetch data from.connecting
- Actual connecting address for the endpointkeyspace
- name of keyspaceranges
- ranges to fetchpublic StreamPlan requestRanges(java.net.InetAddress from, java.net.InetAddress connecting, java.lang.String keyspace, java.util.Collection<Range<Token>> ranges, java.lang.String... columnFamilies)
columnFamilies
under keyspace
and ranges
from specific node.from
- endpoint address to fetch data from.connecting
- Actual connecting address for the endpointkeyspace
- name of keyspaceranges
- ranges to fetchcolumnFamilies
- specific column familiespublic StreamPlan transferRanges(java.net.InetAddress to, java.lang.String keyspace, java.util.Collection<Range<Token>> ranges, java.lang.String... columnFamilies)
columnFamilies
under keyspace
and ranges
.public StreamPlan transferRanges(java.net.InetAddress to, java.net.InetAddress connecting, java.lang.String keyspace, java.util.Collection<Range<Token>> ranges)
to
- endpoint address of receiverconnecting
- Actual connecting address of the endpointkeyspace
- name of keyspaceranges
- ranges to sendpublic StreamPlan transferRanges(java.net.InetAddress to, java.net.InetAddress connecting, java.lang.String keyspace, java.util.Collection<Range<Token>> ranges, java.lang.String... columnFamilies)
columnFamilies
under keyspace
and ranges
.to
- endpoint address of receiverconnecting
- Actual connecting address of the endpointkeyspace
- name of keyspaceranges
- ranges to sendcolumnFamilies
- specific column familiespublic StreamPlan transferFiles(java.net.InetAddress to, java.util.Collection<StreamSession.SSTableStreamingSections> sstableDetails)
to
- endpoint address of receiversstableDetails
- sstables with file positions and estimated key count.
this collection will be modified to remove those files that are successfully handed offpublic 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 transferCopyright © 2017 The Apache Software Foundation