public class RangeStreamer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RangeStreamer.AllowedSourcesFilter
Source filter which only includes endpoints contained within a provided set.
|
static class |
RangeStreamer.ExcludeLocalNodeFilter
Source filter which excludes the current node from source calculations
|
static class |
RangeStreamer.FailureDetectorSourceFilter
Source filter which excludes any endpoints that are not alive according to a
failure detector.
|
static class |
RangeStreamer.FetchReplica |
static class |
RangeStreamer.SingleDatacenterFilter
Source filter which excludes any endpoints that are not in a specific data center.
|
static interface |
RangeStreamer.SourceFilter |
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Predicate<Replica> |
ALIVE_PREDICATE |
Constructor and Description |
---|
RangeStreamer(TokenMetadata metadata,
java.util.Collection<Token> tokens,
InetAddressAndPort address,
StreamOperation streamOperation,
boolean useStrictConsistency,
IEndpointSnitch snitch,
StreamStateStore stateStore,
boolean connectSequentially,
int connectionsPerHost) |
Modifier and Type | Method and Description |
---|---|
void |
addRanges(java.lang.String keyspaceName,
ReplicaCollection<?> replicas)
Add ranges to be streamed for given keyspace.
|
void |
addSourceFilter(RangeStreamer.SourceFilter filter) |
static EndpointsByReplica |
calculateRangesToFetchWithPreferredEndpoints(java.util.function.BiFunction<InetAddressAndPort,EndpointsForRange,EndpointsForRange> snitchGetSortedListByProximity,
AbstractReplicationStrategy strat,
ReplicaCollection<?> fetchRanges,
boolean useStrictConsistency,
TokenMetadata tmdBefore,
TokenMetadata tmdAfter,
java.lang.String keyspace,
java.util.Collection<RangeStreamer.SourceFilter> sourceFilters)
Get a map of all ranges and the source that will be cleaned up once this bootstrapped node is added for the given ranges.
|
static com.google.common.collect.Multimap<InetAddressAndPort,RangeStreamer.FetchReplica> |
convertPreferredEndpointsToWorkMap(EndpointsByReplica preferredEndpoints)
The preferred endpoint list is the wrong format because it is keyed by Replica (this node) rather than the source
endpoint we will fetch from which streaming wants.
|
StreamResultFuture |
fetchAsync() |
public static com.google.common.base.Predicate<Replica> ALIVE_PREDICATE
public RangeStreamer(TokenMetadata metadata, java.util.Collection<Token> tokens, InetAddressAndPort address, StreamOperation streamOperation, boolean useStrictConsistency, IEndpointSnitch snitch, StreamStateStore stateStore, boolean connectSequentially, int connectionsPerHost)
public void addSourceFilter(RangeStreamer.SourceFilter filter)
public void addRanges(java.lang.String keyspaceName, ReplicaCollection<?> replicas)
keyspaceName
- keyspace namereplicas
- ranges to be streamedpublic static EndpointsByReplica calculateRangesToFetchWithPreferredEndpoints(java.util.function.BiFunction<InetAddressAndPort,EndpointsForRange,EndpointsForRange> snitchGetSortedListByProximity, AbstractReplicationStrategy strat, ReplicaCollection<?> fetchRanges, boolean useStrictConsistency, TokenMetadata tmdBefore, TokenMetadata tmdAfter, java.lang.String keyspace, java.util.Collection<RangeStreamer.SourceFilter> sourceFilters)
public static com.google.common.collect.Multimap<InetAddressAndPort,RangeStreamer.FetchReplica> convertPreferredEndpointsToWorkMap(EndpointsByReplica preferredEndpoints)
public StreamResultFuture fetchAsync()
Copyright © 2009-2021 The Apache Software Foundation