You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2022/07/13 09:20:01 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #3055] Expose client ip address into batch request conf

This is an automated email from the ASF dual-hosted git repository.

feiwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c3a9ed0b [KYUUBI #3055] Expose client ip address into batch request conf
4c3a9ed0b is described below

commit 4c3a9ed0bb33aef5fb5d7f018b3c014c3784096a
Author: Fei Wang <fw...@ebay.com>
AuthorDate: Wed Jul 13 17:19:52 2022 +0800

    [KYUUBI #3055] Expose client ip address into batch request conf
    
    ### _Why are the changes needed?_
    
    Append the client ip address into batch conf, so that we can know that where the batch request come from on spark UI.
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
    
    Closes #3055 from turboFei/batch_client_ip.
    
    Closes #3055
    
    0d10ff8a [Fei Wang] prevent unsupported exception
    dee5b4dc [Fei Wang] Append client ip address conf into batch session
    
    Authored-by: Fei Wang <fw...@ebay.com>
    Signed-off-by: Fei Wang <fw...@ebay.com>
---
 .../src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala
index 99265c6bc..ef93e4d3c 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionManager.scala
@@ -114,6 +114,7 @@ class KyuubiSessionManager private (name: String) extends SessionManager(name) {
       batchRequest: BatchRequest,
       recoveryMetadata: Option[Metadata] = None): KyuubiBatchSessionImpl = {
     val username = Option(user).filter(_.nonEmpty).getOrElse("anonymous")
+    batchRequest.setConf((batchRequest.getConf.asScala ++ Map(CLIENT_IP_KEY -> ipAddress)).asJava)
     new KyuubiBatchSessionImpl(
       username,
       password,