hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1388699 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
Date Fri, 21 Sep 2012 21:52:03 GMT
Author: stack
Date: Fri Sep 21 21:52:02 2012
New Revision: 1388699

URL: http://svn.apache.org/viewvc?rev=1388699&view=rev
Log:
HBASE-6858 Fix the incorrect BADVERSION checking in the recoverable zookeeper

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java?rev=1388699&r1=1388698&r2=1388699&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java
Fri Sep 21 21:52:02 2012
@@ -357,12 +357,9 @@ public class RecoverableZooKeeper {
             try{
               Stat stat = new Stat();
               byte[] revData = zk.getData(path, false, stat);
-              int idLength = Bytes.toInt(revData, ID_LENGTH_SIZE);
-              int dataLength = revData.length-ID_LENGTH_SIZE-idLength;
-              int dataOffset = ID_LENGTH_SIZE+idLength;
-              
-              if(Bytes.compareTo(revData, ID_LENGTH_SIZE, id.length, 
-                  revData, dataOffset, dataLength) == 0) {
+              int idLength = Bytes.toInt(revData, MAGIC_OFFSET);
+              if (Bytes.compareTo(revData, MAGIC_OFFSET + ID_OFFSET, idLength,
+                  id, 0, id.length) == 0) {
                 // the bad version is caused by previous successful setData
                 return stat;
               }



Mime
View raw message