This is an automated email from the ASF dual-hosted git repository.
smiklosovic pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push:
new 9619e4ed31 ninja: fix a test for -latest in CQLSSTableWriterTest after
CASSANDRA-21012
9619e4ed31 is described below
commit 9619e4ed31e3c676772b72252660572e9ddf8042
Author: Stefan Miklosovic <[email protected]>
AuthorDate: Thu Sep 17 20:04:43 2026 +0200
ninja: fix a test for -latest in CQLSSTableWriterTest after CASSANDRA-21012
---
.../org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git
a/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
b/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
index 2cdecea526..e5b2c30ef2 100644
--- a/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
@@ -54,6 +54,7 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.apache.cassandra.Util;
+import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.cql3.CQL3Type;
import org.apache.cassandra.cql3.QueryProcessor;
import org.apache.cassandra.cql3.UntypedResultSet;
@@ -171,7 +172,7 @@ public abstract class CQLSSTableWriterTest
}
@Test
- public void testDefaultSSTableIdentifiersAreLegacy() throws Exception
+ public void testDefaultSSTableIdentifiersFollowConfig() throws Exception
{
String schema = "CREATE TABLE " + qualifiedTable + " ("
+ " k int PRIMARY KEY,"
@@ -189,8 +190,14 @@ public abstract class CQLSSTableWriterTest
File[] dataFiles = dataDir.tryList((dir, name) ->
name.contains("Data.db"));
assertEquals(1, dataFiles.length);
+ // With no builder given the writer falls back to
SSTableIdFactory#defaultBuilder, which follows
+ // uuid_sstable_identifiers_enabled: false in cassandra.yaml, true in
cassandra_latest.yaml.
+ SSTableId.Builder<?> expected =
DatabaseDescriptor.isUUIDSSTableIdentifiersEnabled()
+ ? UUIDBasedSSTableId.Builder.instance
+ :
SequenceBasedSSTableId.Builder.instance;
+
Descriptor descriptor = Descriptor.fromFile(dataFiles[0]);
-
assertTrue(SequenceBasedSSTableId.Builder.instance.isUniqueIdentifier(descriptor.id.toString()));
+ assertTrue(expected.isUniqueIdentifier(descriptor.id.toString()));
}
private void testWritingSstableWithFormat(SSTableFormat<?, ?> format)
throws Exception
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]