github-advanced-security[bot] commented on code in PR #16249:
URL: https://github.com/apache/druid/pull/16249#discussion_r1576341783


##########
sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfig.java:
##########
@@ -51,25 +54,83 @@
 
   ResultCacheMode resultCache() default ResultCacheMode.DISABLED;
 
+  /**
+   * Non-annotation version of {@link SqlTestFrameworkConfig}.
+   *
+   * Makes it less convoluted to work with configurations created at runtime.
+   */
+  class SqlTestFrameworkConfigInstance
+  {
+    public final int numMergeBuffers;
+    public final int minTopNThreshold;
+    public final ResultCacheMode resultCache;
+
+    public SqlTestFrameworkConfigInstance(SqlTestFrameworkConfig annotation)
+    {
+      numMergeBuffers = annotation.numMergeBuffers();
+      minTopNThreshold = annotation.minTopNThreshold();
+      resultCache = annotation.resultCache();
+    }
+
+    @Override
+    public int hashCode()
+    {
+      return Objects.hash(minTopNThreshold, numMergeBuffers, resultCache);
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+      if (obj == null || getClass() != obj.getClass()) {
+        return false;
+      }
+      SqlTestFrameworkConfigInstance other = (SqlTestFrameworkConfigInstance) 
obj;
+      return minTopNThreshold == other.minTopNThreshold
+          && numMergeBuffers == other.numMergeBuffers
+          && resultCache == other.resultCache;
+    }
+
+  }
+
+  class SqlTestFrameworkConfigStore implements Closeable
+  {
+    Map<SqlTestFrameworkConfigInstance, ConfigurationInstance> configMap = new 
HashMap<>();
+
+    public ConfigurationInstance getConfigurationInstance(
+        SqlTestFrameworkConfigInstance config,
+        QueryComponentSupplier testHost)
+    {
+      ConfigurationInstance ret = configMap.get(config);
+      if (!configMap.containsKey(config)) {
+        ret = new ConfigurationInstance(config, testHost);
+        configMap.put(config, ret);
+      }
+      return ret;
+    }
 
+    public void close()

Review Comment:
   ## Missing Override annotation
   
   This method overrides [Closeable.close](1); it is advisable to add an 
Override annotation.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/7307)



##########
sql/src/test/java/org/apache/druid/sql/calcite/util/SqlTestFramework.java:
##########
@@ -174,6 +175,10 @@
     JoinableFactoryWrapper 
createJoinableFactoryWrapper(LookupExtractorFactoryContainerProvider 
lookupProvider);
 
     void finalizeTestFramework(SqlTestFramework sqlTestFramework);
+
+    default void close() throws IOException

Review Comment:
   ## Missing Override annotation
   
   This method overrides [Closeable.close](1); it is advisable to add an 
Override annotation.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/7308)



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