From e43b527702178c38eee5ccf38bf55a663c9be159 Mon Sep 17 00:00:00 2001 From: jxiang Date: Tue, 17 Dec 2013 17:06:38 +0000 Subject: [PATCH] HBASE-10159 Replaced deprecated interface Closeable git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1551631 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/hadoop/hbase/fs/HFileSystem.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java index 135213d52df..81787870d56 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/fs/HFileSystem.java @@ -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,6 @@ import org.apache.hadoop.hdfs.protocol.ClientProtocol; 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; @@ -264,12 +264,9 @@ public class HFileSystem extends FilterFileSystem { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { try { - if ((args == null || args.length == 0) && "close".equals(method.getName())) { - if (cp instanceof Closeable) { - ((Closeable)cp).close(); - } else { - RPC.stopProxy(cp); - } + if ((args == null || args.length == 0) + && "close".equals(method.getName())) { + RPC.stopProxy(cp); return null; } else { Object res = method.invoke(cp, args); @@ -380,6 +377,7 @@ public class HFileSystem extends FilterFileSystem { * 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,