cnauroth commented on code in PR #3710:
URL: https://github.com/apache/hive/pull/3710#discussion_r1007678514
##########
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java:
##########
@@ -182,6 +184,7 @@ public class HiveConnection implements java.sql.Connection {
private Subject loggedInSubject;
private int maxRetries = 1;
private IJdbcBrowserClient browserClient;
+ private Map<String, String> additionalHttpHeaders = new HashMap<String,
String>();
Review Comment:
Was it necessary to promote this to a class member? It appears that usage is
still limited to one method: `getHttpClient`.
##########
jdbc/src/java/org/apache/hive/jdbc/HttpResponseInterceptorBase.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.hive.jdbc;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hive.conf.Constants;
+import org.apache.http.HttpException;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
+import org.apache.http.protocol.HttpContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HttpResponseInterceptorBase implements HttpResponseInterceptor {
Review Comment:
Is "Base" the correct naming for this class? In contrast,
`HttpRequestInterceptorBase` is an abstract class that a few different classes
extend.
##########
jdbc/src/java/org/apache/hive/jdbc/HttpRequestInterceptorBase.java:
##########
@@ -19,21 +19,33 @@
package org.apache.hive.jdbc;
import java.io.IOException;
+import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Supplier;
+import org.apache.hadoop.hive.conf.Constants;
import org.apache.http.Header;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.client.CookieStore;
import org.apache.http.protocol.HttpContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public abstract class HttpRequestInterceptorBase implements
HttpRequestInterceptor {
+ public static final Logger LOG =
LoggerFactory.getLogger(HiveConnection.class.getName());
Review Comment:
Can this be made `private`? Also, is it intentional that this class is
reusing the `HiveConnection` logger? (Are you looking at
`HttpRequestInterceptorBase` as a natural extension of `HiveConnection` from a
logging perspective?)
##########
jdbc/src/java/org/apache/hive/jdbc/HttpResponseInterceptorBase.java:
##########
@@ -0,0 +1,44 @@
+/*
+ * 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.hive.jdbc;
+
+import java.io.IOException;
+
+import org.apache.hadoop.hive.conf.Constants;
+import org.apache.http.HttpException;
+import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
+import org.apache.http.protocol.HttpContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HttpResponseInterceptorBase implements HttpResponseInterceptor {
+ public static final Logger LOG =
LoggerFactory.getLogger(HiveConnection.class.getName());
Review Comment:
Similar comment here: can this be `final`, and is it intentional to reuse
the `HiveConnection` logger?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]