mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Remove unused file
This commit is contained in:
parent
7a60b33553
commit
1ffca75945
3 changed files with 0 additions and 143 deletions
|
|
@ -1,54 +0,0 @@
|
|||
package com.nflabs.zeppelin.spark
|
||||
|
||||
import scala.tools.nsc._
|
||||
import scala.tools.nsc.interpreter._
|
||||
import org.apache.spark.repl.SparkILoop
|
||||
import org.apache.spark.repl.SparkIMain
|
||||
import org.apache.spark.util.Utils
|
||||
import java.io.BufferedReader
|
||||
import scala.tools.nsc.util.{ ClassPath, Exceptional, stringFromWriter, stringFromStream }
|
||||
|
||||
|
||||
class ReflectSparkILoop(in0: Option[BufferedReader], override protected val out: JPrintWriter, override val master: Option[String])
|
||||
extends SparkILoop(in0, out, master) {
|
||||
def this(in0: BufferedReader, out: JPrintWriter, master: String) = this(Some(in0), out, Some(master))
|
||||
def this(in0: BufferedReader, out: JPrintWriter) = this(Some(in0), out, None)
|
||||
def this() = this(None, new JPrintWriter(Console.out, true), None)
|
||||
|
||||
|
||||
class ReflectSparkILoopInterpreter extends ReflectSparkIMain(settings, out) {
|
||||
outer =>
|
||||
|
||||
override lazy val formatting = new Formatting {
|
||||
def prompt = ReflectSparkILoop.this.prompt
|
||||
}
|
||||
override protected def parentClassLoader = SparkHelper.explicitParentLoader(settings).getOrElse(classOf[SparkILoop].getClassLoader)
|
||||
}
|
||||
|
||||
/** Create a new interpreter. */
|
||||
override def createInterpreter() {
|
||||
require(settings != null)
|
||||
|
||||
if (addedClasspath != "") settings.classpath.append(addedClasspath)
|
||||
// work around for Scala bug
|
||||
val totalClassPath = SparkILoop.getAddedJars.foldLeft(
|
||||
settings.classpath.value)((l, r) => ClassPath.join(l, r))
|
||||
this.settings.classpath.value = totalClassPath
|
||||
|
||||
intp = new ReflectSparkILoopInterpreter
|
||||
}
|
||||
|
||||
/** Create a new interpreter. */
|
||||
def createReflectInterpreter(settings : Settings) : SparkIMain = {
|
||||
require(settings != null)
|
||||
|
||||
if (addedClasspath != "") settings.classpath.append(addedClasspath)
|
||||
// work around for Scala bug
|
||||
val totalClassPath = SparkILoop.getAddedJars.foldLeft(
|
||||
settings.classpath.value)((l, r) => ClassPath.join(l, r))
|
||||
this.settings.classpath.value = totalClassPath
|
||||
|
||||
intp = new ReflectSparkILoopInterpreter
|
||||
intp
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.nflabs.zeppelin.spark
|
||||
|
||||
import scala.tools.nsc._
|
||||
import scala.tools.nsc.interpreter._
|
||||
import reporters._
|
||||
import org.apache.spark.repl.SparkIMain
|
||||
import scala.tools.reflect._
|
||||
class ReflectSparkIMain(initialSettings: Settings, override val out: JPrintWriter) extends SparkIMain(initialSettings, out) {
|
||||
|
||||
override def newCompiler(settings: Settings, reporter: Reporter): ReplGlobal = {
|
||||
settings.outputDirs setSingleOutput virtualDirectory
|
||||
settings.exposeEmptyPackage.value = true
|
||||
new ReflectGlobal(settings, reporter, classLoader) with ReplGlobal {
|
||||
override def toString: String = "<global>"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
package com.nflabs.zeppelin.spark
|
||||
|
||||
import com.nflabs.zeppelin.repl.Repl
|
||||
import com.nflabs.zeppelin.repl.ReplResult
|
||||
import com.nflabs.zeppelin.repl.ReplResult.Code
|
||||
import com.nflabs.zeppelin.repl.Repl.FormType
|
||||
import java.util.Properties
|
||||
import scala.tools.nsc.{Interpreter, Settings}
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.PrintStream
|
||||
import java.io.PrintWriter
|
||||
import org.apache.spark.repl.SparkILoop
|
||||
import org.apache.spark.repl.SparkIMain;
|
||||
import org.apache.spark.SparkContext
|
||||
|
||||
class SparkRepl(properties: Properties) extends Repl(properties) {
|
||||
|
||||
val out = new ByteArrayOutputStream();
|
||||
var interpreter : ReflectSparkILoop = _
|
||||
var intp : SparkIMain = _
|
||||
|
||||
protected def getSparkContext() : SparkContext = {
|
||||
null
|
||||
}
|
||||
|
||||
override def initialize() = {
|
||||
val cl = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
val settings = new Settings();
|
||||
settings.usejavacp.value = true
|
||||
|
||||
val printStream = new PrintStream(out)
|
||||
interpreter = new ReflectSparkILoop(null, new PrintWriter(out))
|
||||
interpreter.settings = settings;
|
||||
intp = interpreter.createReflectInterpreter(settings);
|
||||
interpreter.intp = intp
|
||||
intp.initializeSynchronous
|
||||
|
||||
|
||||
}
|
||||
override def destroy() = {
|
||||
intp.close()
|
||||
}
|
||||
override def getValue(name : String) : Object = {
|
||||
|
||||
return null;
|
||||
}
|
||||
override def interpret(st : String) : ReplResult = {
|
||||
return null;
|
||||
}
|
||||
|
||||
override def cancel() = {
|
||||
|
||||
}
|
||||
override def bindValue(name : String, o : Object) = {
|
||||
|
||||
}
|
||||
override def getFormType() : FormType = {
|
||||
return FormType.NATIVE;
|
||||
}
|
||||
|
||||
def getResultCode(r : scala.tools.nsc.interpreter.Results.Result) : Code = {
|
||||
|
||||
if (r.isInstanceOf[instanceof scala.tools.nsc.interpreter.Results.Success$) {
|
||||
return Code.SUCCESS;
|
||||
} else if (r instanceof scala.tools.nsc.interpreter.Results.Incomplete$) {
|
||||
return Code.INCOMPLETE;
|
||||
} else {
|
||||
return Code.ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue