From: Greg Farnum Date: Fri, 7 Aug 2009 00:55:15 +0000 (-0700) Subject: Hadoop: Changed back to isDirectory as that X-Git-Tag: v0.13~118 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=83c11b9efe404874599685a40b1d4368611cd96a;p=ceph.git Hadoop: Changed back to isDirectory as that method was un-deprecated. --- diff --git a/src/client/hadoop/ceph/CephFileSystem.java b/src/client/hadoop/ceph/CephFileSystem.java index ae64d8c1e6f..17b76149377 100644 --- a/src/client/hadoop/ceph/CephFileSystem.java +++ b/src/client/hadoop/ceph/CephFileSystem.java @@ -164,7 +164,7 @@ public class CephFileSystem extends FileSystem { boolean isDir = false; boolean path_exists = false; try { - isDir = __isDirectory(abs_path); + isDir = isDirectory(abs_path); path_exists = exists(abs_path); } @@ -312,7 +312,7 @@ public class CephFileSystem extends FileSystem { // throw an exception if !CreateFlag.OVERWRITE. // Step 1: existence test - if(__isDirectory(abs_path)) + if(isDirectory(abs_path)) throw new IOException("create: Cannot overwrite existing directory \"" + abs_path.toString() + "\" with a file"); //if (!flag.contains(CreateFlag.OVERWRITE)) { @@ -539,9 +539,13 @@ public class CephFileSystem extends FileSystem { return new_path; } } - - private boolean __isDirectory(Path path) throws IOException { - debug("__isDirectory:enter with path " + path); + + /* + * This method is a bit faster than doing a full stat is. + */ + @Override + public boolean isDirectory(Path path) throws IOException { + debug("isDirectory:enter with path " + path); Path abs_path = makeAbsolute(path); boolean result; if (abs_path.toString().equals("/")) { @@ -552,7 +556,7 @@ public class CephFileSystem extends FileSystem { result = ceph_isdirectory(abs_path.toString()); debug("Returned from ceph_isdirectory to Java"); } - debug("__isDirectory:exit with result " + result); + debug("isDirectory:exit with result " + result); return result; } @@ -579,7 +583,7 @@ public class CephFileSystem extends FileSystem { Path abs_path = makeAbsolute(path); // If it's a directory, get the listing. Otherwise, complain and give up. - if (__isDirectory(abs_path)) { + if (isDirectory(abs_path)) { debug("calling ceph_getdir from Java with path " + abs_path); dirlist = ceph_getdir(abs_path.toString()); debug("returning from ceph_getdir to Java");