[zeppelin] 01/01: Revert "[ZEPPELIN-5701] Correct homeNote"

2022-03-31 Thread pdallig
This is an automated email from the ASF dual-hosted git repository.

pdallig pushed a commit to branch revert-4337-bugfix_homepage
in repository https://gitbox.apache.org/repos/asf/zeppelin.git

commit dcf6138ca956f3b2ab6912e092caa1af10a55bb2
Author: Philipp Dallig 
AuthorDate: Thu Mar 31 10:18:16 2022 +0200

Revert "[ZEPPELIN-5701] Correct homeNote"
---
 .../src/main/java/org/apache/zeppelin/service/NotebookService.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
 
b/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
index 2e98031..dfc75eb 100644
--- 
a/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
+++ 
b/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
@@ -103,7 +103,7 @@ public class NotebookService {
   public String getHomeNote(ServiceContext context,
   ServiceCallback callback) throws IOException {
 String noteId = notebook.getConf().getString(ZEPPELIN_NOTEBOOK_HOMESCREEN);
-if (StringUtils.isBlank(noteId)) {
+if (noteId != null) {
   callback.onSuccess(null, context);
 } else {
   notebook.processNote(noteId,


[zeppelin] branch revert-4337-bugfix_homepage created (now dcf6138)

2022-03-31 Thread pdallig
This is an automated email from the ASF dual-hosted git repository.

pdallig pushed a change to branch revert-4337-bugfix_homepage
in repository https://gitbox.apache.org/repos/asf/zeppelin.git.


  at dcf6138  Revert "[ZEPPELIN-5701] Correct homeNote"

This branch includes the following new commits:

 new dcf6138  Revert "[ZEPPELIN-5701] Correct homeNote"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[zeppelin] branch master updated: Correct homeNote

2022-03-31 Thread pdallig
This is an automated email from the ASF dual-hosted git repository.

pdallig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
 new 7c44d6c  Correct homeNote
 new 4235da1  Merge pull request #4337 from Reamer/bugfix_homepage
7c44d6c is described below

commit 7c44d6c15783a6644703e6dcb3980d3fbd3dd9eb
Author: Philipp Dallig 
AuthorDate: Wed Mar 30 13:25:49 2022 +0200

Correct homeNote
---
 .../src/main/java/org/apache/zeppelin/service/NotebookService.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
 
b/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
index dfc75eb..2e98031 100644
--- 
a/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
+++ 
b/zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
@@ -103,7 +103,7 @@ public class NotebookService {
   public String getHomeNote(ServiceContext context,
   ServiceCallback callback) throws IOException {
 String noteId = notebook.getConf().getString(ZEPPELIN_NOTEBOOK_HOMESCREEN);
-if (noteId != null) {
+if (StringUtils.isBlank(noteId)) {
   callback.onSuccess(null, context);
 } else {
   notebook.processNote(noteId,


[zeppelin] branch master updated: [ZEPPELIN-5621] add configuration of tmp_path to store compiled files like scala_shell_tmp-xxx.jar (#4328)

2022-03-31 Thread zjffdu
This is an automated email from the ASF dual-hosted git repository.

zjffdu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
 new 80de2c8  [ZEPPELIN-5621] add configuration of tmp_path to store 
compiled files like scala_shell_tmp-xxx.jar (#4328)
80de2c8 is described below

commit 80de2c811d1367daad975faa069f24d06871522c
Author: Jeff Zhang 
AuthorDate: Thu Mar 31 15:47:23 2022 +0800

[ZEPPELIN-5621] add configuration of tmp_path to store compiled files like 
scala_shell_tmp-xxx.jar (#4328)

* [ZEPPELIN-5621] add configuration of tmp_path to store compiled files 
like scala_shell_tmp-xxx.jar

* Address comment

* fix ci
---
 docs/interpreter/flink.md  |  6 +-
 .../src/main/resources/interpreter-setting.json|  7 +++
 .../apache/zeppelin/flink/internal/FlinkILoop.scala| 18 +-
 3 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/docs/interpreter/flink.md b/docs/interpreter/flink.md
index 8e0476c..029394c 100644
--- a/docs/interpreter/flink.md
+++ b/docs/interpreter/flink.md
@@ -285,7 +285,11 @@ You can also add and set other Flink properties which are 
not listed in the tabl
 true
 Whether display Scala shell output in colorful format
   
-
+  
+zeppelin.flink.scala.shell.tmp_dir
+
+Temp folder for storing scala shell compiled jar
+  
   
 zeppelin.flink.enableHive
 false
diff --git 
a/flink/flink-scala-parent/src/main/resources/interpreter-setting.json 
b/flink/flink-scala-parent/src/main/resources/interpreter-setting.json
index dd67130..9da270a 100644
--- a/flink/flink-scala-parent/src/main/resources/interpreter-setting.json
+++ b/flink/flink-scala-parent/src/main/resources/interpreter-setting.json
@@ -138,6 +138,13 @@
 "description": "Whether display scala shell output in colorful format",
 "type": "checkbox"
   },
+  "zeppelin.flink.scala.shell.tmp_dir": {
+"envName": "zeppelin.flink.scala.shell.tmp_dir",
+"propertyName": "zeppelin.flink.scala.shell.tmp_dir",
+"defaultValue": "",
+"description": "Temp folder for storing scala shell compiled jar",
+"type": "string"
+  },
   "zeppelin.flink.enableHive": {
 "envName": null,
 "propertyName": null,
diff --git 
a/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/internal/FlinkILoop.scala
 
b/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/internal/FlinkILoop.scala
index 1be64ab..eedcbe4 100644
--- 
a/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/internal/FlinkILoop.scala
+++ 
b/flink/flink-scala-parent/src/main/scala/org/apache/zeppelin/flink/internal/FlinkILoop.scala
@@ -22,14 +22,16 @@ package org.apache.zeppelin.flink.internal
 import org.apache.flink.configuration.Configuration
 import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
 import org.apache.flink.util.AbstractID
-import java.io.{BufferedReader, File, FileOutputStream, IOException}
 
+import java.io.{BufferedReader, File, FileOutputStream, IOException}
 import org.apache.flink.streaming.api.environment.{StreamExecutionEnvironment 
=> JStreamExecutionEnvironment}
 import org.apache.flink.api.java.{ExecutionEnvironment => 
JExecutionEnvironment}
 import org.apache.flink.api.scala.ExecutionEnvironment
 import org.apache.flink.core.execution.PipelineExecutorServiceLoader
 import org.apache.zeppelin.flink.{ApplicationModeExecutionEnvironment, 
ApplicationModeStreamEnvironment, FlinkScalaInterpreter}
 import FlinkShell.ExecutionMode
+import org.apache.commons.lang.StringUtils
+import org.slf4j.{Logger, LoggerFactory}
 
 import scala.tools.nsc.interpreter._
 
@@ -45,6 +47,7 @@ class FlinkILoop(
   flinkScalaInterpreter: FlinkScalaInterpreter)
   extends ILoop(in0, out0) {
 
+  private lazy val LOGGER: Logger = LoggerFactory.getLogger(getClass)
 
   // remote environment
   private val (remoteBenv: ScalaShellEnvironment,
@@ -101,11 +104,16 @@ class FlinkILoop(
   private val tmpDirBase: File = {
 // get unique temporary folder:
 val abstractID: String = new AbstractID().toString
-val tmpDir: File = new File(
-  System.getProperty("java.io.tmpdir"),
-  "scala_shell_tmp-" + abstractID)
+var scalaShellTmpParentFolder = 
flinkScalaInterpreter.properties.getProperty("zeppelin.flink.scala.shell.tmp_dir")
+if (StringUtils.isBlank(scalaShellTmpParentFolder)) {
+  scalaShellTmpParentFolder = System.getProperty("java.io.tmpdir")
+}
+val tmpDir: File = new File(scalaShellTmpParentFolder, "scala_shell_tmp-" 
+ abstractID)
+LOGGER.info("Folder for scala shell compiled jar: {}", 
tmpDir.getAbsolutePath)
 if (!tmpDir.exists) {
-  tmpDir.mkdir
+  if (!tmpDir.mkdirs()) {
+throw new IOException(s"Unable to make tmp dir