Browse Source

HADOOP-2553 Don't make Long objects calculating hbase type hash codes

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@610698 13f79535-47bb-0310-9956-ffa450edef68
Michael Stack 17 years ago
parent
commit
7bd1d17206

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

@@ -162,6 +162,7 @@ Trunk (unreleased changes)
                (Edward Yoon via Stack)
    HADOOP-2450 Show version (and svn revision) in hbase web ui
    HADOOP-2472 Range selection using filter (Edward Yoon via Stack)
+   HADOOP-2553 Don't make Long objects calculating hbase type hash codes
                
 
 

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

@@ -332,13 +332,13 @@ public class HLog implements HConstants {
             // equal to the oldest pending region operation
             TreeSet<Long> sequenceNumbers =
               new TreeSet<Long>(this.outputfiles.headMap(
-                (oldestOutstandingSeqNum + Long.valueOf(1L))).keySet());
+                (Long.valueOf(oldestOutstandingSeqNum.longValue() + 1L))).keySet());
             // Now remove old log files (if any)
             if (LOG.isDebugEnabled()) {
               // Find region associated with oldest key -- helps debugging.
               Text oldestRegion = null;
               for (Map.Entry<Text, Long> e: this.lastSeqWritten.entrySet()) {
-                if (e.getValue().longValue() == oldestOutstandingSeqNum) {
+                if (e.getValue().longValue() == oldestOutstandingSeqNum.longValue()) {
                   oldestRegion = e.getKey();
                   break;
                 }

+ 1 - 1
src/contrib/hbase/src/java/org/apache/hadoop/hbase/HLogKey.java

@@ -102,7 +102,7 @@ public class HLogKey implements WritableComparable {
   public int hashCode() {
     int result = this.regionName.hashCode();
     result ^= this.row.hashCode(); 
-    result ^= Long.valueOf(this.logSeqNum).hashCode();
+    result ^= this.logSeqNum;
     return result;
   }
 

+ 1 - 1
src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java

@@ -82,7 +82,7 @@ public class HRegionInfo implements WritableComparable {
   
   private void setHashCode() {
     int result = this.regionName.hashCode();
-    result ^= Long.valueOf(this.regionId).hashCode();
+    result ^= this.regionId;
     result ^= this.startKey.hashCode();
     result ^= this.endKey.hashCode();
     result ^= Boolean.valueOf(this.offLine).hashCode();

+ 2 - 4
src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStore.java

@@ -229,14 +229,12 @@ class HStore implements HConstants {
       // TODO: If get is of a particular version -- numVersions == 1 -- we
       // should be able to avoid all of the tailmap creations and iterations
       // below.
-      HStoreKey curKey = new HStoreKey(key);
-      SortedMap<HStoreKey, byte []> tailMap = map.tailMap(curKey);
+      SortedMap<HStoreKey, byte []> tailMap = map.tailMap(key);
       for (Map.Entry<HStoreKey, byte []> es: tailMap.entrySet()) {
         HStoreKey itKey = es.getKey();
-        if (itKey.matchesRowCol(curKey)) {
+        if (itKey.matchesRowCol(key)) {
           if (!HLogEdit.isDeleted(es.getValue())) {
             result.add(tailMap.get(itKey));
-            curKey.setVersion(itKey.getTimestamp() - 1);
           }
         }
         if (numVersions > 0 && result.size() >= numVersions) {

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

@@ -995,7 +995,7 @@ public class HStoreFile implements HConstants, WritableComparable {
     int result = this.dir.hashCode();
     result ^= this.encodedRegionName.hashCode();
     result ^= this.colFamily.hashCode();
-    result ^= Long.valueOf(this.fileId).hashCode();
+    result ^= this.fileId;
     return result;
   }
 

+ 1 - 1
src/contrib/hbase/src/java/org/apache/hadoop/hbase/HStoreKey.java

@@ -219,7 +219,7 @@ public class HStoreKey implements WritableComparable {
   public int hashCode() {
     int result = this.row.hashCode();
     result ^= this.column.hashCode();
-    result ^= Long.valueOf(this.timestamp).hashCode();
+    result ^= this.timestamp;
     return result;
   }
 

+ 1 - 1
src/contrib/hbase/src/java/org/apache/hadoop/hbase/Leases.java

@@ -354,7 +354,7 @@ public class Leases {
     @Override
     public int hashCode() {
       int result = this.getLeaseName().hashCode();
-      result ^= Long.valueOf(this.lastUpdate).hashCode();
+      result ^= this.lastUpdate;
       return result;
     }