netudima commented on code in PR #4356:
URL: https://github.com/apache/cassandra/pull/4356#discussion_r2369918474


##########
src/java/org/apache/cassandra/utils/logging/AbstractVirtualTableAppender.java:
##########
@@ -65,32 +64,41 @@ protected <T> T getVirtualTable(Class<T> vtableClass, 
String tableName)
 
         if (!vt.getClass().equals(vtableClass))
             throw new IllegalStateException(String.format("Virtual table %s.%s 
is not backed by an instance of %s but by %s",
-                                                          VIRTUAL_VIEWS,
+                                                          keyspaceName,
                                                           tableName,
                                                           
vtableClass.getName(),
                                                           
vt.getClass().getName()));
 
         return (T) vt;
     }
 
+    public static <T> T getVirtualTable(Class<T> vtableClass, String tableName)
+    {
+        return getVirtualTable(vtableClass, VIRTUAL_VIEWS, tableName);
+    }
+
     /**
      * This method adds an event to virtual table, when present.
      * When vtable is null, we will attempt to find it among registered ones. 
Then not found, we add it to internal
      * buffer for later processing. This might happen e.g. for logging tables 
when log events
      * were appended via logging framework sooner than registration of virtual 
tables was done so after they are registered,
      * they would miss logging events happened before being so.
      *
-     * @param vtable    vtable to append to
-     * @param event     event to append to
-     * @param tableName table name of virtual table to append to
+     * @param vtableClass class of vtable to append to
+     * @param vtable      vtable to append to
+     * @param event       event to append to
+     * @param tableName   table name of virtual table to append to
      * @return vtable or when null, found vtable
      */
-    protected AbstractLoggerVirtualTable<?> 
appendToVirtualTable(AbstractLoggerVirtualTable<?> vtable, LoggingEvent event, 
String tableName)
+    protected AbstractLoggerVirtualTable<?> appendToVirtualTable(Class<? 
extends AbstractLoggerVirtualTable<?>> vtableClass,

Review Comment:
   should we use a generic to align classes for first 2 parameters and the 
result value (avoid possible mistakes in usage)?



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