findingrish commented on code in PR #14985: URL: https://github.com/apache/druid/pull/14985#discussion_r1372565864
########## sql/src/main/java/org/apache/druid/sql/calcite/schema/BrokerSegmentMetadataCacheConfig.java: ########## @@ -0,0 +1,106 @@ +/* + * 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.fasterxml.jackson.annotation.JsonProperty; +import org.apache.druid.segment.metadata.SegmentMetadataCacheConfig; +import org.joda.time.Period; + +/** + * Broker-side configuration class for managing segment polling from the Coordinator and + * customizing properties related to the SegmentMetadata cache which is used to infer datasources for SQL. + * + * <p>See {@link BrokerSegmentMetadataCache}, {@link MetadataSegmentView}.</p> + * + * <p>This class shares the same config root as {@link org.apache.druid.sql.calcite.planner.PlannerConfig} + * to maintain backward compatibility for when the properties here resided in {@code PlannerConfig}.</p> + * + * <p> The property {@link #awaitInitializationOnStart} is overridden in this class with a default value + * of {@code true}, which differs from the parent class. This ensures that the SegmentMetadata cache is + * fully initialized before other startup processes proceed.</p> + */ +public class BrokerSegmentMetadataCacheConfig extends SegmentMetadataCacheConfig +{ + // A flag indicating whether to cache polled segments from the Coordinator. + @JsonProperty + private boolean metadataSegmentCacheEnable = false; + + // Interval for polling segments from the coordinator. + @JsonProperty + private long metadataSegmentPollPeriod = 60000; + + // A flag indicating whether to wait for cache initialization during startup. + @JsonProperty + private boolean awaitInitializationOnStart = true; + + @JsonProperty + private boolean disableSegmentMetadataQueries = false; Review Comment: This config is only needed for the integration test, wherein I disable the fallback mechanism in BrokerSegmentMetadataCache and thus ensure that table schema is built only in the Coordinator. -- 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]
