This is an automated email from the ASF dual-hosted git repository.

kfaraz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new cd4d4620e77 Enable segment metadata cache on Broker by default (#19075)
cd4d4620e77 is described below

commit cd4d4620e777022cad77de408d46f7ceaca01515
Author: Kashif Faraz <[email protected]>
AuthorDate: Sat Mar 7 19:00:46 2026 +0530

    Enable segment metadata cache on Broker by default (#19075)
    
    Changes:
    - Set default value of `druid.sql.planner.metadataSegmentCacheEnable` to 
`true`
    - Emit metric `segment/metadataCache/sync/time` from Broker when
    cache in `MetadataSegmentView` has synced
    - Add `MetadataSegmentViewTest`
    - Update several embedded tests to wait for Broker cache to be synced
    - Update docs and tests
---
 docs/configuration/index.md                        |  2 +-
 docs/operations/metrics.md                         |  1 +
 .../embedded/compact/CompactionTestBase.java       |  2 +
 .../embedded/indexing/IngestionSmokeTest.java      |  4 +
 .../embedded/server/HighAvailabilityTest.java      | 15 +++-
 .../druid/testing/embedded/EmbeddedBroker.java     |  1 +
 .../schema/BrokerSegmentMetadataCacheConfig.java   |  8 +-
 .../sql/calcite/schema/MetadataSegmentView.java    | 41 +++++----
 .../BrokerSegmentMetadataCacheConfigTest.java      |  3 +-
 .../calcite/schema/MetadataSegmentViewTest.java    | 99 ++++++++++++++++++++++
 .../druid/sql/calcite/util/CalciteTests.java       |  4 +-
 11 files changed, 159 insertions(+), 21 deletions(-)

diff --git a/docs/configuration/index.md b/docs/configuration/index.md
index edee90d2e6b..c370ed6e1c5 100644
--- a/docs/configuration/index.md
+++ b/docs/configuration/index.md
@@ -1890,7 +1890,7 @@ The Druid SQL server is configured through the following 
properties on the Broke
 |`druid.sql.planner.useLexicographicTopN`|Whether to use [TopN 
queries](../querying/topnquery.md) with lexicographic dimension ordering. If 
false, [GroupBy queries](../querying/groupbyquery.md) will be used instead for 
lexicographic ordering. When both this and `useApproximateTopN` are false, TopN 
queries are never used.|false|
 |`druid.sql.planner.requireTimeCondition`|Whether to require SQL to have 
filter conditions on `__time` column so that all generated native queries will 
have user specified intervals. If true, all queries without filter condition on 
`__time` column will fail|false|
 |`druid.sql.planner.sqlTimeZone`|Sets the default time zone for the server, 
which will affect how time functions and timestamp literals behave. Should be a 
time zone name like "America/Los_Angeles" or offset like "-08:00".|UTC|
-|`druid.sql.planner.metadataSegmentCacheEnable`|Whether to keep a cache of 
published segments in broker. If true, broker polls coordinator in background 
to get segments from metadata store and maintains a local cache. If false, 
coordinator's REST API will be invoked when broker needs published segments 
info.|false|
+|`druid.sql.planner.metadataSegmentCacheEnable`|Whether to keep a cache of 
published segments on Broker that can be used to serve queries against 
`sys.segments`. If true, broker polls coordinator in background to get segments 
from metadata store and maintains a local cache. If false, coordinator's REST 
API will be invoked when broker needs published segments info.|true|
 |`druid.sql.planner.metadataSegmentPollPeriod`|How often to poll coordinator 
for published segments list if `druid.sql.planner.metadataSegmentCacheEnable` 
is set to true. Poll period is in milliseconds. |60000|
 |`druid.sql.planner.authorizeSystemTablesDirectly`|If true, Druid authorizes 
queries against any of the system schema tables (`sys` in SQL) as 
`SYSTEM_TABLE` resources which require `READ` access, in addition to 
permissions based content filtering.|false|
 |`druid.sql.planner.useNativeQueryExplain`|If true, `EXPLAIN PLAN FOR` will 
return the explain plan as a JSON representation of equivalent native query(s), 
else it will return the original version of explain plan generated by Calcite. 
It can be overridden per query with `useNativeQueryExplain` context key.|true|
diff --git a/docs/operations/metrics.md b/docs/operations/metrics.md
index 6b2da315b30..34f38e7c344 100644
--- a/docs/operations/metrics.md
+++ b/docs/operations/metrics.md
@@ -69,6 +69,7 @@ Most metric values reset each emission period, as specified 
in `druid.monitoring
 |`sqlQuery/bytes`|Number of bytes returned in the SQL query response.|`id`, 
`nativeQueryIds`, `dataSource`, `remoteAddress`, `success`, `engine`| |
 |`serverview/init/time`|Time taken to initialize the broker server view. 
Useful to detect if brokers are taking too long to start.||Depends on the 
number of segments.|
 |`metadatacache/init/time`|Time taken to initialize the broker segment 
metadata cache. Useful to detect if brokers are taking too long to 
start||Depends on the number of segments.|
+|`segment/metadataCache/sync/time`|Time taken to poll segment metadata from 
the Coordinator and update the segment metadata cache. This metric is emitted 
only if [metadata cache](../configuration/index.md#sql) is enabled on the 
Broker.||Depends on the number of segments.|
 |`segment/schemaCache/refresh/count`|Number of segments refreshed in broker 
segment schema cache.|`dataSource`||
 |`segment/schemaCache/refresh/time`|Time taken to refresh segments in broker 
segment schema cache.|`dataSource`||
 |`segment/schemaCache/poll/count`|Number of coordinator polls to fetch 
datasource schema.|||
diff --git 
a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionTestBase.java
 
b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionTestBase.java
index cbf88f88772..b714cd00859 100644
--- 
a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionTestBase.java
+++ 
b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/compact/CompactionTestBase.java
@@ -97,6 +97,8 @@ public abstract class CompactionTestBase extends 
EmbeddedClusterTestBase
 
   protected void verifySegmentsCount(int numExpectedSegments)
   {
+    // Ensure that Broker has synced latest segments from the Coordinator
+    broker.latchableEmitter().waitForNextEvent(event -> 
event.hasMetricName("segment/metadataCache/sync/time"));
     cluster.callApi().verifyNumVisibleSegmentsIs(numExpectedSegments, 
dataSource, overlord);
   }
 
diff --git 
a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/IngestionSmokeTest.java
 
b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/IngestionSmokeTest.java
index 2c770e4828d..0c71c63f451 100644
--- 
a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/IngestionSmokeTest.java
+++ 
b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/IngestionSmokeTest.java
@@ -408,6 +408,10 @@ public class IngestionSmokeTest extends 
EmbeddedClusterTestBase
                       .hasService("druid/broker")
                       .hasDimension(DruidMetrics.DATASOURCE, dataSource)
     );
+    eventCollector.latchableEmitter().waitForNextEvent(
+        event -> event.hasMetricName("segment/metadataCache/sync/time")
+                      .hasService("druid/broker")
+    );
   }
 
   /**
diff --git 
a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/HighAvailabilityTest.java
 
b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/HighAvailabilityTest.java
index 2a0f9d3cbef..28c77022306 100644
--- 
a/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/HighAvailabilityTest.java
+++ 
b/embedded-tests/src/test/java/org/apache/druid/testing/embedded/server/HighAvailabilityTest.java
@@ -73,11 +73,13 @@ public class HighAvailabilityTest extends 
EmbeddedClusterTestBase
   {
     overlord1.addProperty("druid.plaintextPort", "7090");
 
-    // Use incremental cache on coordinator1 so that we can wait for the
-    // segment count metric before querying sys.segments for the first time
+    // Use incremental cache on both coordinators so that we can wait for the
+    // cache sync metric before querying sys.segments
     coordinator1
         .addProperty("druid.plaintextPort", "7081")
         .addProperty("druid.manager.segments.useIncrementalCache", "always");
+    coordinator2
+        .addProperty("druid.manager.segments.useIncrementalCache", "always");
 
     // Keep the Router first in the list to ensure that EmbeddedServiceClient
     // does not use clients from the Overlord or Coordinator, which are stopped
@@ -140,6 +142,8 @@ public class HighAvailabilityTest extends 
EmbeddedClusterTestBase
           "1",
           cluster.runSql("SELECT COUNT(*) FROM sys.tasks WHERE 
datasource='%s'", dataSource)
       );
+      waitForNextSegmentCacheSync(coordinatorPair.leader);
+      waitForNextSegmentCacheSync(broker);
       Assertions.assertEquals(
           "10",
           cluster.runSql("SELECT COUNT(*) FROM sys.segments WHERE 
datasource='%s'", dataSource)
@@ -282,6 +286,13 @@ public class HighAvailabilityTest extends 
EmbeddedClusterTestBase
     );
   }
 
+  private void waitForNextSegmentCacheSync(EmbeddedDruidServer<?> server)
+  {
+    server.latchableEmitter().waitForNextEvent(
+        event -> event.hasMetricName("segment/metadataCache/sync/time")
+    );
+  }
+
   /**
    * A pair of highly available Coordinator or Overlord nodes where one is 
leader.
    */
diff --git 
a/services/src/test/java/org/apache/druid/testing/embedded/EmbeddedBroker.java 
b/services/src/test/java/org/apache/druid/testing/embedded/EmbeddedBroker.java
index 1a9c6db2aea..a192a91ff7e 100644
--- 
a/services/src/test/java/org/apache/druid/testing/embedded/EmbeddedBroker.java
+++ 
b/services/src/test/java/org/apache/druid/testing/embedded/EmbeddedBroker.java
@@ -50,6 +50,7 @@ public class EmbeddedBroker extends 
EmbeddedDruidServer<EmbeddedBroker>
     {
       this.handler = handler;
       addProperty("druid.sql.planner.metadataRefreshPeriod", "PT0.1s");
+      addProperty("druid.sql.planner.metadataSegmentPollPeriod", "100");
     }
 
     @Override
diff --git 
a/sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfig.java
 
b/sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfig.java
index bfe958b07d3..3733c49ec2d 100644
--- 
a/sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfig.java
+++ 
b/sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfig.java
@@ -40,7 +40,7 @@ public class BrokerSegmentMetadataCacheConfig extends 
SegmentMetadataCacheConfig
 {
   // A flag indicating whether to cache polled segments from the Coordinator.
   @JsonProperty
-  private boolean metadataSegmentCacheEnable = false;
+  private boolean metadataSegmentCacheEnable = true;
 
   // Interval for polling segments from the coordinator.
   @JsonProperty
@@ -64,6 +64,12 @@ public class BrokerSegmentMetadataCacheConfig extends 
SegmentMetadataCacheConfig
     return config;
   }
 
+  /**
+   * Flag to indicate if Broker should cache segment metadata polled from the
+   * Coordinator to serve {@code sys.segments} queries. True by default.
+   * If disabled, segment metadata is freshly fetched from the Coordinator for
+   * each query.
+   */
   public boolean isMetadataSegmentCacheEnable()
   {
     return metadataSegmentCacheEnable;
diff --git 
a/sql/src/main/java/org/apache/druid/sql/calcite/schema/MetadataSegmentView.java
 
b/sql/src/main/java/org/apache/druid/sql/calcite/schema/MetadataSegmentView.java
index 9191dd4f814..4fc8dc30e23 100644
--- 
a/sql/src/main/java/org/apache/druid/sql/calcite/schema/MetadataSegmentView.java
+++ 
b/sql/src/main/java/org/apache/druid/sql/calcite/schema/MetadataSegmentView.java
@@ -32,19 +32,22 @@ import org.apache.druid.common.guava.FutureUtils;
 import org.apache.druid.concurrent.LifecycleLock;
 import org.apache.druid.guice.ManageLifecycle;
 import org.apache.druid.java.util.common.ISE;
+import org.apache.druid.java.util.common.Stopwatch;
 import org.apache.druid.java.util.common.concurrent.Execs;
 import org.apache.druid.java.util.common.lifecycle.LifecycleStart;
 import org.apache.druid.java.util.common.lifecycle.LifecycleStop;
 import org.apache.druid.java.util.common.parsers.CloseableIterator;
 import org.apache.druid.java.util.emitter.EmittingLogger;
+import org.apache.druid.java.util.emitter.service.ServiceEmitter;
+import org.apache.druid.java.util.emitter.service.ServiceMetricEvent;
 import org.apache.druid.metadata.SegmentsMetadataManager;
+import org.apache.druid.metadata.segment.cache.Metric;
 import org.apache.druid.timeline.DataSegment;
 import org.apache.druid.timeline.SegmentId;
 import org.apache.druid.timeline.SegmentStatusInCluster;
 import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
 
 import java.util.Iterator;
-import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
@@ -81,12 +84,14 @@ public class MetadataSegmentView
   private final long pollPeriodInMS;
   private final LifecycleLock lifecycleLock = new LifecycleLock();
   private final CountDownLatch cachePopulated = new CountDownLatch(1);
+  private final ServiceEmitter emitter;
 
   @Inject
   public MetadataSegmentView(
       final CoordinatorClient coordinatorClient,
       final BrokerSegmentWatcherConfig segmentWatcherConfig,
-      final BrokerSegmentMetadataCacheConfig config
+      final BrokerSegmentMetadataCacheConfig config,
+      final ServiceEmitter emitter
   )
   {
     Preconditions.checkNotNull(config, "BrokerSegmentMetadataCacheConfig");
@@ -95,6 +100,7 @@ public class MetadataSegmentView
     this.isCacheEnabled = config.isMetadataSegmentCacheEnable();
     this.pollPeriodInMS = config.getMetadataSegmentPollPeriod();
     this.scheduledExec = 
Execs.scheduledSingleThreaded("MetadataSegmentView-Cache--%d");
+    this.emitter = emitter;
     this.segmentIdToReplicationFactor = CacheBuilder.newBuilder()
                                                     .expireAfterAccess(10, 
TimeUnit.MINUTES)
                                                     .build();
@@ -127,6 +133,8 @@ public class MetadataSegmentView
     log.info("MetadataSegmentView is stopping.");
     if (isCacheEnabled) {
       scheduledExec.shutdown();
+      publishedSegments = null;
+      segmentIdToReplicationFactor.invalidateAll();
     }
     log.info("MetadataSegmentView is stopped.");
   }
@@ -134,10 +142,8 @@ public class MetadataSegmentView
   private void poll()
   {
     log.info("Polling segments from coordinator");
-    final CloseableIterator<SegmentStatusInCluster> metadataSegments = 
getMetadataSegments(
-        coordinatorClient,
-        segmentWatcherConfig.getWatchedDataSources()
-    );
+    final Stopwatch syncTime = Stopwatch.createStarted();
+    final CloseableIterator<SegmentStatusInCluster> metadataSegments = 
fetchSegmentMetadataFromCoordinator();
 
     final ImmutableSortedSet.Builder<SegmentStatusInCluster> builder = 
ImmutableSortedSet.naturalOrder();
     while (metadataSegments.hasNext()) {
@@ -160,31 +166,36 @@ public class MetadataSegmentView
     }
     publishedSegments = builder.build();
     cachePopulated.countDown();
+    emitter.emit(
+        ServiceMetricEvent.builder().setMetric(Metric.SYNC_DURATION_MILLIS, 
syncTime.millisElapsed())
+    );
   }
 
+  /**
+   * Returns segment metadata either from the in-memory cache (enabled using
+   * {@link BrokerSegmentMetadataCacheConfig#isMetadataSegmentCacheEnable()})
+   * OR by querying the Coordinator on the fly.
+   */
   Iterator<SegmentStatusInCluster> getSegments()
   {
     if (isCacheEnabled) {
       Uninterruptibles.awaitUninterruptibly(cachePopulated);
       return publishedSegments.iterator();
     } else {
-      return getMetadataSegments(
-          coordinatorClient,
-          segmentWatcherConfig.getWatchedDataSources()
-      );
+      return fetchSegmentMetadataFromCoordinator();
     }
   }
 
   // Note that coordinator must be up to get segments
-  private CloseableIterator<SegmentStatusInCluster> getMetadataSegments(
-      CoordinatorClient coordinatorClient,
-      Set<String> watchedDataSources
-  )
+  private CloseableIterator<SegmentStatusInCluster> 
fetchSegmentMetadataFromCoordinator()
   {
     // includeRealtimeSegments flag would additionally request realtime 
segments
     // note that realtime segments are returned only when 
druid.centralizedDatasourceSchema.enabled is set on the Coordinator
     return FutureUtils.getUnchecked(
-        
coordinatorClient.fetchAllUsedSegmentsWithOvershadowedStatus(watchedDataSources,
 true),
+        coordinatorClient.fetchAllUsedSegmentsWithOvershadowedStatus(
+            segmentWatcherConfig.getWatchedDataSources(),
+            true
+        ),
         true
     );
   }
diff --git 
a/sql/src/test/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfigTest.java
 
b/sql/src/test/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfigTest.java
index 3efb9d1ea5a..811f99adf06 100644
--- 
a/sql/src/test/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfigTest.java
+++ 
b/sql/src/test/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfigTest.java
@@ -50,7 +50,7 @@ public class BrokerSegmentMetadataCacheConfigTest
     provider.inject(properties, injector.getInstance(JsonConfigurator.class));
     final BrokerSegmentMetadataCacheConfig config = provider.get();
     Assert.assertTrue(config.isAwaitInitializationOnStart());
-    Assert.assertFalse(config.isMetadataSegmentCacheEnable());
+    Assert.assertTrue(config.isMetadataSegmentCacheEnable());
     Assert.assertEquals(Period.minutes(1), config.getMetadataRefreshPeriod());
     Assert.assertEquals(new 
AbstractSegmentMetadataCache.LeastRestrictiveTypeMergePolicy(), 
config.getMetadataColumnTypeMergePolicy());
   }
@@ -70,6 +70,7 @@ public class BrokerSegmentMetadataCacheConfigTest
     );
     properties.setProperty(CONFIG_BASE + ".metadataRefreshPeriod", "PT2M");
     properties.setProperty(CONFIG_BASE + ".awaitInitializationOnStart", 
"false");
+    properties.setProperty(CONFIG_BASE + ".metadataSegmentCacheEnable", 
"false");
     provider.inject(properties, injector.getInstance(JsonConfigurator.class));
     final BrokerSegmentMetadataCacheConfig config = provider.get();
     Assert.assertFalse(config.isAwaitInitializationOnStart());
diff --git 
a/sql/src/test/java/org/apache/druid/sql/calcite/schema/MetadataSegmentViewTest.java
 
b/sql/src/test/java/org/apache/druid/sql/calcite/schema/MetadataSegmentViewTest.java
new file mode 100644
index 00000000000..08b8d111b96
--- /dev/null
+++ 
b/sql/src/test/java/org/apache/druid/sql/calcite/schema/MetadataSegmentViewTest.java
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.sql.calcite.schema;
+
+import com.google.common.collect.Iterators;
+import com.google.common.util.concurrent.Futures;
+import org.apache.druid.client.BrokerSegmentWatcherConfig;
+import org.apache.druid.client.coordinator.CoordinatorClient;
+import org.apache.druid.java.util.common.CloseableIterators;
+import org.apache.druid.java.util.metrics.NoopTaskHolder;
+import org.apache.druid.metadata.segment.cache.Metric;
+import org.apache.druid.segment.TestDataSource;
+import org.apache.druid.server.coordinator.CreateDataSegments;
+import org.apache.druid.server.metrics.LatchableEmitter;
+import org.apache.druid.server.metrics.LatchableEmitterConfig;
+import org.apache.druid.timeline.SegmentStatusInCluster;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentMatchers;
+import org.mockito.Mockito;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MetadataSegmentViewTest
+{
+  private MetadataSegmentView segmentView;
+  private LatchableEmitter emitter;
+  private CoordinatorClient coordinatorClient;
+
+  @BeforeEach
+  public void setup()
+  {
+    coordinatorClient = Mockito.mock(CoordinatorClient.class);
+    emitter = new LatchableEmitter("", "", new LatchableEmitterConfig(null), 
new NoopTaskHolder());
+    segmentView = new MetadataSegmentView(
+        coordinatorClient,
+        new BrokerSegmentWatcherConfig(),
+        new BrokerSegmentMetadataCacheConfig()
+        {
+          @Override
+          public long getMetadataSegmentPollPeriod()
+          {
+            return 100;
+          }
+        },
+        emitter
+    );
+  }
+
+  @Test
+  public void test_start_triggersSegmentPollFromCoordinator_ifCacheIsEnabled()
+  {
+    // Set up the mock CoordinatorClient to return the expected list of 
segments
+    final List<SegmentStatusInCluster> expectedSegments = CreateDataSegments
+        .ofDatasource(TestDataSource.WIKI)
+        .withNumPartitions(10)
+        .eachOfSizeInMb(100)
+        .stream()
+        .map(s -> new SegmentStatusInCluster(s, false, 1, 100L, false))
+        .toList();
+
+    Mockito.when(
+        coordinatorClient.fetchAllUsedSegmentsWithOvershadowedStatus(
+            ArgumentMatchers.eq(null),
+            ArgumentMatchers.eq(true)
+        )
+    ).thenReturn(
+        
Futures.immediateFuture(CloseableIterators.withEmptyBaggage(expectedSegments.iterator()))
+    );
+
+    // Start the test target and wait for it to sync with the Coordinator
+    segmentView.start();
+    emitter.waitForEvent(event -> 
event.hasMetricName(Metric.SYNC_DURATION_MILLIS));
+
+    final List<SegmentStatusInCluster> observedSegments = new ArrayList<>();
+    Iterators.addAll(observedSegments, segmentView.getSegments());
+    Assertions.assertEquals(10, observedSegments.size());
+    Assertions.assertEquals(expectedSegments, observedSegments);
+  }
+}
diff --git 
a/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTests.java 
b/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTests.java
index 069b4ead356..b0e72b2af9c 100644
--- a/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTests.java
+++ b/sql/src/test/java/org/apache/druid/sql/calcite/util/CalciteTests.java
@@ -51,6 +51,7 @@ import 
org.apache.druid.java.util.common.parsers.CloseableIterator;
 import org.apache.druid.java.util.http.client.HttpClient;
 import org.apache.druid.java.util.http.client.Request;
 import org.apache.druid.java.util.http.client.response.HttpResponseHandler;
+import org.apache.druid.java.util.metrics.StubServiceEmitter;
 import org.apache.druid.math.expr.ExprMacroTable;
 import org.apache.druid.query.QueryRunnerFactoryConglomerate;
 import org.apache.druid.query.QuerySegmentWalker;
@@ -412,7 +413,8 @@ public class CalciteTests
         new MetadataSegmentView(
             coordinatorClient,
             new BrokerSegmentWatcherConfig(),
-            BrokerSegmentMetadataCacheConfig.create()
+            BrokerSegmentMetadataCacheConfig.create(),
+            new StubServiceEmitter()
         ),
         timelineServerView,
         new FakeServerInventoryView(),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to