Mbyrd/cassandra 21258/trunk#4876
Open
Jollyplum wants to merge 2 commits into
Open
Conversation
smiklosovic
reviewed
Jun 10, 2026
| @@ -304,10 +306,11 @@ public RangeStreamer(ClusterMetadata metadata, | |||
| int connectionsPerHost, | |||
| MovementMap movements, | |||
| MovementMap strictMovements, | |||
| boolean excludeAccordTables) | |||
| boolean excludeAccordTables, | |||
| Set<String> tables) | |||
Contributor
There was a problem hiding this comment.
maybe annotated this with @Nullable or make it so that it works with empty set or similar
smiklosovic
reviewed
Jun 10, 2026
| @@ -772,11 +777,15 @@ public StreamResultFuture fetchAsync() | |||
| { | |||
| String[] cfNames = StreamPlan.nonAccordTablesForKeyspace(ksm); | |||
| if (cfNames != null) | |||
| { | |||
| cfNames = Arrays.stream(cfNames).filter(table -> tables == null || tables.contains(table)).toArray(String[]::new); | |||
Contributor
There was a problem hiding this comment.
what if this.tables will be an empty set? Then cfNames will be empty array, no? Somebody might think that empty set is "all tables".
In "rebuild" you do
tables == null || tables.isEmpty() ? "(All tables)" : tables
so null and empty is indeed as "everything" which is not the case here ...
smiklosovic
reviewed
Jun 10, 2026
| @@ -52,6 +55,11 @@ public class Rebuild extends AbstractCommand | |||
| description = "Use --exclude-local-dc to exclude nodes in local data center as source for streaming.") | |||
| private boolean excludeLocalDatacenterNodes = false; | |||
|
|
|||
| @Option(paramLabel = "specific_tables", | |||
| names = {"-tb", "--table"}, | |||
Contributor
There was a problem hiding this comment.
I can do this? --table tb1 --table tb2? Or is it meant to be --table tb1 tb2?
smiklosovic
reviewed
Jun 10, 2026
| @Option(paramLabel = "specific_tables", | ||
| names = {"-tb", "--table"}, | ||
| description = "Use -tb to scope the rebuild to particular table") | ||
| private Set<String> tables = new HashSet<>(); |
Contributor
There was a problem hiding this comment.
so on empty --tables, all code path will be executed with empty set instead of null, right?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently rebuild supports rebuilding at the scope of keyspace but not individual table.
When an operator wants to load data (e.g a backup) for a specific table to only subset of nodes (e.g one D.C) and then rebuild the others from these nodes, this currently is not supported.
Allow passing through a set of tables to restrict to as part of rebuild when keyspace specified.
https://issues.apache.org/jira/browse/CASSANDRA-21258
will attach CI on ticket.