Repository: incubator-livy
Updated Branches:
  refs/heads/master c8cfe2994 -> e2d2189f4

[LIVY-479] Enable livy.rsc.launcher.address configuration

## What changes were proposed in this pull request?
In current code we are setting livy.rsc.launcher.address to RPC server and 
ignoring whatever is specified in configs. However in some scenarios there is a 
need for the user to be able to explicitly configure it. For example, the IP 
address for an active Livy server might change over the time, so rather than 
using the fixed IP address, we need to specify this setting to a more generic 
host name. For this reason, we want to enable the capability of user side 


## How was this patch tested?
Manual tests by changing "livy.rsc.launcher.address" and verified the setting 
took effect

Author: Tao Li <>

Closes #101 from taoliseki/LIVY-479.


Branch: refs/heads/master
Commit: e2d2189f4fb000e0113befa03db16916f94e03bb
Parents: c8cfe29
Author: Tao Li <>
Authored: Wed Dec 19 14:17:51 2018 -0800
Committer: Marcelo Vanzin <>
Committed: Wed Dec 19 14:17:51 2018 -0800

 rsc/src/main/java/org/apache/livy/rsc/ | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/rsc/src/main/java/org/apache/livy/rsc/ 
index c7c5bc4..5a819d5 100644
--- a/rsc/src/main/java/org/apache/livy/rsc/
+++ b/rsc/src/main/java/org/apache/livy/rsc/
@@ -97,7 +97,13 @@ class ContextLauncher {
       String replMode = conf.get("repl");
       boolean repl = replMode != null && replMode.equals("true");
-      conf.set(LAUNCHER_ADDRESS, factory.getServer().getAddress());
+      // In some scenarios the user may need to configure this endpoint 
setting explicitly.
+      String address = conf.get(LAUNCHER_ADDRESS);
+      // If not specified, use the RPC server address; otherwise use the 
specified address.
+      if (address == null || address.trim().isEmpty()) {
+        address = factory.getServer().getAddress();
+      }
+      conf.set(LAUNCHER_ADDRESS, address);
       conf.set(LAUNCHER_PORT, factory.getServer().getPort());
       conf.set(CLIENT_ID, clientId);
       conf.set(CLIENT_SECRET, secret);

Reply via email to