Ver Fonte

[livy] Add support for batch proxy users

Erick Tryzelaar há 10 anos atrás
pai
commit
d7639e6

+ 1 - 0
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionManager.scala

@@ -55,6 +55,7 @@ class BatchManager(batchFactory: BatchSessionFactory) {
 }
 
 case class CreateBatchRequest(file: String,
+                              proxyUser: Option[String] = None,
                               args: List[String] = List(),
                               className: Option[String] = None,
                               jars: List[String] = List(),

+ 1 - 0
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionProcess.scala

@@ -47,6 +47,7 @@ object BatchSessionProcess {
     createBatchRequest.executorMemory.foreach(builder.executorMemory)
     createBatchRequest.executorCores.foreach(builder.executorCores)
     createBatchRequest.archives.map(RelativePath).foreach(builder.archive)
+    createBatchRequest.proxyUser.foreach(builder.proxyUser)
 
     builder.redirectOutput(Redirect.PIPE)
 

+ 1 - 0
apps/spark/java/livy-server/src/main/scala/com/cloudera/hue/livy/server/batch/BatchSessionYarn.scala

@@ -50,6 +50,7 @@ object BatchSessionYarn {
 
     builder.master("yarn-cluster")
 
+    createBatchRequest.proxyUser.foreach(builder.proxyUser)
     createBatchRequest.className.foreach(builder.className)
     createBatchRequest.jars.map(RelativePath).foreach(builder.jar)
     createBatchRequest.pyFiles.map(RelativePath).foreach(builder.pyFile)