Skip to content

Commit

Permalink
Apply streaming_connections_per_host to decommission
Browse files Browse the repository at this point in the history
The streaming_connections_per_host parameter can be used to speed up
CPU-bound bootstrap. Semantically there seems nothing wrong to use it
during decommission as well instead of the hardcoded 1 connection.
  • Loading branch information
dmitry-potepalov committed Jul 5, 2024
1 parent f3f8294 commit 177c5a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/java/org/apache/cassandra/service/StorageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5990,7 +5990,7 @@ private Future<StreamState> streamRanges(Map<String, EndpointsByReplica> rangesT
sessionsToStreamByKeyspace.put(keyspace, replicasPerEndpoint.build());
}

StreamPlan streamPlan = new StreamPlan(StreamOperation.DECOMMISSION);
StreamPlan streamPlan = new StreamPlan(StreamOperation.DECOMMISSION, DatabaseDescriptor.getStreamingConnectionsPerHost());

// Vinculate StreamStateStore to current StreamPlan to update transferred rangeas per StreamSession
streamPlan.listeners(streamStateStore);
Expand Down
5 changes: 5 additions & 0 deletions src/java/org/apache/cassandra/streaming/StreamPlan.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public StreamPlan(StreamOperation streamOperation)
this(streamOperation, 1, false, NO_PENDING_REPAIR, PreviewKind.NONE);
}

public StreamPlan(StreamOperation streamOperation, int connectionsPerHost)
{
this(streamOperation, connectionsPerHost, false, NO_PENDING_REPAIR, PreviewKind.NONE);
}

public StreamPlan(StreamOperation streamOperation, boolean connectSequentially)
{
this(streamOperation, 1, connectSequentially, NO_PENDING_REPAIR, PreviewKind.NONE);
Expand Down

0 comments on commit 177c5a1

Please sign in to comment.