]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Hadoop: Final submission prep.
authorGreg Farnum <gregf@hq.newdream.net>
Fri, 11 Sep 2009 00:36:05 +0000 (17:36 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Fri, 11 Sep 2009 21:20:52 +0000 (14:20 -0700)
IO classes should be public, updated Javadoc, and added license grants.

src/client/hadoop/ceph/CephFileSystem.java
src/client/hadoop/ceph/CephInputStream.java
src/client/hadoop/ceph/CephOutputStream.java

index 2f1b1b5c66d9bc68e378226cf4c0811f51db19a0..ae6c43f794a791748f70dce2566efc54b4c21e45 100644 (file)
@@ -1,4 +1,22 @@
 // -*- mode:Java; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+/**
+ *
+ * Licensed under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * 
+ * Implements the Hadoop FS interfaces to allow applications to store
+ * files in Ceph.
+ */
 package org.apache.hadoop.fs.ceph;
 
 import java.io.IOException;
index 0f887b12abc855f7344972e11564643a1c496c96..24d0888777717e58df105bab87851293adf693c3 100644 (file)
@@ -1,4 +1,22 @@
 // -*- mode:Java; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+/**
+ *
+ * Licensed under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * 
+ * Implements the Hadoop FS interfaces to allow applications to store
+ * files in Ceph.
+ */
 package org.apache.hadoop.fs.ceph;
 
 import java.io.BufferedOutputStream;
@@ -20,7 +38,7 @@ import org.apache.hadoop.fs.FSInputStream;
  * An {@link FSInputStream} for a CephFileSystem and corresponding
  * Ceph instance.
  */
-class CephInputStream extends FSInputStream {
+public class CephInputStream extends FSInputStream {
 
   private int bufferSize;
 
@@ -57,8 +75,9 @@ class CephInputStream extends FSInputStream {
          + fh + " and file length " + flength);
       
   }
-  //Ceph likes things to be closed before it shuts down,
-  //so closing the IOStream stuff voluntarily is good
+  /** Ceph likes things to be closed before it shuts down,
+   * so closing the IOStream stuff voluntarily in a finalizer is good
+   */
   public void finalize () throws Throwable {
     try {
       if (!closed) close();
@@ -69,7 +88,9 @@ class CephInputStream extends FSInputStream {
   public synchronized long getPos() throws IOException {
     return ceph_getpos(fileHandle);
   }
-
+  /**
+   * Find the number of bytes remaining in the file.
+   */
   @Override
   public synchronized int available() throws IOException {
       return (int) (fileLength - getPos());
@@ -114,7 +135,7 @@ class CephInputStream extends FSInputStream {
 
   /**
    * Read a specified number of bytes into a byte[] from the file.
-   * @param buf[] the byte array to read into.
+   * @param buf the byte array to read into.
    * @param off the offset to start at in the file
    * @param len the number of bytes to read
    * @return 0 if successful, otherwise an error code.
index 49707f305c0f5794e1e4ec175d53a39fd615069d..fdcc4e000ad4627af9268ea3253201a691e72588 100644 (file)
@@ -1,4 +1,23 @@
 // -*- mode:Java; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
+/**
+ *
+ * Licensed under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * 
+ * Implements the Hadoop FS interfaces to allow applications to store
+ * files in Ceph.
+ */
+
 package org.apache.hadoop.fs.ceph;
 
 import java.io.File;
@@ -15,7 +34,12 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.util.Progressable;
 
-class CephOutputStream extends OutputStream {
+/**
+ * <p>
+ * An {@link OutputStream} for a CephFileSystem and corresponding
+ * Ceph instance.
+ */
+public class CephOutputStream extends OutputStream {
 
   private int bufferSize;
 
@@ -45,8 +69,9 @@ class CephOutputStream extends OutputStream {
     debug = ("true".equals(conf.get("fs.ceph.debug", "false")));
   }
 
-  //Ceph likes things to be closed before it shuts down,
-  //so closing the IOStream stuff voluntarily is good
+  /**Ceph likes things to be closed before it shuts down,
+   *so closing the IOStream stuff voluntarily is good
+   */
   public void finalize () throws Throwable {
     try {
       if (!closed) close();
@@ -88,7 +113,7 @@ class CephOutputStream extends OutputStream {
 
   /**
    * Write a byte buffer into the Ceph file.
-   * @param buf[] the byte array to write from
+   * @param buf the byte array to write from
    * @param off the position in the file to start writing at.
    * @param len The number of bytes to actually write.
    * @throws IOException if you have closed the CephOutputStream, or