maedhroz commented on code in PR #2420:
URL: https://github.com/apache/cassandra/pull/2420#discussion_r1235812969


##########
src/java/org/apache/cassandra/db/streaming/ComponentManifest.java:
##########
@@ -52,13 +53,17 @@ public ComponentManifest(Map<Component, Long> components)
     }
 
     @VisibleForTesting
-    public static ComponentManifest create(Descriptor descriptor)
+    public static ComponentManifest create(SSTable sstable)
     {
-        LinkedHashMap<Component, Long> components = new 
LinkedHashMap<>(descriptor.getFormat().streamingComponents().size());
+        Set<Component> streamingComponents = sstable.getComponents();
+        LinkedHashMap<Component, Long> components = new 
LinkedHashMap<>(streamingComponents.size());
 
-        for (Component component : 
descriptor.getFormat().streamingComponents())
+        for (Component component : streamingComponents)
         {
-            File file = descriptor.fileFor(component);
+            if (component == SSTableFormat.Components.TOC)

Review Comment:
   nit: I guess the spirit of the original code here was to delegate this as 
much as possible to the SSTable format. What if we tried to preserve that (and 
coupled it with the `SAI` component I suggested below) and did something like...
   
   ```
   if 
(!sstable.descriptor.getFormat().streamingComponents().contains(component) && 
component.type != BigFormat.Components.Types.SAI)
   ```
   I like the idea of using `sstable.getComponents()` to make sure we don't 
forget anything, but it seems like picking out the `TOC` alone is a little 
brittle. WDYT?



-- 
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