okumin commented on code in PR #5924:
URL: https://github.com/apache/hive/pull/5924#discussion_r2203171507


##########
standalone-metastore/metastore-client/src/main/java/org/apache/hadoop/hive/metastore/client/builder/HiveMetaStoreClientBuilder.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.hadoop.hive.metastore.client.builder;
+
+import com.google.common.base.Preconditions;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.HiveMetaHookLoader;
+import org.apache.hadoop.hive.metastore.HiveMetaStoreClient;
+import org.apache.hadoop.hive.metastore.IMetaStoreClient;
+import org.apache.hadoop.hive.metastore.RetryingMetaStoreClient;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.client.HookEnabledMetaStoreClient;
+import org.apache.hadoop.hive.metastore.client.SynchronizedMetaStoreClient;
+import org.apache.hadoop.hive.metastore.client.ThriftHiveMetaStoreClient;
+
+import java.util.Map;
+import java.util.function.Function;
+
+public class HiveMetaStoreClientBuilder {
+
+    private final Configuration conf;
+    private IMetaStoreClient client;
+
+    public HiveMetaStoreClientBuilder(Configuration conf) {
+        Preconditions.checkNotNull(conf);
+        this.conf = conf;

Review Comment:
   You can simplify it with one-line like `this.conf = 
Preconditions.checkNotNull(conf)`. I prefer `Objects.requireNonNull` for new 
code, though.



##########
metastore/src/java/org/apache/hadoop/hive/metastore/HiveClientCache.java:
##########
@@ -107,7 +107,7 @@ public HiveClientCache(final int timeout) {
   /**
    * @param timeout the length of time in seconds after a client is created 
that it should be automatically removed
    */
-  private HiveClientCache(final int timeout, final int initialCapacity, final 
int maxCapacity, final boolean enableStats) {
+  protected HiveClientCache(final int timeout, final int initialCapacity, 
final int maxCapacity, final boolean enableStats) {

Review Comment:
   Is it simpler to make this public and directly instantiate HiveClientCache 
in HCatUtil?



-- 
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

Reply via email to