diff --git a/.travis.yml b/.travis.yml index 27a0e393cbf..80d4c04bc6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ matrix: # Test all modules with scala 2.10 - jdk: "oraclejdk7" - env: SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pexamples -Pscala-2.10" BUILD_FLAG="package -Pbuild-distr -DskipRat" TEST_FLAG="verify -Pusing-packaged-distr -DskipRat" TEST_PROJECTS="" + env: SCALA_VER="2.10" SPARK_VER="1.6.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.6 -Pr -Phadoop-2.3 -Ppyspark -Psparkr -Pscalding -Pbeam -Pexamples -Pscala-2.10" BUILD_FLAG="package -Pbuild-distr -DskipRat" TEST_FLAG="verify -Pusing-packaged-distr -DskipRat" TEST_PROJECTS="" # Test all modules with scala 2.11 - jdk: "oraclejdk7" @@ -52,23 +52,23 @@ matrix: # Test spark module for 1.5.2 - jdk: "oraclejdk7" - env: SCALA_VER="2.10" SPARK_VER="1.5.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.5 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false" + env: SCALA_VER="2.10" SPARK_VER="1.5.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.5 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark.* -DfailIfNoTests=false" # Test spark module for 1.4.1 - jdk: "oraclejdk7" - env: SCALA_VER="2.10" SPARK_VER="1.4.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.4 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false" + env: SCALA_VER="2.10" SPARK_VER="1.4.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.4 -Pr -Phadoop-2.3 -Ppyspark -Psparkr" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark,r -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark.* -DfailIfNoTests=false" # Test spark module for 1.3.1 - jdk: "oraclejdk7" - env: SCALA_VER="2.10" SPARK_VER="1.3.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.3 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false" + env: SCALA_VER="2.10" SPARK_VER="1.3.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.3 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark.* -DfailIfNoTests=false" # Test spark module for 1.2.2 - jdk: "oraclejdk7" - env: SCALA_VER="2.10" SPARK_VER="1.2.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.2 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false" + env: SCALA_VER="2.10" SPARK_VER="1.2.2" HADOOP_VER="2.3" PROFILE="-Pspark-1.2 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark.* -DfailIfNoTests=false" # Test spark module for 1.1.1 - jdk: "oraclejdk7" - env: SCALA_VER="2.10" SPARK_VER="1.1.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.1 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark* -DfailIfNoTests=false" + env: SCALA_VER="2.10" SPARK_VER="1.1.1" HADOOP_VER="2.3" PROFILE="-Pspark-1.1 -Phadoop-2.3 -Ppyspark" BUILD_FLAG="package -DskipTests -DskipRat" TEST_FLAG="verify -DskipRat" TEST_PROJECTS="-pl zeppelin-interpreter,zeppelin-zengine,zeppelin-server,zeppelin-display,spark-dependencies,spark -Dtest=org.apache.zeppelin.rest.*Test,org.apache.zeppelin.spark.* -DfailIfNoTests=false" # Test selenium with spark module for 1.6.1 - jdk: "oraclejdk7" @@ -89,7 +89,6 @@ install: before_script: - travis_retry ./testing/downloadSpark.sh $SPARK_VER $HADOOP_VER - - ./testing/startSparkCluster.sh $SPARK_VER $HADOOP_VER - echo "export SPARK_HOME=`pwd`/spark-$SPARK_VER-bin-hadoop$HADOOP_VER" > conf/zeppelin-env.sh - tail conf/zeppelin-env.sh @@ -109,6 +108,3 @@ after_failure: - cat zeppelin-web/npm-debug.log - cat spark-*/logs/* -after_script: - - ./testing/stopSparkCluster.sh $SPARK_VER $HADOOP_VER - diff --git a/angular/src/main/java/org/apache/zeppelin/angular/AngularInterpreter.java b/angular/src/main/java/org/apache/zeppelin/angular/AngularInterpreter.java index 1b65f0f3b0d..f8ff350d096 100644 --- a/angular/src/main/java/org/apache/zeppelin/angular/AngularInterpreter.java +++ b/angular/src/main/java/org/apache/zeppelin/angular/AngularInterpreter.java @@ -34,9 +34,6 @@ * */ public class AngularInterpreter extends Interpreter { - static { - Interpreter.register("angular", AngularInterpreter.class.getName()); - } public AngularInterpreter(Properties property) { super(property); diff --git a/angular/src/main/resources/interpreter-setting.json b/angular/src/main/resources/interpreter-setting.json new file mode 100644 index 00000000000..9e379de2614 --- /dev/null +++ b/angular/src/main/resources/interpreter-setting.json @@ -0,0 +1,10 @@ +[ + { + "group": "angular", + "name": "angular", + "className": "org.apache.zeppelin.angular.AngularInterpreter", + "properties": { + + } + } +] diff --git a/beam/README.md b/beam/README.md new file mode 100644 index 00000000000..57150a0208a --- /dev/null +++ b/beam/README.md @@ -0,0 +1,25 @@ +# Overview +Beam interpreter for Apache Zeppelin + +# Architecture +Current interpreter implementation supports the static repl. It compiles the code in memory, execute it and redirect the output to zeppelin. + +## Building the Beam Interpreter +You have to first build the Beam interpreter by enable the **beam** profile as follows: + +``` +mvn clean package -Pbeam -DskipTests +``` + +### Notice +- Flink runner comes with binary compiled for scala 2.10. So, currently we support only Scala 2.10 + +### Technical overview + + * Upon starting an interpreter, an instance of `JavaCompiler` is created. + + * When the user runs commands with beam, the `JavaParser` go through the code to get a class that contains the main method. + + * Then it replaces the class name with random class name to avoid overriding while compilation. it creates new out & err stream to get the data in new stream instead of the console, to redirect output to zeppelin. + + * If there is any error during compilation, it can catch and redirect to zeppelin. diff --git a/beam/pom.xml b/beam/pom.xml new file mode 100644 index 00000000000..b0f165647b6 --- /dev/null +++ b/beam/pom.xml @@ -0,0 +1,320 @@ + + + + + 4.0.0 + + + zeppelin + org.apache.zeppelin + 0.7.0-SNAPSHOT + .. + + + org.apache.zeppelin + zeppelin-beam + jar + 0.7.0-SNAPSHOT + Zeppelin: Beam interpreter + + + 2.3.0 + 1.6.2 + 0.2.0-incubating + + + + + io.netty + netty-all + 4.1.1.Final + + + + org.apache.spark + spark-core_2.10 + ${beam.spark.version} + + + slf4j-log4j12 + org.slf4j + + + netty-all + io.netty + + + akka-actor_2.10 + org.spark-project.akka + + + akka-remote_2.10 + org.spark-project.akka + + + akka-slf4j_2.10 + org.spark-project.akka + + + + + + org.apache.spark + spark-streaming_2.10 + ${beam.spark.version} + + + + org.apache.hadoop + hadoop-mapreduce-client-core + ${beam.hadoop.version} + + + slf4j-log4j12 + org.slf4j + + + + + + org.apache.hadoop + hadoop-common + ${beam.hadoop.version} + + + slf4j-log4j12 + org.slf4j + + + + + + org.apache.hadoop + hadoop-hdfs + ${beam.hadoop.version} + + + + org.apache.hadoop + hadoop-client + ${beam.hadoop.version} + + + slf4j-log4j12 + org.slf4j + + + + + + org.apache.hadoop + hadoop-annotations + ${beam.hadoop.version} + + + + org.apache.hadoop + hadoop-yarn-common + ${beam.hadoop.version} + + + + org.apache.hadoop + hadoop-mapreduce-client-common + ${beam.hadoop.version} + + + slf4j-log4j12 + org.slf4j + + + + + + com.thoughtworks.qdox + qdox + 2.0-M3 + + + + org.apache.beam + beam-runners-parent + ${beam.beam.version} + pom + + + + org.apache.beam + beam-runners-core-java + ${beam.beam.version} + + + google-http-client-jackson2 + com.google.http-client + + + + + + org.apache.beam + beam-runners-direct-java + ${beam.beam.version} + + + + org.apache.beam + beam-runners-flink_2.10 + ${beam.beam.version} + + + slf4j-log4j12 + org.slf4j + + + netty-all + io.netty + + + + + + org.apache.beam + beam-runners-flink_2.10-examples + ${beam.beam.version} + + + slf4j-log4j12 + org.slf4j + + + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + + org.apache.beam + beam-runners-google-cloud-dataflow-java + ${beam.beam.version} + + + google-http-client-jackson2 + com.google.http-client + + + + + + org.apache.beam + beam-runners-spark + ${beam.beam.version} + jar + + + + ${project.groupId} + zeppelin-interpreter + ${project.version} + provided + + + + org.apache.commons + commons-exec + 1.3 + + + + junit + junit + test + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 2.7 + + true + + + + + maven-enforcer-plugin + 1.3.1 + + + enforce + none + + + + + + maven-dependency-plugin + 2.8 + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/../../interpreter/beam + false + false + true + runtime + + + + copy-artifact + package + + copy + + + ${project.build.directory}/../../interpreter/beam + false + false + true + runtime + + + ${project.groupId} + ${project.artifactId} + ${project.version} + ${project.packaging} + + + + + + + + + + diff --git a/beam/src/main/java/org/apache/zeppelin/beam/BeamInterpreter.java b/beam/src/main/java/org/apache/zeppelin/beam/BeamInterpreter.java new file mode 100644 index 00000000000..caa91c3e4cb --- /dev/null +++ b/beam/src/main/java/org/apache/zeppelin/beam/BeamInterpreter.java @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.zeppelin.beam; + +import java.io.File; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import java.util.UUID; + +import org.apache.zeppelin.interpreter.Interpreter; +import org.apache.zeppelin.interpreter.InterpreterContext; +import org.apache.zeppelin.interpreter.InterpreterResult; +import org.apache.zeppelin.interpreter.thrift.InterpreterCompletion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Beam interpreter + * + */ +public class BeamInterpreter extends Interpreter { + + Logger logger = LoggerFactory.getLogger(BeamInterpreter.class); + + public BeamInterpreter(Properties property) { + super(property); + } + + @Override + public void open() { + + } + + @Override + public void close() { + File dir = new File("."); + // delete all .class files created while compilation process + for (int i = 0; i < dir.list().length; i++) { + File f = dir.listFiles()[i]; + if (f.getAbsolutePath().endsWith(".class")) { + f.delete(); + } + } + } + + @Override + public InterpreterResult interpret(String code, InterpreterContext context) { + + // choosing new name to class containing Main method + String generatedClassName = "C" + UUID.randomUUID().toString().replace("-", ""); + + try { + String res = StaticRepl.execute(generatedClassName, code); + return new InterpreterResult(InterpreterResult.Code.SUCCESS, res); + } catch (Exception e) { + logger.error("Exception in Interpreter while interpret", e); + return new InterpreterResult(InterpreterResult.Code.ERROR, e.getMessage()); + + } + + } + + @Override + public void cancel(InterpreterContext context) { + + } + + @Override + public FormType getFormType() { + return FormType.SIMPLE; + } + + @Override + public int getProgress(InterpreterContext context) { + return 0; + } + + @Override + public List completion(String buf, int cursor) { + return Collections.emptyList(); + } + +} diff --git a/beam/src/main/java/org/apache/zeppelin/beam/StaticRepl.java b/beam/src/main/java/org/apache/zeppelin/beam/StaticRepl.java new file mode 100644 index 00000000000..ed81146bb1c --- /dev/null +++ b/beam/src/main/java/org/apache/zeppelin/beam/StaticRepl.java @@ -0,0 +1,185 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.zeppelin.beam; + +import javax.tools.Diagnostic; +import javax.tools.DiagnosticCollector; +import javax.tools.JavaCompiler; +import javax.tools.JavaCompiler.CompilationTask; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.thoughtworks.qdox.JavaProjectBuilder; +import com.thoughtworks.qdox.model.JavaClass; +import com.thoughtworks.qdox.model.JavaSource; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.PrintStream; +import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; +import java.net.URI; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.List; + +/** + * + * StaticRepl for compling the java code in memory + * + */ +public class StaticRepl { + static Logger logger = LoggerFactory.getLogger(StaticRepl.class); + + public static String execute(String generatedClassName, String code) throws Exception { + + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + DiagnosticCollector diagnostics = new DiagnosticCollector(); + + // Java parasing + JavaProjectBuilder builder = new JavaProjectBuilder(); + JavaSource src = builder.addSource(new StringReader(code)); + + // get all classes in code (paragraph) + List classes = src.getClasses(); + String mainClassName = null; + + // Searching for class containing Main method + for (int i = 0; i < classes.size(); i++) { + boolean hasMain = false; + + for (int j = 0; j < classes.get(i).getMethods().size(); j++) { + if (classes.get(i).getMethods().get(j).getName().equals("main") && classes.get(i) + .getMethods().get(j).isStatic()) { + mainClassName = classes.get(i).getName(); + hasMain = true; + break; + } + } + if (hasMain == true) { + break; + } + + } + + // if there isn't Main method, will retuen error + if (mainClassName == null) { + logger.error("Exception for Main method", "There isn't any class " + + "containing static main method."); + throw new Exception("There isn't any class containing static main method."); + } + + // replace name of class containing Main method with generated name + code = code.replace(mainClassName, generatedClassName); + + JavaFileObject file = new JavaSourceFromString(generatedClassName, code.toString()); + Iterable compilationUnits = Arrays.asList(file); + + ByteArrayOutputStream baosOut = new ByteArrayOutputStream(); + ByteArrayOutputStream baosErr = new ByteArrayOutputStream(); + + // Creating new stream to get the output data + PrintStream newOut = new PrintStream(baosOut); + PrintStream newErr = new PrintStream(baosErr); + // Save the old System.out! + PrintStream oldOut = System.out; + PrintStream oldErr = System.err; + // Tell Java to use your special stream + System.setOut(newOut); + System.setErr(newErr); + + CompilationTask task = compiler.getTask(null, null, diagnostics, null, null, compilationUnits); + + // executing the compilation process + boolean success = task.call(); + + // if success is false will get error + if (!success) { + for (Diagnostic diagnostic : diagnostics.getDiagnostics()) { + if (diagnostic.getLineNumber() == -1) { + continue; + } + System.err.println("line " + diagnostic.getLineNumber() + " : " + + diagnostic.getMessage(null)); + } + System.out.flush(); + System.err.flush(); + + System.setOut(oldOut); + System.setErr(oldErr); + logger.error("Exception in Interpreter while compilation", baosErr.toString()); + throw new Exception(baosErr.toString()); + } else { + try { + + // creating new class loader + URLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { new File("").toURI() + .toURL() }); + // execute the Main method + Class.forName(generatedClassName, true, classLoader) + .getDeclaredMethod("main", new Class[] { String[].class }) + .invoke(null, new Object[] { null }); + + System.out.flush(); + System.err.flush(); + + // set the stream to old stream + System.setOut(oldOut); + System.setErr(oldErr); + + return baosOut.toString(); + + } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException + | InvocationTargetException e) { + logger.error("Exception in Interpreter while execution", e); + System.err.println(e); + e.printStackTrace(newErr); + throw new Exception(baosErr.toString(), e); + + } finally { + + System.out.flush(); + System.err.flush(); + + System.setOut(oldOut); + System.setErr(oldErr); + } + } + + } + +} + +class JavaSourceFromString extends SimpleJavaFileObject { + final String code; + + JavaSourceFromString(String name, String code) { + super(URI.create("string:///" + name.replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE); + this.code = code; + } + + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) { + return code; + } +} diff --git a/beam/src/main/resources/interpreter-setting.json b/beam/src/main/resources/interpreter-setting.json new file mode 100644 index 00000000000..7cf57d24835 --- /dev/null +++ b/beam/src/main/resources/interpreter-setting.json @@ -0,0 +1,11 @@ +[ + { + "group": "beam", + "name": "beam", + "className": "org.apache.zeppelin.beam.BeamInterpreter", + "defaultInterpreter": true, + "properties": { + + } + } +] diff --git a/beam/src/main/test/org/apache/zeppelin/beam/BeamInterpreterTest.java b/beam/src/main/test/org/apache/zeppelin/beam/BeamInterpreterTest.java new file mode 100644 index 00000000000..c24ed41ddb9 --- /dev/null +++ b/beam/src/main/test/org/apache/zeppelin/beam/BeamInterpreterTest.java @@ -0,0 +1,100 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.zeppelin.beam; + +import static org.junit.Assert.assertEquals; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Properties; +import org.apache.zeppelin.interpreter.InterpreterContext; +import org.apache.zeppelin.interpreter.InterpreterResult; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * + * BeamInterpreterTest + * + */ +public class BeamInterpreterTest { + + private static BeamInterpreter beam; + private static InterpreterContext context; + + @BeforeClass + public static void setUp() { + Properties p = new Properties(); + beam = new BeamInterpreter(p); + beam.open(); + context = new InterpreterContext(null, null, null, null, null, null, null, null, null, null, + null); + } + + @AfterClass + public static void tearDown() { + beam.close(); + } + + @Test + public void testStaticRepl() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + out.println("public class HelloWorld {"); + out.println(" public static void main(String args[]) {"); + out.println(" System.out.println(\"This is in another java file\");"); + out.println(" }"); + out.println("}"); + out.close(); + + InterpreterResult res = beam.interpret(writer.toString(), context); + + assertEquals(InterpreterResult.Code.SUCCESS, res.code()); + } + + @Test + public void testStaticReplWithoutMain() { + + StringBuffer sourceCode = new StringBuffer(); + sourceCode.append("package org.mdkt;\n"); + sourceCode.append("public class HelloClass {\n"); + sourceCode.append(" public String hello() { return \"hello\"; }"); + sourceCode.append("}"); + InterpreterResult res = beam.interpret(sourceCode.toString(), context); + assertEquals(InterpreterResult.Code.ERROR, res.code()); + } + + @Test + public void testStaticReplWithSyntaxError() { + + StringWriter writer = new StringWriter(); + PrintWriter out = new PrintWriter(writer); + out.println("public class HelloWorld {"); + out.println(" public static void main(String args[]) {"); + out.println(" System.out.prin(\"This is in another java file\");"); + out.println(" }"); + out.println("}"); + out.close(); + InterpreterResult res = beam.interpret(writer.toString(), context); + + assertEquals(InterpreterResult.Code.ERROR, res.code()); + } + +} diff --git a/bigquery/src/main/resources/interpreter-setting.json b/bigquery/src/main/resources/interpreter-setting.json index 3e524ed8362..fb44063d8bd 100644 --- a/bigquery/src/main/resources/interpreter-setting.json +++ b/bigquery/src/main/resources/interpreter-setting.json @@ -22,6 +22,9 @@ "defaultValue": "100000", "description": "Maximum number of rows to fetch from BigQuery" } + }, + "editor": { + "language": "sql" } } ] diff --git a/bin/common.cmd b/bin/common.cmd index b4fb6bf4d23..745750fccac 100644 --- a/bin/common.cmd +++ b/bin/common.cmd @@ -69,6 +69,10 @@ if not defined ZEPPELIN_MEM ( set ZEPPELIN_MEM=-Xms1024m -Xmx1024m -XX:MaxPermSize=512m ) +if not defined ZEPPELIN_INTP_MEM ( + set ZEPPELIN_INTP_MEM=-Xms1024m -Xmx1024m -XX:MaxPermSize=512m +) + if not defined ZEPPELIN_JAVA_OPTS ( set ZEPPELIN_JAVA_OPTS=-Dfile.encoding=%ZEPPELIN_ENCODING% %ZEPPELIN_MEM% ) else ( diff --git a/bin/common.sh b/bin/common.sh index b69f28cf0c7..486d2b1ba43 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -113,10 +113,14 @@ if [[ -z "${ZEPPELIN_ENCODING}" ]]; then export ZEPPELIN_ENCODING="UTF-8" fi -if [[ -z "$ZEPPELIN_MEM" ]]; then +if [[ -z "${ZEPPELIN_MEM}" ]]; then export ZEPPELIN_MEM="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m" fi +if [[ -z "${ZEPPELIN_INTP_MEM}" ]]; then + export ZEPPELIN_INTP_MEM="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m" +fi + JAVA_OPTS+=" ${ZEPPELIN_JAVA_OPTS} -Dfile.encoding=${ZEPPELIN_ENCODING} ${ZEPPELIN_MEM}" JAVA_OPTS+=" -Dlog4j.configuration=file://${ZEPPELIN_CONF_DIR}/log4j.properties" export JAVA_OPTS diff --git a/bin/interpreter.sh b/bin/interpreter.sh index a81c8f21067..4fb4b269265 100755 --- a/bin/interpreter.sh +++ b/bin/interpreter.sh @@ -149,6 +149,28 @@ elif [[ "${INTERPRETER_ID}" == "hbase" ]]; then else echo "HBASE_HOME and HBASE_CONF_DIR are not set, configuration might not be loaded" fi +elif [[ "${INTERPRETER_ID}" == "pig" ]]; then + # autodetect HADOOP_CONF_HOME by heuristic + if [[ -n "${HADOOP_HOME}" ]] && [[ -z "${HADOOP_CONF_DIR}" ]]; then + if [[ -d "${HADOOP_HOME}/etc/hadoop" ]]; then + export HADOOP_CONF_DIR="${HADOOP_HOME}/etc/hadoop" + elif [[ -d "/etc/hadoop/conf" ]]; then + export HADOOP_CONF_DIR="/etc/hadoop/conf" + fi + fi + + if [[ -n "${HADOOP_CONF_DIR}" ]] && [[ -d "${HADOOP_CONF_DIR}" ]]; then + ZEPPELIN_INTP_CLASSPATH+=":${HADOOP_CONF_DIR}" + fi + + # autodetect TEZ_CONF_DIR + if [[ -n "${TEZ_CONF_DIR}" ]]; then + ZEPPELIN_INTP_CLASSPATH+=":${TEZ_CONF_DIR}" + elif [[ -d "/etc/tez/conf" ]]; then + ZEPPELIN_INTP_CLASSPATH+=":/etc/tez/conf" + else + echo "TEZ_CONF_DIR is not set, configuration might not be loaded" + fi fi addJarInDirForIntp "${LOCAL_INTERPRETER_REPO}" diff --git a/bin/zeppelin-daemon.sh b/bin/zeppelin-daemon.sh index c1d5ef20715..6bdc1d245d3 100755 --- a/bin/zeppelin-daemon.sh +++ b/bin/zeppelin-daemon.sh @@ -161,6 +161,8 @@ function upstart() { # where the service manager starts and stops the process initialize_default_directories + echo "ZEPPELIN_CLASSPATH: ${ZEPPELIN_CLASSPATH_OVERRIDES}:${CLASSPATH}" >> "${ZEPPELIN_OUTFILE}" + $ZEPPELIN_RUNNER $JAVA_OPTS -cp $ZEPPELIN_CLASSPATH_OVERRIDES:$CLASSPATH $ZEPPELIN_MAIN >> "${ZEPPELIN_OUTFILE}" } @@ -177,6 +179,8 @@ function start() { initialize_default_directories + echo "ZEPPELIN_CLASSPATH: ${ZEPPELIN_CLASSPATH_OVERRIDES}:${CLASSPATH}" >> "${ZEPPELIN_OUTFILE}" + nohup nice -n $ZEPPELIN_NICENESS $ZEPPELIN_RUNNER $JAVA_OPTS -cp $ZEPPELIN_CLASSPATH_OVERRIDES:$CLASSPATH $ZEPPELIN_MAIN >> "${ZEPPELIN_OUTFILE}" 2>&1 < /dev/null & pid=$! if [[ -z "${pid}" ]]; then @@ -254,6 +258,7 @@ case "${1}" in start ;; restart) + echo "${ZEPPELIN_NAME} is restarting" >> "${ZEPPELIN_OUTFILE}" stop start ;; diff --git a/cassandra/src/main/java/org/apache/zeppelin/cassandra/CassandraInterpreter.java b/cassandra/src/main/java/org/apache/zeppelin/cassandra/CassandraInterpreter.java index 147fb62c735..47d8e3a53cb 100644 --- a/cassandra/src/main/java/org/apache/zeppelin/cassandra/CassandraInterpreter.java +++ b/cassandra/src/main/java/org/apache/zeppelin/cassandra/CassandraInterpreter.java @@ -151,111 +151,6 @@ public CassandraInterpreter(Properties properties) { super(properties); } - static { - LOGGER.info("Bootstrapping Cassandra Interpreter"); - Interpreter.register("cassandra", "cassandra", CassandraInterpreter.class.getName(), - new InterpreterPropertyBuilder() - .add(CASSANDRA_HOSTS, DEFAULT_HOST, - "Comma separated Cassandra hosts (DNS name or " + - "IP address). Default = localhost. Ex: '192.168.0.12,node2,node3'") - .add(CASSANDRA_PORT, DEFAULT_PORT, "Cassandra native port. Default = 9042") - .add(CASSANDRA_PROTOCOL_VERSION, DEFAULT_PROTOCOL_VERSION, - "Cassandra protocol version. Default = 4") - .add(CASSANDRA_CLUSTER_NAME, DEFAULT_CLUSTER, "Cassandra cluster name. " + - "Default = 'Test Cluster'") - .add(CASSANDRA_KEYSPACE_NAME, DEFAULT_KEYSPACE, "Cassandra keyspace name. " + - "Default = 'system'") - .add(CASSANDRA_COMPRESSION_PROTOCOL, DEFAULT_COMPRESSION, - "Cassandra compression protocol. " + - "Available values: NONE, SNAPPY, LZ4. Default = NONE") - .add(CASSANDRA_CREDENTIALS_USERNAME, DEFAULT_CREDENTIAL, - "Cassandra credentials username. " + - "Default = 'none'") - .add(CASSANDRA_CREDENTIALS_PASSWORD, DEFAULT_CREDENTIAL, - "Cassandra credentials password. " + - "Default = 'none'") - .add(CASSANDRA_LOAD_BALANCING_POLICY, DEFAULT_POLICY, "Cassandra Load Balancing Policy. " + - "Default = new TokenAwarePolicy(new DCAwareRoundRobinPolicy())") - .add(CASSANDRA_RETRY_POLICY, DEFAULT_POLICY, "Cassandra Retry Policy. " + - "Default = DefaultRetryPolicy.INSTANCE") - .add(CASSANDRA_RECONNECTION_POLICY, DEFAULT_POLICY, "Cassandra Reconnection Policy. " + - "Default = new ExponentialReconnectionPolicy(1000, 10 * 60 * 1000)") - .add(CASSANDRA_SPECULATIVE_EXECUTION_POLICY, DEFAULT_POLICY, - "Cassandra Speculative Execution Policy. " + - "Default = NoSpeculativeExecutionPolicy.INSTANCE") - .add(CASSANDRA_INTERPRETER_PARALLELISM, DEFAULT_PARALLELISM, - "Cassandra interpreter parallelism" + - ".Default = 10") - .add(CASSANDRA_MAX_SCHEMA_AGREEMENT_WAIT_SECONDS, - DEFAULT_MAX_SCHEMA_AGREEMENT_WAIT_SECONDS + "" - , "Cassandra max schema agreement wait in second" + - ".Default = ProtocolOptions.DEFAULT_MAX_SCHEMA_AGREEMENT_WAIT_SECONDS") - - .add(CASSANDRA_POOLING_NEW_CONNECTION_THRESHOLD_LOCAL, - DEFAULT_NEW_CONNECTION_THRESHOLD_LOCAL, - "Cassandra new connection threshold local. " + - "Protocol V2 and below default = 100" + - "Protocol V3 and above default = 800") - .add(CASSANDRA_POOLING_NEW_CONNECTION_THRESHOLD_REMOTE, - DEFAULT_NEW_CONNECTION_THRESHOLD_REMOTE, - "Cassandra new connection threshold remove. " + - "Protocol V2 and below default = 100" + - "Protocol V3 and above default = 200") - - .add(CASSANDRA_POOLING_CORE_CONNECTION_PER_HOST_LOCAL, - DEFAULT_CORE_CONNECTION_PER_HOST_LOCAL, - "Cassandra core connection per host local. " + - "Protocol V2 and below default = 2" + - "Protocol V3 and above default = 1") - .add(CASSANDRA_POOLING_CORE_CONNECTION_PER_HOST_REMOTE, - DEFAULT_CORE_CONNECTION_PER_HOST_REMOTE, - "Cassandra core connection per host remove. " + - "Protocol V2 and below default = 1" + - "Protocol V3 and above default = 1") - - .add(CASSANDRA_POOLING_MAX_CONNECTION_PER_HOST_LOCAL, - DEFAULT_MAX_CONNECTION_PER_HOST_LOCAL, - "Cassandra max connection per host local. " + - "Protocol V2 and below default = 8" + - "Protocol V3 and above default = 1") - .add(CASSANDRA_POOLING_MAX_CONNECTION_PER_HOST_REMOTE, - DEFAULT_MAX_CONNECTION_PER_HOST_REMOTE, - "Cassandra max connection per host remote. " + - "Protocol V2 and below default = 2" + - "Protocol V3 and above default = 1") - - .add(CASSANDRA_POOLING_MAX_REQUESTS_PER_CONNECTION_LOCAL, - DEFAULT_MAX_REQUEST_PER_CONNECTION_LOCAL, - "Cassandra max request per connection local. " + - "Protocol V2 and below default = 128" + - "Protocol V3 and above default = 1024") - .add(CASSANDRA_POOLING_MAX_REQUESTS_PER_CONNECTION_REMOTE, - DEFAULT_MAX_REQUEST_PER_CONNECTION_REMOTE, - "Cassandra max request per connection remote. " + - "Protocol V2 and below default = 128" + - "Protocol V3 and above default = 256") - - .add(CASSANDRA_POOLING_IDLE_TIMEOUT_SECONDS, DEFAULT_IDLE_TIMEOUT, - "Cassandra idle time out in seconds. Default = 120") - .add(CASSANDRA_POOLING_POOL_TIMEOUT_MILLIS, DEFAULT_POOL_TIMEOUT, - "Cassandra pool time out in millisecs. Default = 5000") - .add(CASSANDRA_POOLING_HEARTBEAT_INTERVAL_SECONDS, DEFAULT_HEARTBEAT_INTERVAL, - "Cassandra pool heartbeat interval in secs. Default = 30") - .add(CASSANDRA_QUERY_DEFAULT_CONSISTENCY, DEFAULT_CONSISTENCY, - "Cassandra query default consistency level. Default = ONE") - .add(CASSANDRA_QUERY_DEFAULT_SERIAL_CONSISTENCY, DEFAULT_SERIAL_CONSISTENCY, - "Cassandra query default serial consistency level. Default = SERIAL") - .add(CASSANDRA_QUERY_DEFAULT_FETCH_SIZE, DEFAULT_FETCH_SIZE, - "Cassandra query default fetch size. Default = 5000") - .add(CASSANDRA_SOCKET_CONNECTION_TIMEOUT_MILLIS, DEFAULT_CONNECTION_TIMEOUT, - "Cassandra socket default connection timeout in millisecs. Default = 5000") - .add(CASSANDRA_SOCKET_READ_TIMEOUT_MILLIS, DEFAULT_READ_TIMEOUT, - "Cassandra socket read timeout in millisecs. Default = 12000") - .add(CASSANDRA_SOCKET_TCP_NO_DELAY, DEFAULT_TCP_NO_DELAY, - "Cassandra socket TCP no delay. Default = true") - .build()); - } - @Override public void open() { diff --git a/cassandra/src/main/resources/interpreter-setting.json b/cassandra/src/main/resources/interpreter-setting.json new file mode 100644 index 00000000000..eb984726dda --- /dev/null +++ b/cassandra/src/main/resources/interpreter-setting.json @@ -0,0 +1,195 @@ +[ + { + "group": "cassandra", + "name": "cassandra", + "className": "org.apache.zeppelin.cassandra.CassandraInterpreter", + "properties": { + "cassandra.hosts": { + "envName": null, + "propertyName": "cassandra.hosts", + "defaultValue": "localhost", + "description": "Comma separated Cassandra hosts (DNS name or IP address). Default = localhost. Ex: '192.168.0.12,node2,node3'" + }, + "cassandra.native.port": { + "envName": null, + "propertyName": "cassandra.native.port", + "defaultValue": "9042", + "description": "Cassandra native port. Default = 9042" + }, + "cassandra.protocol.version": { + "envName": null, + "propertyName": "cassandra.protocol.version", + "defaultValue": "4", + "description": "Cassandra protocol version. Default = 4" + }, + "cassandra.cluster": { + "envName": null, + "propertyName": "cassandra.cluster", + "defaultValue": "Test Cluster", + "description": "Cassandra cluster name. Default = 'Test Cluster'" + }, + "cassandra.keyspace": { + "envName": null, + "propertyName": "cassandra.keyspace", + "defaultValue": "system", + "description": "Cassandra keyspace name. Default = 'system'" + }, + "cassandra.compression.protocol": { + "envName": null, + "propertyName": "cassandra.compression.protocol", + "defaultValue": "NONE", + "description": "Cassandra compression protocol. Available values: NONE, SNAPPY, LZ4. Default = NONE" + }, + "cassandra.credentials.username": { + "envName": null, + "propertyName": "cassandra.credentials.username", + "defaultValue": "none", + "description": "Cassandra credentials username. Default = 'none'" + }, + "cassandra.credentials.password": { + "envName": null, + "propertyName": "cassandra.credentials.password", + "defaultValue": "none", + "description": "Cassandra credentials password. Default = 'none'" + }, + "cassandra.load.balancing.policy": { + "envName": null, + "propertyName": "cassandra.load.balancing.policy", + "defaultValue": "DEFAULT", + "description": "Cassandra Load Balancing Policy. Default = new TokenAwarePolicy(new DCAwareRoundRobinPolicy())" + }, + "cassandra.retry.policy": { + "envName": null, + "propertyName": "cassandra.retry.policy", + "defaultValue": "DEFAULT", + "description": "Cassandra Retry Policy. Default = DefaultRetryPolicy.INSTANCE" + }, + "cassandra.reconnection.policy": { + "envName": null, + "propertyName": "cassandra.reconnection.policy", + "defaultValue": "DEFAULT", + "description": "Cassandra Reconnection Policy. Default = new ExponentialReconnectionPolicy(1000, 10 * 60 * 1000)" + }, + "cassandra.speculative.execution.policy": { + "envName": null, + "propertyName": "cassandra.speculative.execution.policy", + "defaultValue": "DEFAULT", + "description": "Cassandra Speculative Execution Policy. Default = NoSpeculativeExecutionPolicy.INSTANCE" + }, + "cassandra.interpreter.parallelism": { + "envName": null, + "propertyName": "cassandra.interpreter.parallelism", + "defaultValue": "10", + "description": "Cassandra interpreter parallelism.Default = 10" + }, + "cassandra.max.schema.agreement.wait.second": { + "envName": null, + "propertyName": "cassandra.max.schema.agreement.wait.second", + "defaultValue": "10", + "description": "Cassandra max schema agreement wait in second.Default = ProtocolOptions.DEFAULT_MAX_SCHEMA_AGREEMENT_WAIT_SECONDS" + }, + "cassandra.pooling.new.connection.threshold.local": { + "envName": null, + "propertyName": "cassandra.pooling.new.connection.threshold.local", + "defaultValue": "100", + "description": "Cassandra new connection threshold local. Protocol V2 and below default = 100 Protocol V3 and above default = 800" + }, + "cassandra.pooling.new.connection.threshold.remote": { + "envName": null, + "propertyName": "cassandra.pooling.new.connection.threshold.remote", + "defaultValue": "100", + "description": "Cassandra new connection threshold remove. Protocol V2 and below default = 100 Protocol V3 and above default = 200" + }, + "cassandra.pooling.core.connection.per.host.local": { + "envName": null, + "propertyName": "cassandra.pooling.core.connection.per.host.local", + "defaultValue": "2", + "description": "Cassandra core connection per host local. Protocol V2 and below default = 2 Protocol V3 and above default = 1" + }, + "cassandra.pooling.core.connection.per.host.remote": { + "envName": null, + "propertyName": "cassandra.pooling.core.connection.per.host.remote", + "defaultValue": "1", + "description": "Cassandra core connection per host remove. Protocol V2 and below default = 1 Protocol V3 and above default = 1" + }, + "cassandra.pooling.max.connection.per.host.local": { + "envName": null, + "propertyName": "cassandra.pooling.max.connection.per.host.local", + "defaultValue": "8", + "description": "Cassandra max connection per host local. Protocol V2 and below default = 8 Protocol V3 and above default = 1" + }, + "cassandra.pooling.max.connection.per.host.remote": { + "envName": null, + "propertyName": "cassandra.pooling.max.connection.per.host.remote", + "defaultValue": "2", + "description": "Cassandra max connection per host remote. Protocol V2 and below default = 2 Protocol V3 and above default = 1" + }, + "cassandra.pooling.max.request.per.connection.local": { + "envName": null, + "propertyName": "cassandra.pooling.max.request.per.connection.local", + "defaultValue": "1024", + "description": "Cassandra max request per connection local. Protocol V2 and below default = 128 Protocol V3 and above default = 1024" + }, + "cassandra.pooling.max.request.per.connection.remote": { + "envName": null, + "propertyName": "cassandra.pooling.max.request.per.connection.remote", + "defaultValue": "256", + "description": "Cassandra max request per connection remote. Protocol V2 and below default = 128 Protocol V3 and above default = 256" + }, + "cassandra.pooling.idle.timeout.seconds": { + "envName": null, + "propertyName": "cassandra.pooling.idle.timeout.seconds", + "defaultValue": "120", + "description": "Cassandra idle time out in seconds. Default = 120" + }, + "cassandra.pooling.pool.timeout.millisecs": { + "envName": null, + "propertyName": "cassandra.pooling.pool.timeout.millisecs", + "defaultValue": "5000", + "description": "Cassandra pool time out in millisecs. Default = 5000" + }, + "cassandra.pooling.heartbeat.interval.seconds": { + "envName": null, + "propertyName": "cassandra.pooling.heartbeat.interval.seconds", + "defaultValue": "30", + "description": "Cassandra pool heartbeat interval in secs. Default = 30" + }, + "cassandra.query.default.consistency": { + "envName": null, + "propertyName": "cassandra.query.default.consistency", + "defaultValue": "ONE", + "description": "Cassandra query default consistency level. Default = ONE" + }, + "cassandra.query.default.serial.consistency": { + "envName": null, + "propertyName": "cassandra.query.default.serial.consistency", + "defaultValue": "SERIAL", + "description": "Cassandra query default serial consistency level. Default = SERIAL" + }, + "cassandra.query.default.fetchSize": { + "envName": null, + "propertyName": "cassandra.query.default.fetchSize", + "defaultValue": "5000", + "description": "Cassandra query default fetch size. Default = 5000" + }, + "cassandra.socket.connection.timeout.millisecs": { + "envName": null, + "propertyName": "cassandra.socket.connection.timeout.millisecs", + "defaultValue": "5000", + "description": "Cassandra socket default connection timeout in millisecs. Default = 5000" + }, + "cassandra.socket.read.timeout.millisecs": { + "envName": null, + "propertyName": "cassandra.socket.read.timeout.millisecs", + "defaultValue": "12000", + "description": "Cassandra socket read timeout in millisecs. Default = 12000" + }, + "cassandra.socket.tcp.no_delay": { + "envName": null, + "propertyName": "cassandra.socket.tcp.no_delay", + "defaultValue": "true", + "description": "Cassandra socket TCP no delay. Default = true" + } + } + } +] diff --git a/conf/interpreter-list b/conf/interpreter-list index 17a6f1e4a36..38cb386d8cd 100644 --- a/conf/interpreter-list +++ b/conf/interpreter-list @@ -19,6 +19,7 @@ alluxio org.apache.zeppelin:zeppelin-alluxio:0.6.1 Alluxio interpreter angular org.apache.zeppelin:zeppelin-angular:0.6.1 HTML and AngularJS view rendering +beam org.apache.zeppelin:zeppelin-beam:0.6.1 Beam interpreter bigquery org.apache.zeppelin:zeppelin-bigquery:0.6.1 BigQuery interpreter cassandra org.apache.zeppelin:zeppelin-cassandra_2.11:0.6.1 Cassandra interpreter built with Scala 2.11 elasticsearch org.apache.zeppelin:zeppelin-elasticsearch:0.6.1 Elasticsearch interpreter @@ -31,6 +32,7 @@ kylin org.apache.zeppelin:zeppelin-kylin:0.6.1 Kylin in lens org.apache.zeppelin:zeppelin-lens:0.6.1 Lens interpreter livy org.apache.zeppelin:zeppelin-livy:0.6.1 Livy interpreter md org.apache.zeppelin:zeppelin-markdown:0.6.1 Markdown support +pig org.apache.zeppelin:zeppelin-pig:0.6.1 Pig interpreter postgresql org.apache.zeppelin:zeppelin-postgresql:0.6.1 Postgresql interpreter python org.apache.zeppelin:zeppelin-python:0.6.1 Python interpreter shell org.apache.zeppelin:zeppelin-shell:0.6.1 Shell command diff --git a/conf/zeppelin-env.cmd.template b/conf/zeppelin-env.cmd.template index 4d697fc3650..cb7f87ce61d 100644 --- a/conf/zeppelin-env.cmd.template +++ b/conf/zeppelin-env.cmd.template @@ -19,8 +19,8 @@ REM REM set JAVA_HOME= REM set MASTER= REM Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode. REM set ZEPPELIN_JAVA_OPTS REM Additional jvm options. for example, set ZEPPELIN_JAVA_OPTS="-Dspark.executor.memory=8g -Dspark.cores.max=16" -REM set ZEPPELIN_MEM REM Zeppelin jvm mem options Default -Xmx1024m -XX:MaxPermSize=512m -REM set ZEPPELIN_INTP_MEM REM zeppelin interpreter process jvm mem options. +REM set ZEPPELIN_MEM REM Zeppelin jvm mem options Default -Xms1024m -Xmx1024m -XX:MaxPermSize=512m +REM set ZEPPELIN_INTP_MEM REM zeppelin interpreter process jvm mem options. Default -Xmx1024m -Xms1024m -XX:MaxPermSize=512m REM set ZEPPELIN_INTP_JAVA_OPTS REM zeppelin interpreter process jvm options. REM set ZEPPELIN_LOG_DIR REM Where log files are stored. PWD by default. diff --git a/conf/zeppelin-env.sh.template b/conf/zeppelin-env.sh.template index 01c6d538338..5263cadbde2 100644 --- a/conf/zeppelin-env.sh.template +++ b/conf/zeppelin-env.sh.template @@ -19,9 +19,10 @@ # export JAVA_HOME= # export MASTER= # Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode. # export ZEPPELIN_JAVA_OPTS # Additional jvm options. for example, export ZEPPELIN_JAVA_OPTS="-Dspark.executor.memory=8g -Dspark.cores.max=16" -# export ZEPPELIN_MEM # Zeppelin jvm mem options Default -Xmx1024m -XX:MaxPermSize=512m -# export ZEPPELIN_INTP_MEM # zeppelin interpreter process jvm mem options. +# export ZEPPELIN_MEM # Zeppelin jvm mem options Default -Xms1024m -Xmx1024m -XX:MaxPermSize=512m +# export ZEPPELIN_INTP_MEM # zeppelin interpreter process jvm mem options. Default -Xms1024m -Xmx1024m -XX:MaxPermSize=512m # export ZEPPELIN_INTP_JAVA_OPTS # zeppelin interpreter process jvm options. +# export ZEPPELIN_SSL_PORT # ssl port (used when ssl environment variable is set to true) # export ZEPPELIN_LOG_DIR # Where log files are stored. PWD by default. # export ZEPPELIN_PID_DIR # The pid files are stored. ${ZEPPELIN_HOME}/run by default. diff --git a/conf/zeppelin-site.xml.template b/conf/zeppelin-site.xml.template index 77e0b1f3bcd..c4b369c301c 100755 --- a/conf/zeppelin-site.xml.template +++ b/conf/zeppelin-site.xml.template @@ -31,6 +31,12 @@ Server port. + + zeppelin.server.ssl.port + 8443 + Server ssl port. (used when ssl property is set to true) + + zeppelin.server.context.path / @@ -184,13 +190,13 @@ zeppelin.interpreters - org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.rinterpreter.RRepl,org.apache.zeppelin.rinterpreter.KnitR,org.apache.zeppelin.spark.SparkRInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.file.HDFSFileInterpreter,org.apache.zeppelin.flink.FlinkInterpreter,,org.apache.zeppelin.python.PythonInterpreter,org.apache.zeppelin.lens.LensInterpreter,org.apache.zeppelin.ignite.IgniteInterpreter,org.apache.zeppelin.ignite.IgniteSqlInterpreter,org.apache.zeppelin.cassandra.CassandraInterpreter,org.apache.zeppelin.geode.GeodeOqlInterpreter,org.apache.zeppelin.postgresql.PostgreSqlInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.kylin.KylinInterpreter,org.apache.zeppelin.elasticsearch.ElasticsearchInterpreter,org.apache.zeppelin.scalding.ScaldingInterpreter,org.apache.zeppelin.alluxio.AlluxioInterpreter,org.apache.zeppelin.hbase.HbaseInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter,org.apache.zeppelin.bigquery.BigQueryInterpreter + org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.rinterpreter.RRepl,org.apache.zeppelin.rinterpreter.KnitR,org.apache.zeppelin.spark.SparkRInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.angular.AngularInterpreter,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.file.HDFSFileInterpreter,org.apache.zeppelin.flink.FlinkInterpreter,,org.apache.zeppelin.python.PythonInterpreter,org.apache.zeppelin.lens.LensInterpreter,org.apache.zeppelin.ignite.IgniteInterpreter,org.apache.zeppelin.ignite.IgniteSqlInterpreter,org.apache.zeppelin.cassandra.CassandraInterpreter,org.apache.zeppelin.geode.GeodeOqlInterpreter,org.apache.zeppelin.postgresql.PostgreSqlInterpreter,org.apache.zeppelin.jdbc.JDBCInterpreter,org.apache.zeppelin.kylin.KylinInterpreter,org.apache.zeppelin.elasticsearch.ElasticsearchInterpreter,org.apache.zeppelin.scalding.ScaldingInterpreter,org.apache.zeppelin.alluxio.AlluxioInterpreter,org.apache.zeppelin.hbase.HbaseInterpreter,org.apache.zeppelin.livy.LivySparkInterpreter,org.apache.zeppelin.livy.LivyPySparkInterpreter,org.apache.zeppelin.livy.LivySparkRInterpreter,org.apache.zeppelin.livy.LivySparkSQLInterpreter,org.apache.zeppelin.bigquery.BigQueryInterpreter,org.apache.zeppelin.beam.BeamInterpreter,org.apache.zeppelin.pig.PigInterpreter, org.apache.zeppelin.pig.PigQueryInterpreter Comma separated interpreter configurations. First interpreter become a default zeppelin.interpreter.group.order - spark,md,angular,sh,livy,alluxio,file,psql,flink,python,ignite,lens,cassandra,geode,kylin,elasticsearch,scalding,jdbc,hbase,bigquery + spark,md,angular,sh,livy,alluxio,file,psql,flink,python,ignite,lens,cassandra,geode,kylin,elasticsearch,scalding,jdbc,hbase,bigquery,beam diff --git a/dev/publish_release.sh b/dev/publish_release.sh index 3a0a0f52f42..fd1083ac974 100755 --- a/dev/publish_release.sh +++ b/dev/publish_release.sh @@ -44,7 +44,7 @@ NC='\033[0m' # No Color RELEASE_VERSION="$1" GIT_TAG="$2" -PUBLISH_PROFILES="-Pbuild-distr -Pspark-2.0 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pr" +PUBLISH_PROFILES="-Ppublish-distr -Pspark-2.0 -Phadoop-2.4 -Pyarn -Ppyspark -Psparkr -Pr" PROJECT_OPTIONS="-pl !zeppelin-distribution" NEXUS_STAGING="https://repository.apache.org/service/local/staging" NEXUS_PROFILE="153446d1ac37c4" diff --git a/docs/README.md b/docs/README.md index a0c4e96c48e..4dc810edf18 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Apache Zeppelin documentation -This README will walk you through building the documentation of Apache Zeppelin. The documentation is included here with Apache Zeppelin source code. The online documentation at [https://zeppelin.apache.org/docs/](https://zeppelin.apache.org/docs/latest) is also generated from the files found in here. +This README will walk you through building the documentation of Apache Zeppelin. The documentation is included here with Apache Zeppelin source code. The online documentation at [https://zeppelin.apache.org/docs/](https://zeppelin.apache.org/docs/latest/) is also generated from the files found in here. ## Build documentation Zeppelin is using [Jekyll](https://jekyllrb.com/) which is a static site generator and [Github Pages](https://pages.github.com/) as a site publisher. For the more details, see [help.github.com/articles/about-github-pages-and-jekyll/](https://help.github.com/articles/about-github-pages-and-jekyll/). diff --git a/docs/_includes/themes/zeppelin/_navigation.html b/docs/_includes/themes/zeppelin/_navigation.html index 9bd9967244a..1b1fdbf1035 100644 --- a/docs/_includes/themes/zeppelin/_navigation.html +++ b/docs/_includes/themes/zeppelin/_navigation.html @@ -33,6 +33,7 @@
  • More
  • Upgrade Zeppelin Version
  • +
  • Install Zeppelin with Flink and Spark Clusters Tutorial
  • @@ -47,6 +48,7 @@
  • Available Interpreters
  • Alluxio
  • +
  • Beam
  • BigQuery
  • Cassandra
  • Elasticsearch
  • @@ -60,6 +62,7 @@
  • Lens
  • Livy
  • Markdown
  • +
  • Pig
  • Python
  • Postgresql, HAWQ
  • R
  • @@ -107,6 +110,7 @@
  • Zeppelin on Spark Cluster Mode (Standalone)
  • Zeppelin on Spark Cluster Mode (YARN)
  • Zeppelin on Spark Cluster Mode (Mesos)
  • +
  • Zeppelin on CDH
  • Contibute
  • Writing Zeppelin Interpreter
  • @@ -115,8 +119,6 @@
  • How to contribute (website)
  • - -