abstractdog commented on code in PR #4566: URL: https://github.com/apache/hive/pull/4566#discussion_r1398821824
########## standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/ConditionalCommand.java: ########## @@ -0,0 +1,43 @@ +/* + * 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.hadoop.hive.metastore.txn.jdbc; + +import org.apache.hadoop.hive.metastore.DatabaseProduct; + +/** + * {@link ParameterizedCommand}. {@link ParameterizedBatchCommand}, and {@link InClauseBatchCommand} implementations can also + * implement this interface, marking that the execution is conditial, and the command wants to get notified about + * execution errors. Can be used to implement commands depending on some feature flag(s). + */ +public interface ConditionalCommand { + + /** + * Indicates if the command should be executed or not + * @param databaseProduct + * @return Returns true if the command can be executed, false otherwise. + */ + boolean shouldUse(DatabaseProduct databaseProduct); Review Comment: I know, grammar nit, but this is an interface, should be as obvious as possible, so this is a command, that should run or not, right? in this case "use" as an active verb is misleading, should be "shouldBeUsed" or rather "shouldRun", because this command should be used / this command should run -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org