Browse Source

HADOOP-2458 HStoreFile.writeSplitInfo should just call HStoreFile.Reference.write

HADOOP-2458 HStoreFile.writeSplitInfo should just call HStoreFile.Reference.write 


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@605466 13f79535-47bb-0310-9956-ffa450edef68
Jim Kellerman 17 years ago
parent
commit
2f0e47ff44

+ 4 - 1
src/contrib/hbase/CHANGES.txt

@@ -86,7 +86,8 @@ Trunk (unreleased changes)
    HADOOP-2441 Fix build failures in TestHBaseCluster
    HADOOP-2451 End key is incorrectly assigned in many region splits
    HADOOP-2455 Error in Help-string of CREATE command (Edward Yoon via Stack)
-         
+   HADOOP-2465 When split parent regions are cleaned up, not all the columns are
+               deleted
    
   IMPROVEMENTS
    HADOOP-2401 Add convenience put method that takes writable
@@ -131,6 +132,8 @@ Trunk (unreleased changes)
    HADOOP-2351 If select command returns no result, it doesn't need to show the
                header information (Edward Yoon via Stack)
    HADOOP-2285 Add being able to shutdown regionservers (Dennis Kubes via Stack)
+   HADOOP-2458 HStoreFile.writeSplitInfo should just call 
+               HStoreFile.Reference.write
                
 
 

+ 2 - 0
src/contrib/hbase/src/java/org/apache/hadoop/hbase/HMaster.java

@@ -343,6 +343,8 @@ public class HMaster extends Thread implements HConstants, HMasterInterface,
         b.delete(lockid, COL_REGIONINFO);
         b.delete(lockid, COL_SERVER);
         b.delete(lockid, COL_STARTCODE);
+        b.delete(lockid, COL_SPLITA);
+        b.delete(lockid, COL_SPLITB);
         srvr.batchUpdate(metaRegionName, System.currentTimeMillis(), b);
         result = true;
       } else if (LOG.isDebugEnabled()) {

+ 4 - 12
src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStoreFile.java

@@ -493,10 +493,7 @@ public class HStoreFile implements HConstants, WritableComparable {
     }
     FSDataOutputStream out = fs.create(p);
     try {
-      out.writeUTF(getReference().getEncodedRegionName());
-      getReference().getMidkey().write(out);
-      out.writeLong(getReference().getFileId());
-      out.writeBoolean(isTopFileRegion(getReference().getFileRegion()));
+      reference.write(out);
     } finally {
       out.close();
    }
@@ -507,19 +504,14 @@ public class HStoreFile implements HConstants, WritableComparable {
    */
   static Reference readSplitInfo(final Path p, final FileSystem fs)
   throws IOException {
-    Reference r = null;
     FSDataInputStream in = fs.open(p);
     try {
-      String rn = in.readUTF();
-      HStoreKey midkey = new HStoreKey();
-      midkey.readFields(in);
-      long fid = in.readLong();
-      boolean tmp = in.readBoolean();
-      r =  new Reference(rn, fid, midkey, tmp? Range.top: Range.bottom);
+      Reference r = new Reference();
+      r.readFields(in);
+      return r;
     } finally {
       in.close();
     }
-    return r; 
   }
 
   private void createOrFail(final FileSystem fs, final Path p)