]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Hadoop: Remove unused getLength and supporting C stuff.
authorGreg Farnum <gregf@hq.newdream.net>
Sat, 15 Aug 2009 00:04:29 +0000 (17:04 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Mon, 17 Aug 2009 19:21:14 +0000 (12:21 -0700)
src/client/hadoop/CephFSInterface.cc
src/client/hadoop/CephFSInterface.h
src/client/hadoop/ceph/CephFileSystem.java

index 1a20c7cde9c49b5b40840147c55d0c089c33be02..f96058fb7e40f1e80ce59bde736219c8b3a95f8a 100644 (file)
@@ -251,32 +251,6 @@ JNIEXPORT jlong JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1getb
   return result;
 }
 
-/*
- * Class:     org_apache_hadoop_fs_ceph_CephFileSystem
- * Method:    ceph_getfilesize
- * Signature: (Ljava/lang/String;)J
- * Returns the file size, or -1 on failure.
- */
-JNIEXPORT jlong JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1getfilesize
-  (JNIEnv *env, jobject, jstring j_path)
-{
-  dout(10) << "In getfilesize" << dendl;
-
-  struct stat stbuf;
-
-  jlong result;
-
-  const char* c_path = env->GetStringUTFChars(j_path, 0);
-  if (c_path == NULL) return -ENOMEM;
-  result = ceph_lstat(c_path, &stbuf);
-  env->ReleaseStringUTFChars(j_path, c_path);
-
-  if (result < 0) return result;
-  else result = stbuf.st_size;
-
-  return result;
-}
-
 /*
  * Class:     org_apache_hadoop_fs_ceph_CephFileSystem
  * Method:    ceph_isfile
index 955a4ec5a592d632231999c93536c7e2f2de8180..db06d38c5b76a6a058ff062ade037669744ddd6c 100644 (file)
@@ -86,14 +86,6 @@ JNIEXPORT jboolean JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1e
 JNIEXPORT jlong JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1getblocksize
   (JNIEnv *, jobject, jstring);
 
-/*
- * Class:     org_apache_hadoop_fs_ceph_CephFileSystem
- * Method:    ceph_getfilesize
- * Signature: (Ljava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_org_apache_hadoop_fs_ceph_CephFileSystem_ceph_1getfilesize
-  (JNIEnv *, jobject, jstring);
-
 /*
  * Class:     org_apache_hadoop_fs_ceph_CephFileSystem
  * Method:    ceph_isdirectory
index 53c9d090f91f754d55bd114dbc8e846cd7fddfa1..01a77c8c47e1d6c73c8a744823dc99d0c7f99829 100644 (file)
@@ -71,7 +71,6 @@ public class CephFileSystem extends FileSystem {
   private native boolean ceph_rename(String old_path, String new_path);
   private native boolean ceph_exists(String path);
   private native long    ceph_getblocksize(String path);
-  private native long    ceph_getfilesize(String path);
   private native boolean ceph_isdirectory(String path);
   private native boolean ceph_isfile(String path);
   private native String[] ceph_getdir(String path);
@@ -791,22 +790,6 @@ public class CephFileSystem extends FileSystem {
     }
   }
  
-  private long __getLength(Path path) throws IOException {
-    debug("__getLength:enter with path " + path);
-    Path abs_path = makeAbsolute(path);
-
-    if (!exists(abs_path)) {
-      throw new FileNotFoundException("org.apache.hadoop.fs.ceph.CephFileSystem.__getLength: File or directory " + abs_path.toString() + " does not exist.");
-    }    
-    
-    long filesize = ceph_getfilesize(abs_path.toString());
-    if (filesize < 0) {
-      throw new IOException("org.apache.hadoop.fs.ceph.CephFileSystem.getLength: Size of file or directory " + abs_path.toString() + " could not be retrieved.");
-    }
-    debug("__getLength:exit with size " + filesize);
-    return filesize;
-  }
-
   private Path[] listPaths(Path path) throws IOException {
     debug("listPaths:enter with path " + path);
     String dirlist[];