Package org.apache.cassandra.dht
Class RangeStreamer
java.lang.Object
org.apache.cassandra.dht.RangeStreamer
Assists in streaming ranges to this node.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSource filter which only includes endpoints contained within a provided set.static classSource filter which excludes nodes from local DC.static classSource filter which excludes the current node from source calculationsstatic classSource filter which excludes any endpoints that are not alive according to a failure detector.static classstatic classSource filter which excludes any endpoints that are not in a specific data center.static interface -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRangeStreamer(TokenMetadata metadata, Collection<Token> tokens, InetAddressAndPort address, StreamOperation streamOperation, boolean useStrictConsistency, IEndpointSnitch snitch, StreamStateStore stateStore, boolean connectSequentially, int connectionsPerHost) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRanges(String keyspaceName, ReplicaCollection<?> replicas) Add ranges to be streamed for given keyspace.voidstatic EndpointsByReplicacalculateRangesToFetchWithPreferredEndpoints(BiFunction<InetAddressAndPort, EndpointsForRange, EndpointsForRange> snitchGetSortedListByProximity, AbstractReplicationStrategy strat, ReplicaCollection<?> fetchRanges, boolean useStrictConsistency, TokenMetadata tmdBefore, TokenMetadata tmdAfter, String keyspace, 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.
-
Field Details
-
ALIVE_PREDICATE
-
-
Constructor Details
-
RangeStreamer
public RangeStreamer(TokenMetadata metadata, Collection<Token> tokens, InetAddressAndPort address, StreamOperation streamOperation, boolean useStrictConsistency, IEndpointSnitch snitch, StreamStateStore stateStore, boolean connectSequentially, int connectionsPerHost)
-
-
Method Details
-
addSourceFilter
-
addRanges
Add ranges to be streamed for given keyspace.- Parameters:
keyspaceName- keyspace namereplicas- ranges to be streamed
-
calculateRangesToFetchWithPreferredEndpoints
public static EndpointsByReplica calculateRangesToFetchWithPreferredEndpoints(BiFunction<InetAddressAndPort, EndpointsForRange, EndpointsForRange> snitchGetSortedListByProximity, AbstractReplicationStrategy strat, ReplicaCollection<?> fetchRanges, boolean useStrictConsistency, TokenMetadata tmdBefore, TokenMetadata tmdAfter, String keyspace, 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. For each range, the list should only contain a single source. This allows us to consistently migrate data without violating consistency. -
convertPreferredEndpointsToWorkMap
public 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. -
fetchAsync
-