aboutsummaryrefslogtreecommitdiff
path: root/other/java/hdfs2/src
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-08-03 09:06:09 -0700
committerChris Lu <chris.lu@gmail.com>2020-08-03 09:06:09 -0700
commitb3089dcc8eaf9b1018bab68bb64e4fa3af6f4bd6 (patch)
treeb8e574444682d9650ec2099938658f81433b215d /other/java/hdfs2/src
parent53190a997261a1d2a1d98d1f64eaea2d6a82124e (diff)
downloadseaweedfs-b3089dcc8eaf9b1018bab68bb64e4fa3af6f4bd6.tar.xz
seaweedfs-b3089dcc8eaf9b1018bab68bb64e4fa3af6f4bd6.zip
add read ahead input stream
Diffstat (limited to 'other/java/hdfs2/src')
-rw-r--r--other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java3
1 files changed, 2 insertions, 1 deletions
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 fd8877806..836bb4db5 100644
--- a/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
+++ b/other/java/hdfs2/src/main/java/seaweed/hdfs/SeaweedFileSystem.java
@@ -11,6 +11,7 @@ import org.apache.hadoop.util.Progressable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import seaweedfs.client.FilerProto;
+import seaweedfs.client.ReadAheadInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -76,7 +77,7 @@ public class SeaweedFileSystem extends FileSystem {
try {
FSInputStream inputStream = seaweedFileSystemStore.openFileForRead(path, statistics, bufferSize);
- return new FSDataInputStream(new BufferedFSInputStream(inputStream, 16 * 1024 * 1024));
+ return new FSDataInputStream(new ReadAheadInputStream(inputStream, 16 * 1024 * 1024));
} catch (Exception ex) {
LOG.warn("open path: {} bufferSize:{}", path, bufferSize, ex);
return null;