abhishekrb19 commented on code in PR #19457:
URL: https://github.com/apache/druid/pull/19457#discussion_r3236228465
##########
server/src/main/java/org/apache/druid/server/QueryBlocklistRule.java:
##########
@@ -19,158 +19,32 @@
package org.apache.druid.server;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.Sets;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
import org.apache.druid.query.Query;
-import javax.annotation.Nullable;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-
/**
- * A rule for matching queries against blocklist criteria. A query matches
this rule if ALL
- * specified criteria match (AND logic). Null or empty criteria match
everything.
+ * A rule that determines whether a query should be blocked. Implementations
define their own
+ * matching logic and JSON fields. Use {@link DefaultQueryBlocklistRule} for
the standard criteria
+ * (datasources, query types, context).
+ *
+ * <p>Rules with no {@code "type"} field in JSON deserialize as {@link
DefaultQueryBlocklistRule}
+ * for backwards compatibility. Extensions can register additional
implementations as Jackson
+ * subtypes via {@code SimpleModule.registerSubtypes(...)}.
+ *
+ * <p>Implementations must define {@code equals} and {@code hashCode} so that
+ * {@link org.apache.druid.server.broker.BrokerDynamicConfig} can detect
changes correctly.
*/
-public class QueryBlocklistRule
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", defaultImpl =
DefaultQueryBlocklistRule.class)
Review Comment:
Addressed in this
[commit](https://github.com/apache/druid/pull/19457/commits/10e753c9bff9217fe0c4a406e9b46f2681c2338f)
by adding a `StrictTypeIdResolver` similar to `DimensionSchema`
--
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]