pvary commented on code in PR #6648: URL: https://github.com/apache/iceberg/pull/6648#discussion_r1085315791
########## hive-metastore/src/main/java/org/apache/iceberg/hive/HiveLock.java: ########## @@ -0,0 +1,27 @@ +/* + * 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.iceberg.hive; + +public interface HiveLock { + void lock() throws LockException; + + void ensureActive() throws LockException; + + void unlock(); +} Review Comment: In #6570 I have described my reasoning behind not using the existing `LockManager` interface: ----- We already have `LockManager` interface defined in the `iceberg-api` module. After some back-and-forth I decided against using it, because of the following reasons: - I do not think anyone would like to use HiveLockManager without HiveCatalog - The interface is not that useful for us: - We would need to keep track of the HMS lockId internally - We would need to update the LockManager if the `setConf` method is called on the HiveCatalog - We would need to add something like `ensureActive` to the interface which is needed for HiveTableOperations - The BaseLockManager does not provide too much of a functionality - The current configuration keys are different from the ones used by the LockManager implementations ----- @szehon-ho and @amogh-jahagirdar, I am happy to change the PR if we can find a good solution. Could you please help me what should be the main approach? - Shall we keep the `LockManager` as it is and create/use `HiveLockManager` with extra methods, or add `ensureAcitve` method to the `LockManger` interface? - Shall we keep the current config for the hive locks or shall we use the new ones instead, or keep both configs and create a deprecation handling for it? - Shall we use the `scheduler` for defined with the `BaseLockManager` and accept the possibility that if the pool is not big enough for the JVM then there will be no heartbeat for the new commits? Thanks, Peter -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org