Browse Source

LIVY-140. Change RSC's URI scheme from "local" to "rsc".

Closes #130
Marcelo Vanzin 9 years ago
parent
commit
ed8585c450

+ 1 - 1
repl/src/test/scala/com/cloudera/livy/repl/ReplDriverSuite.scala

@@ -44,7 +44,7 @@ class ReplDriverSuite extends FunSuite {
       .setConf(SparkLauncher.DRIVER_EXTRA_CLASSPATH, sys.props("java.class.path"))
       .setConf(SparkLauncher.EXECUTOR_EXTRA_CLASSPATH, sys.props("java.class.path"))
       .setConf(RSCConf.Entry.LIVY_JARS.key(), "")
-      .setURI(new URI("local:spark"))
+      .setURI(new URI("rsc:/"))
       .setConf(RSCConf.Entry.DRIVER_CLASS.key(), classOf[ReplDriver].getName())
       .setConf(RSCConf.Entry.SESSION_KIND.key(), Spark().toString)
       .build()

+ 2 - 2
rsc/src/main/java/com/cloudera/livy/rsc/RSCClientFactory.java

@@ -38,7 +38,7 @@ public final class RSCClientFactory implements LivyClientFactory {
   private RpcServer server = null;
 
   /**
-   * Creates a local Livy client if the URI has the "local" scheme.
+   * Creates a local Livy client if the URI has the "rsc" scheme.
    * <p>
    * If the URI contains user information, host and port, the library will try to connect to an
    * existing RSC instance with the provided information, and most of the provided configuration
@@ -48,7 +48,7 @@ public final class RSCClientFactory implements LivyClientFactory {
    */
   @Override
   public LivyClient createClient(URI uri, Properties config) {
-    if (!"local".equals(uri.getScheme())) {
+    if (!"rsc".equals(uri.getScheme())) {
       return null;
     }
 

+ 2 - 2
rsc/src/test/java/com/cloudera/livy/rsc/TestSparkClient.java

@@ -288,7 +288,7 @@ public class TestSparkClient {
       @Override
       void call(LivyClient client) throws Exception {
         ContextInfo ctx = ((RSCClient) client).getContextInfo();
-        URI uri = new URI(String.format("local://%s:%s@%s:%d", ctx.clientId, ctx.secret,
+        URI uri = new URI(String.format("rsc://%s:%s@%s:%d", ctx.clientId, ctx.secret,
           ctx.remoteAddress, ctx.remotePort));
 
         // Close the old client to make sure the driver doesn't go away when it disconnects.
@@ -384,7 +384,7 @@ public class TestSparkClient {
     LivyClient client = null;
     try {
       test.config(conf);
-      client = new LivyClientBuilder(false).setURI(new URI("local:spark"))
+      client = new LivyClientBuilder(false).setURI(new URI("rsc:/"))
         .setAll(conf)
         .build();
 

+ 1 - 1
server/src/main/scala/com/cloudera/livy/server/interactive/InteractiveSession.scala

@@ -74,7 +74,7 @@ class InteractiveSession(
       .setAll(Option(request.conf).map(_.asJava).getOrElse(new JHashMap()))
       .setConf("livy.client.sessionId", id.toString)
       .setConf(RSCConf.Entry.DRIVER_CLASS.key(), "com.cloudera.livy.repl.ReplDriver")
-      .setURI(new URI("local:spark"))
+      .setURI(new URI("rsc:/"))
 
     kind match {
       case PySpark() =>