mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
ZEPPELIN-804 Refactoring registration mechanism on Interpreters
- Removed static initialisation of Spark*Interpreter
This commit is contained in:
parent
0d720c02b7
commit
5d63d91505
6 changed files with 0 additions and 118 deletions
|
|
@ -62,25 +62,6 @@ import scala.tools.nsc.settings.MutableSettings.PathSetting;
|
|||
*
|
||||
*/
|
||||
public class DepInterpreter extends Interpreter {
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"dep",
|
||||
"spark",
|
||||
DepInterpreter.class.getName(),
|
||||
new InterpreterPropertyBuilder()
|
||||
.add("zeppelin.dep.localrepo",
|
||||
getSystemDefault("ZEPPELIN_DEP_LOCALREPO", null, "local-repo"),
|
||||
"local repository for dependency loader")
|
||||
.add("zeppelin.dep.additionalRemoteRepository",
|
||||
"spark-packages,http://dl.bintray.com/spark-packages/maven,false;",
|
||||
"A list of 'id,remote-repository-URL,is-snapshot;' for each remote repository.")
|
||||
.build());
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
private SparkIMain intp;
|
||||
private ByteArrayOutputStream out;
|
||||
private SparkDependencyContext depc;
|
||||
|
|
|
|||
|
|
@ -77,19 +77,6 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
|
|||
private String scriptPath;
|
||||
boolean pythonscriptRunning = false;
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"pyspark",
|
||||
"spark",
|
||||
PySparkInterpreter.class.getName(),
|
||||
new InterpreterPropertyBuilder()
|
||||
.add("zeppelin.pyspark.python",
|
||||
SparkInterpreter.getSystemDefault("PYSPARK_PYTHON", null, "python"),
|
||||
"Python command to run pyspark with").build());
|
||||
}
|
||||
*/
|
||||
|
||||
public PySparkInterpreter(Properties property) {
|
||||
super(property);
|
||||
|
||||
|
|
|
|||
|
|
@ -80,40 +80,6 @@ import scala.tools.nsc.settings.MutableSettings.PathSetting;
|
|||
public class SparkInterpreter extends Interpreter {
|
||||
public static Logger logger = LoggerFactory.getLogger(SparkInterpreter.class);
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"spark",
|
||||
"spark",
|
||||
SparkInterpreter.class.getName(),
|
||||
new InterpreterPropertyBuilder()
|
||||
.add("spark.app.name",
|
||||
getSystemDefault("SPARK_APP_NAME", "spark.app.name", "Zeppelin"),
|
||||
"The name of spark application.")
|
||||
.add("master",
|
||||
getSystemDefault("MASTER", "spark.master", "local[*]"),
|
||||
"Spark master uri. ex) spark://masterhost:7077")
|
||||
.add("spark.executor.memory",
|
||||
getSystemDefault(null, "spark.executor.memory", ""),
|
||||
"Executor memory per worker instance. ex) 512m, 32g")
|
||||
.add("spark.cores.max",
|
||||
getSystemDefault(null, "spark.cores.max", ""),
|
||||
"Total number of cores to use. Empty value uses all available core.")
|
||||
.add("zeppelin.spark.useHiveContext",
|
||||
getSystemDefault("ZEPPELIN_SPARK_USEHIVECONTEXT",
|
||||
"zeppelin.spark.useHiveContext", "true"),
|
||||
"Use HiveContext instead of SQLContext if it is true.")
|
||||
.add("zeppelin.spark.maxResult",
|
||||
getSystemDefault("ZEPPELIN_SPARK_MAXRESULT", "zeppelin.spark.maxResult", "1000"),
|
||||
"Max number of SparkSQL result to display.")
|
||||
.add("args", "", "spark commandline args")
|
||||
.add("zeppelin.spark.printREPLOutput", "true",
|
||||
"Print REPL output")
|
||||
.build()
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
private ZeppelinContext z;
|
||||
private SparkILoop interpreter;
|
||||
private SparkIMain intp;
|
||||
|
|
|
|||
|
|
@ -42,34 +42,6 @@ public class SparkRInterpreter extends Interpreter {
|
|||
private static String renderOptions;
|
||||
private ZeppelinR zeppelinR;
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"r",
|
||||
"spark",
|
||||
SparkRInterpreter.class.getName(),
|
||||
new InterpreterPropertyBuilder()
|
||||
.add("zeppelin.R.cmd",
|
||||
SparkInterpreter.getSystemDefault("ZEPPELIN_R_CMD", "zeppelin.R.cmd", "R"),
|
||||
"R repl path")
|
||||
.add("zeppelin.R.knitr",
|
||||
SparkInterpreter.getSystemDefault("ZEPPELIN_R_KNITR", "zeppelin.R.knitr", "true"),
|
||||
"whether use knitr or not")
|
||||
.add("zeppelin.R.image.width",
|
||||
SparkInterpreter.getSystemDefault("ZEPPELIN_R_IMAGE_WIDTH",
|
||||
"zeppelin.R.image.width", "100%"),
|
||||
"")
|
||||
.add("zeppelin.R.render.options",
|
||||
SparkInterpreter.getSystemDefault("ZEPPELIN_R_RENDER_OPTIONS",
|
||||
"zeppelin.R.render.options",
|
||||
"out.format = 'html', comment = NA, "
|
||||
+ "echo = FALSE, results = 'asis', message = F, warning = F"),
|
||||
"")
|
||||
.build());
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public SparkRInterpreter(Properties property) {
|
||||
super(property);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,29 +46,6 @@ public class SparkSqlInterpreter extends Interpreter {
|
|||
Logger logger = LoggerFactory.getLogger(SparkSqlInterpreter.class);
|
||||
AtomicInteger num = new AtomicInteger(0);
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"sql",
|
||||
"spark",
|
||||
SparkSqlInterpreter.class.getName(),
|
||||
new InterpreterPropertyBuilder()
|
||||
.add("zeppelin.spark.maxResult",
|
||||
SparkInterpreter.getSystemDefault("ZEPPELIN_SPARK_MAXRESULT",
|
||||
"zeppelin.spark.maxResult", "1000"),
|
||||
"Max number of SparkSQL result to display.")
|
||||
.add("zeppelin.spark.concurrentSQL",
|
||||
SparkInterpreter.getSystemDefault("ZEPPELIN_SPARK_CONCURRENTSQL",
|
||||
"zeppelin.spark.concurrentSQL", "false"),
|
||||
"Execute multiple SQL concurrently if set true.")
|
||||
.add("zeppelin.spark.sql.stacktrace",
|
||||
SparkInterpreter.getSystemDefault("ZEPPELIN_SPARK_SQL_STACKTRACE",
|
||||
"zeppelin.spark.sql.stacktrace", "false"),
|
||||
"Show full exception stacktrace for SQL queries if set to true.")
|
||||
.build());
|
||||
}
|
||||
*/
|
||||
|
||||
private String getJobGroup(InterpreterContext context){
|
||||
return "zeppelin-" + context.getParagraphId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ public class ZeppelinConfiguration extends XMLConfiguration {
|
|||
private static final long serialVersionUID = 4749305895693848035L;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ZeppelinConfiguration.class);
|
||||
private static ZeppelinConfiguration conf;
|
||||
private String interpreterJson;
|
||||
|
||||
public ZeppelinConfiguration(URL url) throws ConfigurationException {
|
||||
setDelimiterParsingDisabled(true);
|
||||
|
|
|
|||
Loading…
Reference in a new issue