@@ -19,14 +19,13 @@ package org.apache.zeppelin.scio
1919
2020import java .beans .Introspector
2121import java .io .PrintStream
22- import java .util
22+ import java .net . URL
2323import java .util .Properties
2424
2525import com .google .cloud .dataflow .sdk .options .{PipelineOptions , PipelineOptionsFactory }
2626import com .google .cloud .dataflow .sdk .runners .inprocess .InProcessPipelineRunner
2727import com .spotify .scio .repl .{ScioILoop , ScioReplClassLoader }
2828import org .apache .zeppelin .interpreter .Interpreter .FormType
29- import org .apache .zeppelin .interpreter .thrift .InterpreterCompletion
3029import org .apache .zeppelin .interpreter .util .InterpreterOutputStream
3130import org .apache .zeppelin .interpreter .{Interpreter , InterpreterContext , InterpreterResult }
3231import org .slf4j .LoggerFactory
@@ -70,11 +69,8 @@ class ScioInterpreter(property: Properties) extends Interpreter(property) {
7069
7170 val settings = new Settings ()
7271
73- // For scala 2.10 - usejavacp
74- if (scala.util.Properties .versionString.contains(" 2.10." )) {
75- settings.classpath.append(System .getProperty(" java.class.path" ))
76- settings.usejavacp.value = true
77- }
72+ settings.classpath.append(System .getProperty(" java.class.path" ))
73+ settings.usejavacp.value = true
7874
7975 def classLoaderURLs (cl : ClassLoader ): Array [java.net.URL ] = cl match {
8076 case null => Array ()
@@ -90,22 +86,24 @@ class ScioInterpreter(property: Properties) extends Interpreter(property) {
9086 // itself to -Xplugin. If shell is started from sbt or classpath, paradise jar has to be in
9187 // classpath, we find it and add it to -Xplugin.
9288
93- // Repl assembly includes paradise's scalac-plugin.xml - required for BigQuery macro
94- // There should be no harm if we keep this for sbt launch.
9589 val thisJar = this .getClass.getProtectionDomain.getCodeSource.getLocation.getPath
9690 // In some cases this may be `target/classes`
9791 if (thisJar.endsWith(" .jar" )) settings.plugin.appendToValue(thisJar)
9892
99- ClassPath .split(settings.classpath.value)
93+ ClassPath
94+ .split(settings.classpath.value)
10095 .find(File (_).name.startsWith(" paradise_" ))
10196 .foreach(settings.plugin.appendToValue)
10297
10398 // Force the repl to be synchronous, so all cmds are executed in the same thread
10499 settings.Yreplsync .value = true
105100
101+ val jars = ClassPath .split(settings.classpath.value)
102+ .flatMap(ClassPath .specToURL)
103+ .toArray
104+
106105 val scioClassLoader = new ScioReplClassLoader (
107- ClassPath .toURLs(settings.classpath.value).toArray ++
108- classLoaderURLs(Thread .currentThread().getContextClassLoader),
106+ jars ++ classLoaderURLs(Thread .currentThread().getContextClassLoader),
109107 null ,
110108 Thread .currentThread.getContextClassLoader)
111109
0 commit comments