]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Hadoop: Change to work with trunk rather than .20; update documentation.
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 10 Sep 2009 23:10:36 +0000 (16:10 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Fri, 11 Sep 2009 21:20:52 +0000 (14:20 -0700)
src/client/hadoop/ceph/CephFileSystem.java
src/client/hadoop/ceph/package.html

index 9fa9ee18b6c59bfce24e61a995218ca0b6bfe006..2f1b1b5c66d9bc68e378226cf4c0811f51db19a0 100644 (file)
@@ -23,8 +23,8 @@ import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.fs.permission.FsAction;
 import org.apache.hadoop.util.Progressable;
 import org.apache.hadoop.fs.FileStatus;
-//import org.apache.hadoop.fs.FsStatus;
-//import org.apache.hadoop.fs.CreateFlag;
+import org.apache.hadoop.fs.FsStatus;
+import org.apache.hadoop.fs.CreateFlag;
 
 /**
  * <p>
@@ -442,11 +442,15 @@ public class CephFileSystem extends FileSystem {
    * Create a new file and open an FSDataOutputStream that's connected to it.
    * @param path The file to create.
    * @param permission The permissions to apply to the file.
-   * @param overwrite If true, overwrite any existing file with this name.
+   * @param flag If CreateFlag.OVERWRITE, overwrite any existing
+   * file with this name; otherwise don't.
    * @param bufferSize Ceph does internal buffering; this is ignored.
-   * @param replication Ignored by Ceph. This can be configured via Ceph configuration.
-   * @param blockSize Ignored by Ceph.
-   * @param progress A Progressable to report back to. Reporting is limited but exists.
+   * @param replication Ignored by Ceph. This can be
+   * configured via Ceph configuration.
+   * @param blockSize Ignored by Ceph. You can set client-wide block sizes
+   * via the fs.ceph.blockSize param if you like.
+   * @param progress A Progressable to report back to.
+   * Reporting is limited but exists.
    * @return An FSDataOutputStream pointing to the created file.
    * @throws IOException if initialize() hasn't been called, or the path is an
    * existing directory, or the path exists but overwrite is false, or there is a
@@ -454,8 +458,8 @@ public class CephFileSystem extends FileSystem {
    */
   public FSDataOutputStream create(Path path,
                                   FsPermission permission,
-                                  //EnumSet<CreateFlag> flag,
-                                  boolean overwrite,
+                                  EnumSet<CreateFlag> flag,
+                                  //boolean overwrite,
                                   int bufferSize,
                                   short replication,
                                   long blockSize,
@@ -477,8 +481,8 @@ public class CephFileSystem extends FileSystem {
       if(isDirectory(abs_path))
        throw new IOException("create: Cannot overwrite existing directory \""
                              + path.toString() + "\" with a file");
-      if (!overwrite)
-      //if (!flag.contains(CreateFlag.OVERWRITE)) {
+      //if (!overwrite)
+      if (!flag.contains(CreateFlag.OVERWRITE))
        throw new IOException("createRaw: Cannot open existing file \"" 
                              + abs_path.toString() 
                              + "\" for writing without overwrite flag");
@@ -510,7 +514,7 @@ public class CephFileSystem extends FileSystem {
     OutputStream cephOStream = new CephOutputStream(getConf(), fh);
     if(debug) debug("create:exit");
     return new FSDataOutputStream(cephOStream);
-  }
+    }
 
   /**
    * Open a Ceph file and attach the file handle to an FSDataInputStream.
@@ -621,7 +625,7 @@ public class CephFileSystem extends FileSystem {
    * @return FsStatus reportin capacity, usage, and remaining spac.
    * @throws IOException if initialize() hasn't been called, or the
    * stat somehow fails.
-   *
+   */
   public FsStatus getStatus (Path path) throws IOException {
     if (!initialized) throw new IOException("You have to initialize the"
                      + " CephFileSystem before calling other methods.");
@@ -637,7 +641,7 @@ public class CephFileSystem extends FileSystem {
     if(debug) debug("getStatus:exit");
     return new FsStatus(ceph_stat.capacity,
                        ceph_stat.used, ceph_stat.remaining);
-  } */
+  }
 
   /**
    * Delete the given path, and any children if it's a directory.
index f6ceaaefc6c93d3c67355a716d6e3b4191469262..bcf561a5e1c89bb4297462015dfdce8da422566d 100644 (file)
@@ -23,8 +23,8 @@
 
 <h3>Introduction</h3>
 
-This page describes how to use <a href="http://ceph.newdream.net"> Ceph </a>
-as a backing store with Hadoop.   This page assumes that you have downloaded
+This page describes how to use <a href="http://ceph.newdream.net">Ceph</a>
+as a backing store with Hadoop. This page assumes that you have downloaded
 the Ceph software and installed necessary binaries as outlined in the Ceph
 documentation.
 
@@ -52,6 +52,44 @@ documentation.
   &lt;value&gt;/usr/local/lib&lt;/value&gt;
   &lt;description&gt;The folder holding libceph and libhadoopceph&lt;/description&gt;
   &lt;/property&gt;
+</pre>
+  <li>There are also a number of optional Ceph configuration options.
+<pre>
+&lt;property&gt;
+  &lt;name&gt;fs.ceph.blockSize&lt;/name&gt;
+  &lt;value&gt;67108864&lt;/value&gt;
+  &lt;description&gt;Defaulting to 64MB, this is the size (in bytes) you want Ceph to use in striping data internally and presenting it to Hadoop.&lt;/description&gt;
+&lt;/property&gt;
+
+&lt;property&gt;
+  &lt;name&gt;fs.ceph.debug&lt;/name&gt;
+  &lt;value&gt;true&lt;/value&gt;
+  &lt;description&gt;If true, the Java-based code will print debugging information.&lt;/description&gt;
+&lt;/property&gt;
+
+&lt;property&gt;
+  &lt;name&gt;fs.ceph.clientDebug&lt;/name&gt;
+  &lt;value&gt;1&lt;/value&gt;
+  &lt;description&gt;If non-zero, the Ceph client will print debugging information (a higher number=more debugging).&lt;/description&gt;
+&lt;/property&gt;
+
+&lt;property&gt;
+  &lt;name&gt;fs.ceph.messengerDebug&lt;/name&gt;
+  &lt;value&gt;1&lt;/value&gt;
+  &lt;description&gt;If non-zero, the Ceph messenger will print debugging information (a higher number=more debugging)&lt;/description&gt;
+&lt;/property&gt;
+
+&lt;property&gt;
+  &lt;name&gt;fs.ceph.readahead&lt;/name&gt;
+  &lt;value&gt;1&lt;/value&gt;
+  &lt;description&gt;Sets the number of object periods to read ahead in prefetching. This should probably be left at the default of 1.&lt;/description&gt;
+&lt;/property&gt;
+
+&lt;property&gt;
+  &lt;name&gt;fs.ceph.commandLine&lt;/name&gt;
+  &lt;value&gt;a string&lt;/value&gt;
+  &lt;description&gt;If you prefer, you may enter any of Ceph's command-line configuration here and it will get passed to the C client. Note that any filled-in configuration options will override what you put here.&lt;/description&gt;
+&lt;/property&gt;
 </pre>
   
   <li>Start up your Ceph instance according to the Ceph documentation.</li>