kfaraz commented on code in PR #17653:
URL: https://github.com/apache/druid/pull/17653#discussion_r1947448484


##########
server/src/main/java/org/apache/druid/metadata/SegmentsMetadataManagerConfig.java:
##########
@@ -19,25 +19,42 @@
 
 package org.apache.druid.metadata;
 
+import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.druid.common.config.Configs;
 import org.joda.time.Period;
 
 /**
+ * Config that dictates polling and caching of segment metadata on leader
+ * Coordinator or Overlord services.
  */
 public class SegmentsMetadataManagerConfig
 {
   public static final String CONFIG_PREFIX = "druid.manager.segments";
 
   @JsonProperty
-  private Period pollDuration = new Period("PT1M");
+  private final Period pollDuration;
 
-  public Period getPollDuration()
+  @JsonProperty
+  private final boolean useCache;
+
+  @JsonCreator
+  public SegmentsMetadataManagerConfig(
+      @JsonProperty("pollDuration") Period pollDuration,
+      @JsonProperty("useCache") Boolean useCache
+  )
   {
-    return pollDuration;
+    this.pollDuration = Configs.valueOrDefault(pollDuration, 
Period.minutes(1));
+    this.useCache = Configs.valueOrDefault(useCache, true);

Review Comment:
   Yes, I had enabled this temporarily to have all UTs and ITs work with the 
cache enabled.
   I will disable it now as all tests seem to work as expected.
   There are already some tests which run in both modes: cache enabled and 
disabled.



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