diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-07-29 21:33:10 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-07-29 21:33:10 -0700 |
| commit | 6b41c5250bd8119c8fb5485ca9a2f2e42798a91e (patch) | |
| tree | 9652b1a2bb6b52201efb2bece2a4180c8765e3cc | |
| parent | 703057bff9d8a1ef02af43722e0fd5bd6c536a7e (diff) | |
| download | seaweedfs-6b41c5250bd8119c8fb5485ca9a2f2e42798a91e.tar.xz seaweedfs-6b41c5250bd8119c8fb5485ca9a2f2e42798a91e.zip | |
Hadoop file system: 1.4.3
added buffered fs input stream
13 files changed, 17 insertions, 113 deletions
diff --git a/other/java/client/pom.xml b/other/java/client/pom.xml index b2e88935c..57233e86d 100644 --- a/other/java/client/pom.xml +++ b/other/java/client/pom.xml @@ -5,7 +5,7 @@ <groupId>com.github.chrislusf</groupId> <artifactId>seaweedfs-client</artifactId> - <version>1.4.1</version> + <version>1.4.3</version> <parent> <groupId>org.sonatype.oss</groupId> diff --git a/other/java/client/pom.xml.deploy b/other/java/client/pom.xml.deploy index b2e88935c..57233e86d 100644 --- a/other/java/client/pom.xml.deploy +++ b/other/java/client/pom.xml.deploy @@ -5,7 +5,7 @@ <groupId>com.github.chrislusf</groupId> <artifactId>seaweedfs-client</artifactId> - <version>1.4.1</version> + <version>1.4.3</version> <parent> <groupId>org.sonatype.oss</groupId> diff --git a/other/java/client/pom_debug.xml b/other/java/client/pom_debug.xml index d2d4cbb5d..67bab76ea 100644 --- a/other/java/client/pom_debug.xml +++ b/other/java/client/pom_debug.xml @@ -5,7 +5,7 @@ <groupId>com.github.chrislusf</groupId> <artifactId>seaweedfs-client</artifactId> - <version>1.4.1</version> + <version>1.4.3</version> <parent> <groupId>org.sonatype.oss</groupId> diff --git a/other/java/hdfs2/dependency-reduced-pom.xml b/other/java/hdfs2/dependency-reduced-pom.xml index 9d0c501ae..8df1a6356 100644 --- a/other/java/hdfs2/dependency-reduced-pom.xml +++ b/other/java/hdfs2/dependency-reduced-pom.xml @@ -127,7 +127,7 @@ </snapshotRepository>
</distributionManagement>
<properties>
- <seaweedfs.client.version>1.4.1</seaweedfs.client.version>
+ <seaweedfs.client.version>1.4.3</seaweedfs.client.version>
<hadoop.version>2.9.2</hadoop.version>
</properties>
</project>
diff --git a/other/java/hdfs2/pom.xml b/other/java/hdfs2/pom.xml index 25a968c07..3406e12cb 100644 --- a/other/java/hdfs2/pom.xml +++ b/other/java/hdfs2/pom.xml @@ -5,7 +5,7 @@ <modelVersion>4.0.0</modelVersion> <properties> - <seaweedfs.client.version>1.4.1</seaweedfs.client.version> + <seaweedfs.client.version>1.4.3</seaweedfs.client.version> <hadoop.version>2.9.2</hadoop.version> </properties> diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/BufferedSeaweedInputStream.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/BufferedSeaweedInputStream.java deleted file mode 100644 index 0bee6e43f..000000000 --- a/other/java/hdfs2/src/main/java/seaweed/hdfs/BufferedSeaweedInputStream.java +++ /dev/null @@ -1,49 +0,0 @@ -package seaweed.hdfs; - -import org.apache.hadoop.fs.PositionedReadable; -import org.apache.hadoop.fs.Seekable; - -import java.io.BufferedInputStream; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; - -class BufferedSeaweedInputStream extends FilterInputStream implements Seekable, PositionedReadable { - - SeaweedInputStream t; - - protected BufferedSeaweedInputStream(InputStream in, int bufferSize) { - super(new BufferedInputStream(in, bufferSize)); - t = (SeaweedInputStream)in; - } - - @Override - public int read(long position, byte[] buffer, int offset, int length) throws IOException { - return this.t.read(position,buffer,offset,length); - } - - @Override - public void readFully(long position, byte[] buffer, int offset, int length) throws IOException { - this.t.readFully(position,buffer,offset,length); - } - - @Override - public void readFully(long position, byte[] buffer) throws IOException { - this.t.readFully(position,buffer); - } - - @Override - public void seek(long pos) throws IOException { - this.t.seek(pos); - } - - @Override - public long getPos() throws IOException { - return this.t.getPos(); - } - - @Override - public boolean seekToNewSource(long targetPos) throws IOException { - return this.t.seekToNewSource(targetPos); - } -} diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java index 585fa39a3..fd8877806 100644 --- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java +++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java @@ -75,8 +75,8 @@ public class SeaweedFileSystem extends FileSystem { path = qualify(path); try { - InputStream inputStream = seaweedFileSystemStore.openFileForRead(path, statistics, bufferSize); - return new FSDataInputStream(new BufferedSeaweedInputStream(inputStream, 16 * 1024 * 1024)); + FSInputStream inputStream = seaweedFileSystemStore.openFileForRead(path, statistics, bufferSize); + return new FSDataInputStream(new BufferedFSInputStream(inputStream, 16 * 1024 * 1024)); } catch (Exception ex) { LOG.warn("open path: {} bufferSize:{}", path, bufferSize, ex); return null; diff --git a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java index d9c6d6f0d..0db6a1f49 100644 --- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java +++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java @@ -1,5 +1,6 @@ package seaweed.hdfs; +import org.apache.hadoop.fs.FSInputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -207,8 +208,8 @@ public class SeaweedFileSystemStore { } - public InputStream openFileForRead(final Path path, FileSystem.Statistics statistics, - int bufferSize) throws IOException { + public FSInputStream openFileForRead(final Path path, FileSystem.Statistics statistics, + int bufferSize) throws IOException { LOG.debug("openFileForRead path:{} bufferSize:{}", path, bufferSize); diff --git a/other/java/hdfs3/dependency-reduced-pom.xml b/other/java/hdfs3/dependency-reduced-pom.xml index 0b01074c3..5b13f7d02 100644 --- a/other/java/hdfs3/dependency-reduced-pom.xml +++ b/other/java/hdfs3/dependency-reduced-pom.xml @@ -127,7 +127,7 @@ </snapshotRepository>
</distributionManagement>
<properties>
- <seaweedfs.client.version>1.4.1</seaweedfs.client.version>
+ <seaweedfs.client.version>1.4.3</seaweedfs.client.version>
<hadoop.version>3.1.1</hadoop.version>
</properties>
</project>
diff --git a/other/java/hdfs3/pom.xml b/other/java/hdfs3/pom.xml index 025843d3c..e5209105d 100644 --- a/other/java/hdfs3/pom.xml +++ b/other/java/hdfs3/pom.xml @@ -5,7 +5,7 @@ <modelVersion>4.0.0</modelVersion> <properties> - <seaweedfs.client.version>1.4.1</seaweedfs.client.version> + <seaweedfs.client.version>1.4.3</seaweedfs.client.version> <hadoop.version>3.1.1</hadoop.version> </properties> diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/BufferedSeaweedInputStream.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/BufferedSeaweedInputStream.java deleted file mode 100644 index 0bee6e43f..000000000 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/BufferedSeaweedInputStream.java +++ /dev/null @@ -1,49 +0,0 @@ -package seaweed.hdfs; - -import org.apache.hadoop.fs.PositionedReadable; -import org.apache.hadoop.fs.Seekable; - -import java.io.BufferedInputStream; -import java.io.FilterInputStream; -import java.io.IOException; -import java.io.InputStream; - -class BufferedSeaweedInputStream extends FilterInputStream implements Seekable, PositionedReadable { - - SeaweedInputStream t; - - protected BufferedSeaweedInputStream(InputStream in, int bufferSize) { - super(new BufferedInputStream(in, bufferSize)); - t = (SeaweedInputStream)in; - } - - @Override - public int read(long position, byte[] buffer, int offset, int length) throws IOException { - return this.t.read(position,buffer,offset,length); - } - - @Override - public void readFully(long position, byte[] buffer, int offset, int length) throws IOException { - this.t.readFully(position,buffer,offset,length); - } - - @Override - public void readFully(long position, byte[] buffer) throws IOException { - this.t.readFully(position,buffer); - } - - @Override - public void seek(long pos) throws IOException { - this.t.seek(pos); - } - - @Override - public long getPos() throws IOException { - return this.t.getPos(); - } - - @Override - public boolean seekToNewSource(long targetPos) throws IOException { - return this.t.seekToNewSource(targetPos); - } -} diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java index 585fa39a3..fd8877806 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java @@ -75,8 +75,8 @@ public class SeaweedFileSystem extends FileSystem { path = qualify(path); try { - InputStream inputStream = seaweedFileSystemStore.openFileForRead(path, statistics, bufferSize); - return new FSDataInputStream(new BufferedSeaweedInputStream(inputStream, 16 * 1024 * 1024)); + FSInputStream inputStream = seaweedFileSystemStore.openFileForRead(path, statistics, bufferSize); + return new FSDataInputStream(new BufferedFSInputStream(inputStream, 16 * 1024 * 1024)); } catch (Exception ex) { LOG.warn("open path: {} bufferSize:{}", path, bufferSize, ex); return null; diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java index d9c6d6f0d..0db6a1f49 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java @@ -1,5 +1,6 @@ package seaweed.hdfs; +import org.apache.hadoop.fs.FSInputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; @@ -207,8 +208,8 @@ public class SeaweedFileSystemStore { } - public InputStream openFileForRead(final Path path, FileSystem.Statistics statistics, - int bufferSize) throws IOException { + public FSInputStream openFileForRead(final Path path, FileSystem.Statistics statistics, + int bufferSize) throws IOException { LOG.debug("openFileForRead path:{} bufferSize:{}", path, bufferSize); |
