jtuglu1 commented on code in PR #19221:
URL: https://github.com/apache/druid/pull/19221#discussion_r3049150051
##########
server/src/main/java/org/apache/druid/server/broker/BrokerDynamicConfig.java:
##########
@@ -52,14 +54,24 @@ public class BrokerDynamicConfig
*/
private final QueryContext queryContext;
+ /**
+ * Per-datasource per-segment timeout configuration. Maps datasource name to
its
+ * {@link PerSegmentTimeoutConfig}. When a query targets a datasource in
this map,
+ * the broker injects the configured {@code perSegmentTimeout} into the
query context
+ * (unless the caller already set it explicitly).
+ */
+ private final Map<String, PerSegmentTimeoutConfig> perSegmentTimeoutConfig;
+
@JsonCreator
public BrokerDynamicConfig(
@JsonProperty("queryBlocklist") @Nullable List<QueryBlocklistRule>
queryBlocklist,
- @JsonProperty("queryContext") @Nullable QueryContext queryContext
+ @JsonProperty("queryContext") @Nullable QueryContext queryContext,
+ @JsonProperty("perSegmentTimeoutConfig") @Nullable Map<String,
PerSegmentTimeoutConfig> perSegmentTimeoutConfig
)
{
this.queryBlocklist = Configs.valueOrDefault(queryBlocklist,
Collections.emptyList());
this.queryContext = Configs.valueOrDefault(queryContext,
QueryContext.empty());
+ this.perSegmentTimeoutConfig =
Configs.valueOrDefault(perSegmentTimeoutConfig, ImmutableMap.of());
Review Comment:
minor nit: Map.of(), or, even better, Collections.emptyMap() to avoid an
allocation and use a static ref.
--
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]