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

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@610698 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-01-10 06:57:00 +00:00
parent 765ee86279
commit df0f5658a5
8 changed files with 10 additions and 11 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}