This is an automated email from the ASF dual-hosted git repository.

elserj pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.2 by this push:
     new 5c0ad4e  HBASE-21915 Make FileLinkInputStream implement CanUnbuffer
5c0ad4e is described below

commit 5c0ad4ec4df3ab911ddac8230d698a85ccbb926a
Author: Josh Elser <els...@apache.org>
AuthorDate: Fri Feb 15 15:59:30 2019 -0500

    HBASE-21915 Make FileLinkInputStream implement CanUnbuffer
    
    Signed-off-by: Wellington Chevreuil <wellington.chevre...@gmail.com>
    Signed-off-by: Esteban Gutierrez <este...@apache.org>
---
 .../src/main/java/org/apache/hadoop/hbase/io/FileLink.java    | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FileLink.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FileLink.java
index 42f3483..36e086a 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FileLink.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FileLink.java
@@ -31,6 +31,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.hadoop.fs.CanSetDropBehind;
 import org.apache.hadoop.fs.CanSetReadahead;
+import org.apache.hadoop.fs.CanUnbuffer;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FileStatus;
@@ -102,7 +103,7 @@ public class FileLink {
    * and the alternative locations, when the file is moved.
    */
   private static class FileLinkInputStream extends InputStream
-      implements Seekable, PositionedReadable, CanSetDropBehind, 
CanSetReadahead {
+      implements Seekable, PositionedReadable, CanSetDropBehind, 
CanSetReadahead, CanUnbuffer {
     private FSDataInputStream in = null;
     private Path currentPath = null;
     private long pos = 0;
@@ -281,6 +282,14 @@ public class FileLink {
       return false;
     }
 
+    @Override
+    public void unbuffer() {
+      if (in == null) {
+        return;
+      }
+      in.unbuffer();
+    }
+
     /**
      * Try to open the file from one of the available locations.
      *

Reply via email to