[
https://issues.apache.org/jira/browse/HIVE-26670?focusedWorklogId=821315&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-821315
]
ASF GitHub Bot logged work on HIVE-26670:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Oct/22 07:11
Start Date: 28/Oct/22 07:11
Worklog Time Spent: 10m
Work Description: abstractdog commented on code in PR #3710:
URL: https://github.com/apache/hive/pull/3710#discussion_r1007715344
##########
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:
yeah, should be private or protected non-static, I'll change
regarding logger: yeah, I admit I haven't investigated why log messages from
this class don't make their way to the console, it's mostly because of log4j
config, I'm checking it first, however, considering your point: using
request/response interceptors looks a natural extension of the HiveConnection
itself (e.g. they're instantiated there)
Issue Time Tracking
-------------------
Worklog Id: (was: 821315)
Time Spent: 1h 50m (was: 1h 40m)
> Track every single HTTP request between beeline and hs2
> -------------------------------------------------------
>
> Key: HIVE-26670
> URL: https://issues.apache.org/jira/browse/HIVE-26670
> Project: Hive
> Issue Type: Improvement
> Reporter: László Bodor
> Assignee: László Bodor
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> In my use-case there is a couple of layers between beeline and hs2 (load
> balancer, proxies), and I'm about to add something to the requests
> (optionally), that can be simply written to access logs in as many layers as
> possible.
> So instead of:
> {code}
> 2022-10-18T04:34:25+00:00 - [10.80.143.240, 10.80.143.240] - [hs2 host] - [-]
> "POST /cliservice HTTP/1.1" 200 1069 "-" "Java/THttpClient/HC" 703 0.008...
> {code}
> I want to see something specific to the request, which is generated on client
> side, so client can also log it.
> As the title suggests, I'm targeting http transport.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)