/** * Request data in {@code columnFamilies} under {@code keyspace} and {@code ranges} from specific * node. * * @param from endpoint address to fetch data from. * @param connecting Actual connecting address for the endpoint * @param keyspace name of keyspace * @param ranges ranges to fetch * @param columnFamilies specific column families * @return this object for chaining */ public StreamPlan requestRanges( InetAddress from, InetAddress connecting, String keyspace, Collection<Range<Token>> ranges, String... columnFamilies) { StreamSession session = coordinator.getOrCreateNextSession(from, connecting); session.addStreamRequest(keyspace, ranges, Arrays.asList(columnFamilies), repairedAt); return this; }
/** * Add transfer task to send data of specific {@code columnFamilies} under {@code keyspace} and * {@code ranges}. * * @param to endpoint address of receiver * @param connecting Actual connecting address of the endpoint * @param keyspace name of keyspace * @param ranges ranges to send * @param columnFamilies specific column families * @return this object for chaining */ public StreamPlan transferRanges( InetAddress to, InetAddress connecting, String keyspace, Collection<Range<Token>> ranges, String... columnFamilies) { StreamSession session = coordinator.getOrCreateNextSession(to, connecting); session.addTransferRanges( keyspace, ranges, Arrays.asList(columnFamilies), flushBeforeTransfer, repairedAt); return this; }
/** @return true if this plan has no plan to execute */ public boolean isEmpty() { return !coordinator.hasActiveSessions(); }
/** * Add transfer task to send given SSTable files. * * @param to endpoint address of receiver * @param sstableDetails sstables with file positions and estimated key count. this collection * will be modified to remove those files that are successfully handed off * @return this object for chaining */ public StreamPlan transferFiles( InetAddress to, Collection<StreamSession.SSTableStreamingSections> sstableDetails) { coordinator.transferFiles(to, sstableDetails); return this; }