Skip to content

CASSANDRA-21012: Allow CQLSSTableWriter to specify SSTable id type (legacy/uuid) - #5093

Open
arvindKandpal-ksolves wants to merge 4 commits into
apache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21012
Open

CASSANDRA-21012: Allow CQLSSTableWriter to specify SSTable id type (legacy/uuid)#5093
arvindKandpal-ksolves wants to merge 4 commits into
apache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21012

Conversation

@arvindKandpal-ksolves

Copy link
Copy Markdown
Contributor

Problem

CQLSSTableWriter always generates SSTables with legacy sequential identifiers. If someone writes SSTables standalone and loads them into a node with uuid_sstable_identifiers_enabled: true (via nodetool refresh), the legacy naming causes a mismatch since it's not converted to UUID format.

Fix

Added withUUIDSSTableIdentifiers(boolean) to CQLSSTableWriter.Builder, letting users explicitly choose legacy or UUID identifiers at build time.Default behavior (unset) falls back to the existing config-flag based logic — fully backward compatible.

Changes

  • SSTableIdFactory: new builderFor(boolean) method
  • AbstractSSTableSimpleWriter: instance-level idBuilder (static id counter
    kept as-is for cross-instance uniqueness)
  • SSTableSimpleWriter / SSTableSimpleUnsortedWriter: new constructor overloads
  • CQLSSTableWriter.Builder: new withUUIDSSTableIdentifiers(boolean) method

Testing

  • Added unit tests for UUID mode and default (legacy) mode
  • All existing tests pass (CQLSSTableWriterDaemonTest, CQLSSTableWriterClientTest)
  • Manually verified end-to-end: wrote SSTables with UUID ids, copied into a live node with uuid_sstable_identifiers_enabled: true, ran nodetool refresh, confirmed data loaded correctly
  • Verified both sorted and unsorted writer paths
  • ant checkstyle passes

The Cassandra Jira

@smiklosovic

Copy link
Copy Markdown
Contributor

@smiklosovic
smiklosovic self-requested a review September 2, 2026 11:16

@smiklosovic smiklosovic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arvindKandpal-ksolves

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @smiklosovic! Applied the suggested changes.

Comment thread src/java/org/apache/cassandra/io/sstable/SSTableIdFactory.java Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants