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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to