Skip to content

Commit

Permalink
fixed minor formatting issues preventing the full build (apache#4620)
Browse files Browse the repository at this point in the history
Co-authored-by: Maksim Zinal <[email protected]>
  • Loading branch information
zinal and Maksim Zinal authored Aug 1, 2023
1 parent e3a3468 commit 319dee6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ Thumbs.db
.idea/
*.iml

# vscode project files
.vscode/

# maven target files
target/
**/target/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private InterpreterClient createInterpreterProcess(InterpreterLaunchContext cont

// must first step start check interpreter thread
ClusterInterpreterCheckThread intpCheckThread = new ClusterInterpreterCheckThread(
intpProcess, context.getInterpreterGroupId(), getConnectTimeout(context));
intpProcess, context.getInterpreterGroupId(), getConnectTimeout(context));
intpCheckThread.start();

return intpProcess;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ public DockerInterpreterProcess(
this.containerName = interpreterGroupId.toLowerCase();

containerSparkHome = zconf.getString(ConfVars.ZEPPELIN_DOCKER_CONTAINER_SPARK_HOME);
uploadLocalLibToContainter = zconf.getBoolean(ConfVars.ZEPPELIN_DOCKER_UPLOAD_LOCAL_LIB_TO_CONTAINTER);
uploadLocalLibToContainter = zconf.getBoolean(
ConfVars.ZEPPELIN_DOCKER_UPLOAD_LOCAL_LIB_TO_CONTAINTER);

try {
this.zeppelinHome = getZeppelinHome();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,30 @@ void testCreateIntpProcess() throws IOException {

@Test
void testEnv() throws IOException {
when(zconf.getString(ConfVars.ZEPPELIN_DOCKER_CONTAINER_SPARK_HOME)).thenReturn("my-spark-home");
when(zconf.getBoolean(ConfVars.ZEPPELIN_DOCKER_UPLOAD_LOCAL_LIB_TO_CONTAINTER)).thenReturn(false);
when(zconf.getString(ConfVars.ZEPPELIN_DOCKER_HOST)).thenReturn("http://my-docker-host:2375");
when(zconf.getString(ConfVars.ZEPPELIN_DOCKER_CONTAINER_SPARK_HOME))
.thenReturn("my-spark-home");
when(zconf.getBoolean(ConfVars.ZEPPELIN_DOCKER_UPLOAD_LOCAL_LIB_TO_CONTAINTER))
.thenReturn(false);
when(zconf.getString(ConfVars.ZEPPELIN_DOCKER_HOST))
.thenReturn("http://my-docker-host:2375");

Properties properties = new Properties();
properties.setProperty(
ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_CONNECT_TIMEOUT.getVarName(), "5000");
ZeppelinConfiguration.ConfVars.ZEPPELIN_INTERPRETER_CONNECT_TIMEOUT.getVarName(), "5000");
HashMap<String, String> envs = new HashMap<String, String>();
envs.put("MY_ENV1", "V1");

DockerInterpreterProcess intp = spy(new DockerInterpreterProcess(
zconf,
"interpreter-container:1.0",
"shared_process",
"sh",
"shell",
properties,
envs,
"zeppelin.server.hostname",
12320,
5000, 10));
zconf,
"interpreter-container:1.0",
"shared_process",
"sh",
"shell",
properties,
envs,
"zeppelin.server.hostname",
12320,
5000, 10));

assertEquals("my-spark-home", intp.containerSparkHome);
assertFalse(intp.uploadLocalLibToContainter);
Expand Down

0 comments on commit 319dee6

Please sign in to comment.