hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxi...@apache.org
Subject svn commit: r1551820 - /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
Date Wed, 18 Dec 2013 03:20:24 GMT
Author: jxiang
Date: Wed Dec 18 03:20:22 2013
New Revision: 1551820

URL: http://svn.apache.org/r1551820
Log:
HBASE-10159 Replaced deprecated interface Closeable

Modified:
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java?rev=1551820&r1=1551819&r2=1551820&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java
Wed Dec 18 03:20:22 2013
@@ -20,6 +20,7 @@
 
 package org.apache.hadoop.hbase.fs;
 
+import java.io.Closeable;
 import java.io.IOException;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationHandler;
@@ -46,7 +47,7 @@ import org.apache.hadoop.hdfs.protocol.C
 import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
 import org.apache.hadoop.hdfs.protocol.LocatedBlock;
 import org.apache.hadoop.hdfs.protocol.LocatedBlocks;
-import org.apache.hadoop.io.Closeable;
+import org.apache.hadoop.ipc.RPC;
 import org.apache.hadoop.util.Progressable;
 import org.apache.hadoop.util.ReflectionUtils;
 
@@ -263,15 +264,21 @@ public class HFileSystem extends FilterF
               public Object invoke(Object proxy, Method method,
                                    Object[] args) throws Throwable {
                 try { 
-                  Object res = method.invoke(cp, args);
-                  if (res != null && args != null && args.length == 3
-                      && "getBlockLocations".equals(method.getName())
-                      && res instanceof LocatedBlocks
-                      && args[0] instanceof String
-                      && args[0] != null) {
-                    lrb.reorderBlocks(conf, (LocatedBlocks) res, (String) args[0]);
+                  if ((args == null || args.length == 0)
+                      && "close".equals(method.getName())) {
+                    RPC.stopProxy(cp);
+                    return null;
+                  } else {
+                    Object res = method.invoke(cp, args);
+                    if (res != null && args != null && args.length == 3
+                        && "getBlockLocations".equals(method.getName())
+                        && res instanceof LocatedBlocks
+                        && args[0] instanceof String
+                        && args[0] != null) {
+                      lrb.reorderBlocks(conf, (LocatedBlocks) res, (String) args[0]);
+                    }
+                    return res;
                   }
-                  return res;
                 } catch  (InvocationTargetException ite) {
                   // We will have this for all the exception, checked on not, sent
                   //  by any layer, including the functional exception
@@ -370,6 +377,7 @@ public class HFileSystem extends FilterF
    * createNonRecursive. This is a hadoop bug and when it is fixed in Hadoop,
    * this definition will go away.
    */
+  @SuppressWarnings("deprecation")
   public FSDataOutputStream createNonRecursive(Path f,
       boolean overwrite,
       int bufferSize, short replication, long blockSize,



Mime
View raw message