Jzjsnow commented on code in PR #3423: URL: https://github.com/apache/amoro/pull/3423#discussion_r1942668261
########## amoro-ams/src/test/java/org/apache/amoro/server/TestAmoroManagementConf.java: ########## @@ -0,0 +1,134 @@ +/* + * 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.amoro.server; + +import static org.apache.amoro.server.AmoroServiceContainer.expandConfigMap; + +import org.apache.amoro.config.ConfigOption; +import org.apache.amoro.config.Configurations; +import org.apache.amoro.shade.guava32.com.google.common.collect.ImmutableMap; +import org.apache.amoro.shade.guava32.com.google.common.collect.Maps; +import org.apache.amoro.shade.guava32.com.google.common.io.Resources; +import org.apache.amoro.shade.jackson2.com.fasterxml.jackson.core.type.TypeReference; +import org.apache.amoro.shade.jackson2.com.fasterxml.jackson.databind.JsonNode; +import org.apache.amoro.utils.JacksonUtil; +import org.apache.amoro.utils.MemorySize; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.yaml.snakeyaml.Yaml; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.Duration; +import java.util.Map; + +public class TestAmoroManagementConf { + private static final ConfigOption<Duration>[] TIME_RELATED_CONFIG_OPTIONS = Review Comment: I have added a unit test to parse the old version of the config file in the latest commit. The parsing result is as expected after adding a unit suffix to the original values of the old config file, which might serve as a reference for the upgrade scripts. ########## amoro-ams/src/main/java/org/apache/amoro/server/AmoroManagementConf.java: ########## @@ -342,16 +343,16 @@ public class AmoroManagementConf { .defaultValue(1000L) .withDescription("Max wait time before getting a connection timeout."); - public static final ConfigOption<Long> OPTIMIZER_HB_TIMEOUT = + public static final ConfigOption<Duration> OPTIMIZER_HB_TIMEOUT = ConfigOptions.key("optimizer.heart-beat-timeout") - .longType() - .defaultValue(60000L) + .durationType() + .defaultValue(Duration.ofMinutes(1)) .withDescription("Timeout duration for Optimizer heartbeat."); - public static final ConfigOption<Long> OPTIMIZER_TASK_ACK_TIMEOUT = + public static final ConfigOption<Duration> OPTIMIZER_TASK_ACK_TIMEOUT = ConfigOptions.key("optimizer.task-ack-timeout") - .longType() - .defaultValue(30000L) + .durationType() + .defaultValue(Duration.ofSeconds(30)) Review Comment: Not exactly, the default unit for all time-related configuration items is currently milliseconds, which is consistent with the pre-commit default unit, except for the configuration item `terminal.session.timeout`. For `terminal.session.timeout`, the default unit is minutes before this commit and milliseconds after the commit. I think this change should be highlighted in the release logs or upgrade scripts indeed. -- 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]
