Skip to content

Commit

Permalink
[ZEPPELIN-5771]Zeppelin Interpreter Support Alluxio From 1.0.0 To 2.5…
Browse files Browse the repository at this point in the history
….0 (apache#4410)

* [ZEPPELIN-5771]Zeppelin Interpreter Support Alluxio From 1.0.0 To 2.5.0

* [ZEPPELIN-5771]Fix CheckStyle

* Adjust CI test case to pass alluxio 2.x

* Fix check style

* adapt zeppelin ci

* remove unnecessary test cases

Co-authored-by: glennlgan <[email protected]>
  • Loading branch information
ganlute and glennlgan authored Jul 26, 2022
1 parent 0a115e1 commit 4e9cab5
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 324 deletions.
38 changes: 16 additions & 22 deletions alluxio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,31 @@
<name>Zeppelin: Alluxio interpreter</name>

<properties>
<alluxio.version>1.0.0</alluxio.version>
<alluxio.version>2.5.0</alluxio.version>
<interpreter.name>alluxio</interpreter.name>
</properties>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>15.0</version>
<groupId>org.alluxio</groupId>
<artifactId>alluxio-shell</artifactId>
<version>${alluxio.version}</version>
</dependency>

<!-- TEST -->
<dependency>
<groupId>org.alluxio</groupId>
<artifactId>alluxio-shell</artifactId>
<version>${alluxio.version}</version>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.12.4</version>
<scope>test</scope>
</dependency>

<!-- TEST -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
Expand Down Expand Up @@ -80,33 +87,20 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.alluxio</groupId>
<artifactId>alluxio-core-server</artifactId>
<version>${alluxio.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.alluxio</groupId>
<artifactId>alluxio-minicluster</artifactId>
<version>${alluxio.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.alluxio</groupId>
<artifactId>alluxio-underfs-local</artifactId>
<version>${alluxio.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>3.2.3</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

package org.apache.zeppelin.alluxio;

import alluxio.cli.fs.FileSystemShell;
import alluxio.conf.InstancedConfiguration;
import alluxio.conf.PropertyKey;
import alluxio.conf.Source;
import alluxio.util.ConfigurationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -30,8 +35,6 @@
import java.util.List;
import java.util.Properties;

import alluxio.Configuration;
import alluxio.shell.AlluxioShell;

import org.apache.zeppelin.completer.CompletionType;
import org.apache.zeppelin.interpreter.Interpreter;
Expand All @@ -50,7 +53,7 @@ public class AlluxioInterpreter extends Interpreter {
protected static final String ALLUXIO_MASTER_HOSTNAME = "alluxio.master.hostname";
protected static final String ALLUXIO_MASTER_PORT = "alluxio.master.port";

private AlluxioShell fs;
private FileSystemShell fs;

private int totalCommands = 0;
private int completedCommands = 0;
Expand Down Expand Up @@ -80,13 +83,16 @@ public void open() {

System.setProperty(ALLUXIO_MASTER_HOSTNAME, alluxioMasterHostname);
System.setProperty(ALLUXIO_MASTER_PORT, alluxioMasterPort);
fs = new AlluxioShell(new Configuration());

InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
// Reduce the RPC retry max duration to fall earlier for CLIs
conf.set(PropertyKey.USER_RPC_RETRY_MAX_DURATION, "5s", Source.DEFAULT);
fs = new FileSystemShell(conf);
}

@Override
public void close() {
logger.info("Closing Alluxio shell");

try {
fs.close();
} catch (IOException e) {
Expand Down
Loading

0 comments on commit 4e9cab5

Please sign in to comment.