fsk119 commented on code in PR #26654: URL: https://github.com/apache/flink/pull/26654#discussion_r2139024312
########## flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/config/MLPredictRuntimeConfigOptions.java: ########## @@ -0,0 +1,84 @@ +/* + * 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.flink.table.api.config; + +import org.apache.flink.annotation.PublicEvolving; +import org.apache.flink.configuration.ConfigOption; + +import org.apache.flink.shaded.guava33.com.google.common.collect.ImmutableSet; + +import java.time.Duration; +import java.util.HashSet; +import java.util.Set; + +import static org.apache.flink.configuration.ConfigOptions.key; + +/** + * This class holds option name definitions for ML_PREDICT runtime config based on {@link + * ConfigOption}. + */ +@PublicEvolving +public class MLPredictRuntimeConfigOptions { + + public static final ConfigOption<Boolean> ASYNC = + key("async") + .booleanType() + .noDefaultValue() + .withDescription( + "Value can be 'true' or 'false' to suggest the planner choose the corresponding" + + " predict function. If the backend predict function provider does not support the" + + " suggested mode, it will take no effect."); + + public static final ConfigOption<ExecutionConfigOptions.AsyncOutputMode> ASYNC_OUTPUT_MODE = + key("output-mode") + .enumType(ExecutionConfigOptions.AsyncOutputMode.class) + .noDefaultValue() + .withDescription( + "Output mode for asynchronous operations which will convert to {@see AsyncDataStream.OutputMode}, ORDERED by default. " + + "If set to ALLOW_UNORDERED, will attempt to use {@see AsyncDataStream.OutputMode.UNORDERED} when it does not " + + "affect the correctness of the result, otherwise ORDERED will be still used."); + + public static final ConfigOption<Integer> ASYNC_CAPACITY = + key("capacity") + .intType() + .noDefaultValue() + .withDescription( + "The max number of async i/o operation that the async ml predict can trigger."); + + public static final ConfigOption<Duration> ASYNC_TIMEOUT = + key("timeout") + .durationType() + .noDefaultValue() + .withDescription( + "Timeout from first invoke to final completion of asynchronous operation, may include multiple" + + " retries, and will be reset in case of failover."); + + private static final Set<ConfigOption<?>> supportedKeys = new HashSet<>(); + + static { + supportedKeys.add(ASYNC); + supportedKeys.add(ASYNC_OUTPUT_MODE); + supportedKeys.add(ASYNC_CAPACITY); + supportedKeys.add(ASYNC_TIMEOUT); Review Comment: Yes. We need to support retry in the https://issues.apache.org/jira/browse/FLINK-37940. But I think it's not an easy work. In the current design, we miss some mechanism let the framework knows when to retry the operation. -- 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]
