diff options
| author | bingoohuang <bingoo.huang@gmail.com> | 2021-02-09 09:49:28 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-09 09:49:28 +0800 |
| commit | 12a78335860c4b1e220748e4adc4097050af5272 (patch) | |
| tree | 545519d7e38d6b17e9accb6dd3b253af26d1852a /other/java/examples | |
| parent | 9e06ef66b9bcca1c2cefc5cd38c34a20cb912c41 (diff) | |
| parent | 5b1def9080b44913280af52821798a9850b42eff (diff) | |
| download | seaweedfs-12a78335860c4b1e220748e4adc4097050af5272.tar.xz seaweedfs-12a78335860c4b1e220748e4adc4097050af5272.zip | |
Merge pull request #1 from chrislusf/master
Diffstat (limited to 'other/java/examples')
3 files changed, 11 insertions, 12 deletions
diff --git a/other/java/examples/pom.xml b/other/java/examples/pom.xml index eb1e73a92..2456113d0 100644 --- a/other/java/examples/pom.xml +++ b/other/java/examples/pom.xml @@ -11,13 +11,13 @@ <dependency> <groupId>com.github.chrislusf</groupId> <artifactId>seaweedfs-client</artifactId> - <version>1.6.0</version> + <version>1.6.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.github.chrislusf</groupId> <artifactId>seaweedfs-hadoop2-client</artifactId> - <version>1.6.0</version> + <version>1.6.1</version> <scope>compile</scope> </dependency> <dependency> diff --git a/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleReadFile.java b/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleReadFile.java index bd73df802..d2eb94135 100644 --- a/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleReadFile.java +++ b/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleReadFile.java @@ -1,6 +1,6 @@ package com.seaweedfs.examples; -import seaweedfs.client.FilerGrpcClient; +import seaweedfs.client.FilerClient; import seaweedfs.client.SeaweedInputStream; import java.io.FileInputStream; @@ -13,7 +13,7 @@ public class ExampleReadFile { public static void main(String[] args) throws IOException { - FilerGrpcClient filerGrpcClient = new FilerGrpcClient("localhost", 18888); + FilerClient filerClient = new FilerClient("localhost", 18888); long startTime = System.currentTimeMillis(); parseZip("/Users/chris/tmp/test.zip"); @@ -23,7 +23,7 @@ public class ExampleReadFile { long localProcessTime = startTime2 - startTime; SeaweedInputStream seaweedInputStream = new SeaweedInputStream( - filerGrpcClient, "/test.zip"); + filerClient, "/test.zip"); parseZip(seaweedInputStream); long swProcessTime = System.currentTimeMillis() - startTime2; diff --git a/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile.java b/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile.java index 228a3c0b7..26b74028f 100644 --- a/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile.java +++ b/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile.java @@ -1,6 +1,6 @@ package com.seaweedfs.examples; -import seaweedfs.client.FilerGrpcClient; +import seaweedfs.client.FilerClient; import seaweedfs.client.SeaweedInputStream; import seaweedfs.client.SeaweedOutputStream; @@ -13,15 +13,14 @@ public class ExampleWriteFile { public static void main(String[] args) throws IOException { - FilerGrpcClient filerGrpcClient = new FilerGrpcClient("localhost", 18888); + FilerClient filerClient = new FilerClient("localhost", 18888); - SeaweedInputStream seaweedInputStream = new SeaweedInputStream( - filerGrpcClient, "/test.zip"); - unZipFiles(filerGrpcClient, seaweedInputStream); + SeaweedInputStream seaweedInputStream = new SeaweedInputStream(filerClient, "/test.zip"); + unZipFiles(filerClient, seaweedInputStream); } - public static void unZipFiles(FilerGrpcClient filerGrpcClient, InputStream is) throws IOException { + public static void unZipFiles(FilerClient filerClient, InputStream is) throws IOException { ZipInputStream zin = new ZipInputStream(is); ZipEntry ze; while ((ze = zin.getNextEntry()) != null) { @@ -34,7 +33,7 @@ public class ExampleWriteFile { continue; } - SeaweedOutputStream seaweedOutputStream = new SeaweedOutputStream(filerGrpcClient, "/test/"+filename); + SeaweedOutputStream seaweedOutputStream = new SeaweedOutputStream(filerClient, "/test/"+filename); byte[] bytesIn = new byte[16 * 1024]; int read = 0; while ((read = zin.read(bytesIn))!=-1) { |
