hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From li...@apache.org
Subject svn commit: r1530745 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java
Date Wed, 09 Oct 2013 18:18:17 GMT
Author: liyin
Date: Wed Oct  9 18:18:17 2013
New Revision: 1530745

URL: http://svn.apache.org/r1530745
Log:
[HBASE-9102] Fixes TestEncoderSeekers test series

Author: rshroff

Summary:
The hashcode() of the BlockCacheKey was not using the ordinal,
which prevents it from differenting the type of encoding, and
in hbase we have the option of having different encoding scheme in
BlockCache and in the HFile.

The fix adds back the ordinal check.

Test Plan: run the MR unit test

Reviewers: manukranthk, liyintang, adela

Reviewed By: adela

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D1001245

Task ID: 2973454

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java?rev=1530745&r1=1530744&r2=1530745&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/BlockCacheKey.java
Wed Oct  9 18:18:17 2013
@@ -52,11 +52,8 @@ public class BlockCacheKey implements He
 
   @Override
   public int hashCode() {
-    return hfileName.hashCode() * 127 + (int) (offset ^ (offset >>> 32));
-//     + encoding.ordinal() * 17;
-    // There's no reason for encoding to be in the cache key as the encoding already exists
in the
-    // block itself.
-    // Also encoding doesn't contribute in the equal(Object o) method.
+    return hfileName.hashCode() * 127 + (int) (offset ^ (offset >>> 32)
+     + encoding.ordinal() * 17);
   }
 
   @Override



Mime
View raw message