]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Hadoop: Numerous fixes.
authorGreg Farnum <gregf@hq.newdream.net>
Wed, 4 Nov 2009 22:14:41 +0000 (14:14 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 5 Nov 2009 21:06:39 +0000 (13:06 -0800)
Set bufUsed=0 on a flush to avoid bad rewrites of data
Downgrade a warning in IOStream since Hadoop apparently checks for EOF by reading until a read returns -1.
Remove some leftover if checks that don't do anything.
TODO: Remove something Sage did already.

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

index e9fc740b26c205ab3c17dd50fa767113df3dc67e..4f4465bee76f13f11dde5285d1c17fa3abcfcb07 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -69,7 +69,6 @@ greg
 - osd: use client session to control osdmaps to clients (auth branch)
 - osd: error handling
 - uclient: readdir from cache
-- replicate rstat error?
 - mds: basic auth checks
 
 later
index 73c8a4ac3c8ca73d95a70b3c4bc1b7924b99d3a6..74a1698096e46800e4d907a75ce3fe9c38a3a9cd 100644 (file)
@@ -174,7 +174,7 @@ public class CephInputStream extends FSInputStream {
                                ceph.debug("CephInputStream.read: cannot read " + len  + 
                                                                         " bytes from fd " + fileHandle + ": current position is "
                                                                         + getPos() + " and file length is " + fileLength,
-                                                                        ceph.WARN);
+                                                                        ceph.DEBUG);
                                
                                return -1;
                        }
index e8e5f8973bb916786aa61196238ecf52fc2505ac..c7dc3a4a0e8a7674c94c23933d7c5571a4637567 100644 (file)
@@ -114,14 +114,6 @@ public class CephOutputStream extends OutputStream {
                                                                                                                "bytes to fd " + fileHandle + ": stream closed");
                }
                
-               // sanity check
-               if (null == buf) {
-               }
-               
-               // check for proper index bounds
-               if((off < 0) || (len < 0) || (off + len > buf.length)) {
-               }
-               
                int result;
                int write;
                while (len>0) {
@@ -137,7 +129,7 @@ public class CephOutputStream extends OutputStream {
                        }
                        catch (ArrayStoreException ae) {
                                throw new IOException("Uh-oh, CephOutputStream failed to do an array"
-                                                                                                                       + "copy due to type mismatch...");
+                                                                                                                       + " copy due to type mismatch...");
                        }
                        catch (NullPointerException ne) {
                                throw new IOException("CephOutputStream.write: cannot write "
@@ -155,9 +147,11 @@ public class CephOutputStream extends OutputStream {
                                if (result != bufUsed)
                                        throw new IOException("CephOutputStream.write: Wrote only "
                                                                                                                                + result + " bytes of " + bufUsed
-                                                                                                                               + "in buffer!");
+                                                                                                                               + " in buffer! Data may be lost or written"
+                                                                                                                               + " twice to Ceph!");
                                bufUsed = 0;
                        }
+
                }
                return; 
        }
@@ -182,6 +176,7 @@ public class CephOutputStream extends OutputStream {
                                                                                                                                + "was incomplete:  only " + result + " of "
                                                                                                                                + bufUsed + " bytes were written.");
                                }
+                               bufUsed = 0;
                                return;
                        }
        }