]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
hadoop: track Hadoop API changes
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 27 May 2011 21:46:19 +0000 (14:46 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 27 May 2011 21:46:37 +0000 (14:46 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/client/hadoop/ceph/CephFS.java
src/client/hadoop/ceph/CephFileSystem.java
src/client/hadoop/ceph/TestCeph.java

index 7c92fce76fcb8908fcffa253dc829134a8f8f84a..f9e1a061c94739054e3d1ae02bfd7828431a7d45 100644 (file)
@@ -209,13 +209,13 @@ abstract class CephFS {
   abstract protected int ceph_statfs(String path, CephFileSystem.CephStat fill);
 
   /*
-   * Check how many times a path should be replicated (if it is
-   * degraded it may not actually be replicated this often).
+   * Check how many times a file should be replicated. If it is,
+   * degraded it may not actually be replicated this often.
    * Inputs:
-   *  String path: The path to check.
+   *  int fh: a file descriptor
    * Returns: an int containing the number of times replicated.
    */
-  abstract protected int ceph_replication(String path);
+  abstract protected int ceph_replication(int fh);
 
   /*
    * Find the IP address of the primary OSD for a given file and offset.
index 2ea2683fa712b2d58cd4b0189c8257e150723b0e..d081558d1d167034740e86eecd04a90c64332a48 100644 (file)
@@ -535,7 +535,7 @@ public class CephFileSystem extends FileSystem {
    */
   public FSDataOutputStream create(Path path,
       FsPermission permission,
-      EnumSet<CreateFlag> flag,
+      boolean overwrite,
       // boolean overwrite,
       int bufferSize,
       short replication,
@@ -554,8 +554,8 @@ public class CephFileSystem extends FileSystem {
     }
     // We ignore replication since that's not configurable here, and
     // progress reporting is quite limited.
-    // Required semantics: if the file exists, overwrite if CreateFlag.OVERWRITE;
-    // throw an exception if !CreateFlag.OVERWRITE.
+    // Required semantics: if the file exists, overwrite if 'overwrite' is set;
+    // otherwise, throw an exception
 
     // Step 1: existence test
     boolean exists = exists(abs_path);
@@ -566,8 +566,7 @@ public class CephFileSystem extends FileSystem {
             "create: Cannot overwrite existing directory \"" + path.toString()
             + "\" with a file");
       }
-      // if (!overwrite)
-      if (!flag.contains(CreateFlag.OVERWRITE)) {
+      if (!overwrite) {
         throw new IOException(
             "createRaw: Cannot open existing file \"" + abs_path.toString()
             + "\" for writing without overwrite flag");
index 7f872c888b2e1928e2aa91f07900ee8e510d212d..a63fc6265b12d8053832e37cb406e5518ad55ac0 100644 (file)
@@ -25,8 +25,8 @@ package org.apache.hadoop.fs.ceph;
 
 import java.io.IOException;
 import java.net.URI;
-import org.apache.hadoop.fs.FileSystemContractBaseTest;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystemContractBaseTest;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;