dcapwell commented on code in PR #3362:
URL: https://github.com/apache/cassandra/pull/3362#discussion_r1635139840


##########
src/java/org/apache/cassandra/db/Keyspace.java:
##########
@@ -160,6 +160,14 @@ public static ColumnFamilyStore 
openAndGetStore(TableMetadata table)
         return open(table.keyspace).getColumnFamilyStore(table.id);
     }
 
+    public static ColumnFamilyStore openAndGetStoreIfExists(TableMetadata 
table)

Review Comment:
   Can we add `@Nullable`?



##########
src/java/org/apache/cassandra/db/ColumnFamilyStore.java:
##########
@@ -3315,13 +3315,16 @@ public static ColumnFamilyStore getIfExists(TableId id)
         if (metadata == null)
             return null;
 
-        Keyspace keyspace = Keyspace.open(metadata.keyspace);
-        if (keyspace == null)
-            return null;
+        return getIfExists(metadata);
+    }
 
-        return keyspace.hasColumnFamilyStore(id)
-             ? keyspace.getColumnFamilyStore(id)
-             : null;
+    /**
+     * Returns a ColumnFamilyStore by metadata if it exists, null otherwise
+     * Differently from others, this method does not throw exception if the 
table does not exist.
+     */
+    public static ColumnFamilyStore getIfExists(TableMetadata table)

Review Comment:
   Can we add `@Nullable`?



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