You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/03/15 16:19:14 UTC

[GitHub] [cassandra] jacek-lewandowski commented on a change in pull request #1276: CASSANDRA-17048: UUID based sstable generation numbers

jacek-lewandowski commented on a change in pull request #1276:
URL: https://github.com/apache/cassandra/pull/1276#discussion_r827168366



##########
File path: src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java
##########
@@ -82,34 +82,22 @@ protected SSTableTxnWriter createWriter()
                                        Collections.emptySet());
     }
 
-    private static Descriptor createDescriptor(File directory, final String keyspace, final String columnFamily, final SSTableFormat.Type fmt)
+    private static Descriptor createDescriptor(File directory, final String keyspace, final String columnFamily, final SSTableFormat.Type fmt) throws IOException
     {
-        int maxGen = getNextGeneration(directory, columnFamily);
-        return new Descriptor(directory, keyspace, columnFamily, maxGen + 1, fmt);
+        SSTableId nextGen = getNextGeneration(directory, columnFamily);
+        return new Descriptor(directory, keyspace, columnFamily, nextGen, fmt);
     }
 
-    private static int getNextGeneration(File directory, final String columnFamily)
+    private static SSTableId getNextGeneration(File directory, final String columnFamily) throws IOException
     {
-        final Set<Descriptor> existing = new HashSet<>();
-        directory.tryList(file -> {
-            Descriptor desc = SSTable.tryDescriptorFromFilename(file);
-            if (desc == null)
-                return false;
-
-            if (desc.cfname.equals(columnFamily))
-                existing.add(desc);
-
-            return false;
-        });
-        int maxGen = generation.getAndIncrement();

Review comment:
       why? It is still used




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org