mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
ZEPPELIN-804 Refactoring registration mechanism on Interpreters
- Changed Spark*Interpreter to use interpreter-setting.json
This commit is contained in:
parent
48ac41d201
commit
d54f98e0ee
5 changed files with 98 additions and 1 deletions
|
|
@ -63,6 +63,7 @@ import scala.tools.nsc.settings.MutableSettings.PathSetting;
|
|||
*/
|
||||
public class DepInterpreter extends Interpreter {
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"dep",
|
||||
|
|
@ -78,6 +79,7 @@ public class DepInterpreter extends Interpreter {
|
|||
.build());
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
private SparkIMain intp;
|
||||
private ByteArrayOutputStream out;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
|
|||
private String scriptPath;
|
||||
boolean pythonscriptRunning = false;
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"pyspark",
|
||||
|
|
@ -87,6 +88,7 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
|
|||
SparkInterpreter.getSystemDefault("PYSPARK_PYTHON", null, "python"),
|
||||
"Python command to run pyspark with").build());
|
||||
}
|
||||
*/
|
||||
|
||||
public PySparkInterpreter(Properties property) {
|
||||
super(property);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ public class SparkRInterpreter extends Interpreter {
|
|||
private static String renderOptions;
|
||||
private ZeppelinR zeppelinR;
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"r",
|
||||
|
|
@ -66,6 +67,7 @@ public class SparkRInterpreter extends Interpreter {
|
|||
"")
|
||||
.build());
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
public SparkRInterpreter(Properties property) {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public class SparkSqlInterpreter extends Interpreter {
|
|||
Logger logger = LoggerFactory.getLogger(SparkSqlInterpreter.class);
|
||||
AtomicInteger num = new AtomicInteger(0);
|
||||
|
||||
/*
|
||||
static {
|
||||
Interpreter.register(
|
||||
"sql",
|
||||
|
|
@ -66,6 +67,7 @@ public class SparkSqlInterpreter extends Interpreter {
|
|||
"Show full exception stacktrace for SQL queries if set to true.")
|
||||
.build());
|
||||
}
|
||||
*/
|
||||
|
||||
private String getJobGroup(InterpreterContext context){
|
||||
return "zeppelin-" + context.getParagraphId();
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
},
|
||||
"spark.app.name": {
|
||||
"envName": "SPARK_APP_NAME",
|
||||
|
||||
"propertyName": "spark.app.name",
|
||||
"defaultValue": "Zeppelin",
|
||||
"description": "The name of spark application."
|
||||
|
|
@ -53,5 +54,93 @@
|
|||
"description": "Spark master uri. ex) spark://masterhost:7077"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"interpreterGroup": "sql",
|
||||
"interpreterName": "spark",
|
||||
"interpreterClassName": "org.apache.zeppelin.spark.SparkSqlInterpreter",
|
||||
"properties": {
|
||||
"zeppelin.spark.concurrentSQL": {
|
||||
"envName": "ZEPPELIN_SPARK_CONCURRENTSQL",
|
||||
"propertyName": "zeppelin.spark.concurrentSQL",
|
||||
"defaultValue": "false",
|
||||
"description": "Execute multiple SQL concurrently if set true."
|
||||
},
|
||||
"zeppelin.spark.sql.stacktrace": {
|
||||
"envName": "ZEPPELIN_SPARK_SQL_STACKTRACE",
|
||||
"propertyName": "zeppelin.spark.sql.stacktrace",
|
||||
"defaultValue": "false",
|
||||
"description": "Show full exception stacktrace for SQL queries if set to true."
|
||||
},
|
||||
"zeppelin.spark.maxResult": {
|
||||
"envName": "ZEPPELIN_SPARK_MAXRESULT",
|
||||
"propertyName": "zeppelin.spark.maxResult",
|
||||
"defaultValue": "1000",
|
||||
"description": "Max number of SparkSQL result to display."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"interpreterGroup": "dep",
|
||||
"interpreterName": "spark",
|
||||
"interpreterClassName": "org.apache.zeppelin.spark.DepInterpreter",
|
||||
"properties": {
|
||||
"zeppelin.dep.localrepo": {
|
||||
"envName": "ZEPPELIN_DEP_LOCALREPO",
|
||||
"propertyName": null,
|
||||
"defaultValue": "local-repo",
|
||||
"description": "local repository for dependency loader"
|
||||
},
|
||||
"zeppelin.dep.additionalRemoteRepository": {
|
||||
"envName": null,
|
||||
"propertyName": null,
|
||||
"defaultValue": "spark-packages,http://dl.bintray.com/spark-packages/maven,false;",
|
||||
"description": "A list of \u0027id,remote-repository-URL,is-snapshot;\u0027 for each remote repository."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"interpreterGroup": "pyspark",
|
||||
"interpreterName": "spark",
|
||||
"interpreterClassName": "org.apache.zeppelin.spark.PySparkInterpreter",
|
||||
"properties": {
|
||||
"zeppelin.pyspark.python": {
|
||||
"envName": "PYSPARK_PYTHON",
|
||||
"propertyName": null,
|
||||
"defaultValue": "python",
|
||||
"description": "Python command to run pyspark with"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"interpreterGroup": "r",
|
||||
"interpreterName": "spark",
|
||||
"interpreterClassName": "org.apache.zeppelin.spark.SparkRInterpreter",
|
||||
"properties": {
|
||||
"zeppelin.R.knitr": {
|
||||
"envName": "ZEPPELIN_R_KNITR",
|
||||
"propertyName": "zeppelin.R.knitr",
|
||||
"defaultValue": "true",
|
||||
"description": "whether use knitr or not"
|
||||
},
|
||||
"zeppelin.R.cmd": {
|
||||
"envName": "ZEPPELIN_R_CMD",
|
||||
"propertyName": "zeppelin.R.cmd",
|
||||
"defaultValue": "R",
|
||||
"description": "R repl path"
|
||||
},
|
||||
"zeppelin.R.image.width": {
|
||||
"envName": "ZEPPELIN_R_IMAGE_WIDTH",
|
||||
"propertyName": "zeppelin.R.image.width",
|
||||
"defaultValue": "100%",
|
||||
"description": ""
|
||||
},
|
||||
"zeppelin.R.render.options": {
|
||||
"envName": "ZEPPELIN_R_RENDER_OPTIONS",
|
||||
"propertyName": "zeppelin.R.render.options",
|
||||
"defaultValue": "out.format \u003d \u0027html\u0027, comment \u003d NA, echo \u003d FALSE, results \u003d \u0027asis\u0027, message \u003d F, warning \u003d F",
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue