aboutsummaryrefslogtreecommitdiff
path: root/other/java/examples/src
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-02-04 18:44:57 -0800
committerChris Lu <chris.lu@gmail.com>2021-02-04 18:44:57 -0800
commit502554887f58915c077462372db4e2813eac3f92 (patch)
treec3762605197b89ea25ab35f858397cbca3ab4f39 /other/java/examples/src
parentc3af72d950d93bfa0d42f9e2bf68d183c6285d73 (diff)
downloadseaweedfs-502554887f58915c077462372db4e2813eac3f92.tar.xz
seaweedfs-502554887f58915c077462372db4e2813eac3f92.zip
Java: add SeaweedInputStream example
Diffstat (limited to 'other/java/examples/src')
-rw-r--r--other/java/examples/src/main/java/com/seaweedfs/examples/UnzipFile.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/other/java/examples/src/main/java/com/seaweedfs/examples/UnzipFile.java b/other/java/examples/src/main/java/com/seaweedfs/examples/UnzipFile.java
index 317327be4..fad1471b6 100644
--- a/other/java/examples/src/main/java/com/seaweedfs/examples/UnzipFile.java
+++ b/other/java/examples/src/main/java/com/seaweedfs/examples/UnzipFile.java
@@ -1,8 +1,7 @@
package com.seaweedfs.examples;
-import seaweed.hdfs.SeaweedHadoopInputStream;
-import seaweedfs.client.FilerClient;
import seaweedfs.client.FilerGrpcClient;
+import seaweedfs.client.SeaweedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
@@ -15,7 +14,6 @@ public class UnzipFile {
public static void main(String[] args) throws IOException {
FilerGrpcClient filerGrpcClient = new FilerGrpcClient("localhost", 18888);
- FilerClient filerClient = new FilerClient(filerGrpcClient);
long startTime = System.currentTimeMillis();
parseZip("/Users/chris/tmp/test.zip");
@@ -24,12 +22,8 @@ public class UnzipFile {
long localProcessTime = startTime2 - startTime;
- SeaweedHadoopInputStream seaweedInputStream = new SeaweedHadoopInputStream(
- filerGrpcClient,
- new org.apache.hadoop.fs.FileSystem.Statistics(""),
- "/",
- filerClient.lookupEntry("/", "test.zip")
- );
+ SeaweedInputStream seaweedInputStream = new SeaweedInputStream(
+ filerGrpcClient, "/", "test.zip");
parseZip(seaweedInputStream);
long swProcessTime = System.currentTimeMillis() - startTime2;