From 3191fa22fc034ce4a33ced66bdbcacc8c5f58bbb Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Tue, 21 Feb 2023 22:00:43 +0800 Subject: [PATCH] [KYUUBI #4106][FOLLOWUP] Rename conf key of uploaded batch resource ### _Why are the changes needed?_ As discussed https://github.com/apache/kyuubi/pull/4144#discussion_r1112957149, we should put the conf key into namespace `kyuubi.batch.` ### _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.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request Closes #4394 from pan3793/4106-followup. Closes #4106 27c9ed870 [Cheng Pan] nit 66283ac4b [Cheng Pan] [KYUUBI #4106][FOLLOUP] Rename conf key of uploaded batch resource Authored-by: Cheng Pan Signed-off-by: Cheng Pan --- .../scala/org/apache/kyuubi/config/KyuubiReservedKeys.scala | 2 +- .../scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala | 2 +- .../org/apache/kyuubi/session/KyuubiBatchSessionImpl.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiReservedKeys.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiReservedKeys.scala index 335253925..dfbdd9449 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiReservedKeys.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiReservedKeys.scala @@ -25,8 +25,8 @@ object KyuubiReservedKeys { final val KYUUBI_SESSION_SIGN_PUBLICKEY = "kyuubi.session.sign.publickey" final val KYUUBI_SESSION_USER_SIGN = "kyuubi.session.user.sign" final val KYUUBI_SESSION_REAL_USER_KEY = "kyuubi.session.real.user" - final val KYUUBI_SESSION_BATCH_RESOURCE_UPLOADED_KEY = "kyuubi.session.batch.resource.uploaded" final val KYUUBI_SESSION_CONNECTION_URL_KEY = "kyuubi.session.connection.url" + final val KYUUBI_BATCH_RESOURCE_UPLOADED_KEY = "kyuubi.batch.resource.uploaded" final val KYUUBI_STATEMENT_ID_KEY = "kyuubi.statement.id" final val KYUUBI_ENGINE_ID = "kyuubi.engine.id" final val KYUUBI_ENGINE_NAME = "kyuubi.engine.name" diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala index d308c26d5..924e7b89c 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/api/v1/BatchesResource.scala @@ -214,10 +214,10 @@ private[v1] class BatchesResource extends ApiRequestContext with Logging { val ipAddress = fe.getIpAddress request.setConf( (request.getConf.asScala ++ Map( + KYUUBI_BATCH_RESOURCE_UPLOADED_KEY -> isResourceFromUpload.toString, KYUUBI_CLIENT_IP_KEY -> ipAddress, KYUUBI_SERVER_IP_KEY -> fe.host, KYUUBI_SESSION_CONNECTION_URL_KEY -> fe.connectionUrl, - KYUUBI_SESSION_BATCH_RESOURCE_UPLOADED_KEY -> isResourceFromUpload.toString, KYUUBI_SESSION_REAL_USER_KEY -> fe.getRealUser())).asJava) val sessionHandle = sessionManager.openBatchSession( userName, diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSessionImpl.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSessionImpl.scala index 5ed851ce0..7864d61f3 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSessionImpl.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiBatchSessionImpl.scala @@ -79,7 +79,7 @@ class KyuubiBatchSessionImpl( // whether the resource file is from uploading private[kyuubi] val isResourceUploaded: Boolean = batchRequest.getConf - .getOrDefault(KyuubiReservedKeys.KYUUBI_SESSION_BATCH_RESOURCE_UPLOADED_KEY, "false").toBoolean + .getOrDefault(KyuubiReservedKeys.KYUUBI_BATCH_RESOURCE_UPLOADED_KEY, "false").toBoolean private[kyuubi] lazy val batchJobSubmissionOp = sessionManager.operationManager .newBatchJobSubmissionOperation(