rdblue commented on a change in pull request #166: Update Hive Metastore tables for Spark URL: https://github.com/apache/incubator-iceberg/pull/166#discussion_r280137344
########## File path: hive/src/main/java/org/apache/iceberg/hive/ClientPool.java ########## @@ -0,0 +1,141 @@ +/* + * 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; + +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.Closeable; +import java.io.IOException; +import java.util.Deque; +import java.util.function.Consumer; + +abstract class ClientPool<C, E extends Exception> implements Closeable { Review comment: I don't think I agree about using `AutoCloseable`. Two reasons: 1. Close will close client connections, which do release IO streams. So this is an IO stream close. 2. Even if `AutoCloseable` were a better fit for exceptions, `Closeable` is the one more often used. I even wrote the initial version of close by checking whether a client implemented `Closeable` to call close. That wouldn't work with `AutoCloseable`. I don't think people actually think to use `AutoCloseable` in those cases, so implementing `Closeable` is more likely to work. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
