Java Code Examples for org.apache.hadoop.hbase.util.Bytes.hashCode()

The following are Jave code examples for showing how to use hashCode() of the org.apache.hadoop.hbase.util.Bytes class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: ditb   File: TablePermission.java   View Source Code Vote up 6 votes
@Override
public int hashCode() {
  final int prime = 37;
  int result = super.hashCode();
  if (table != null) {
    result = prime * result + table.hashCode();
  }
  if (family != null) {
    result = prime * result + Bytes.hashCode(family);
  }
  if (qualifier != null) {
    result = prime * result + Bytes.hashCode(qualifier);
  }
  if (namespace != null) {
    result = prime * result + namespace.hashCode();
  }
  return result;
}
 
Example 2
Project: ditb   File: WALKey.java   View Source Code Vote up 5 votes
@Override
public int hashCode() {
  int result = Bytes.hashCode(this.encodedRegionName);
  result ^= this.logSeqNum;
  result ^= this.writeTime;
  return result;
}
 
Example 3
Project: ditb   File: UserPermission.java   View Source Code Vote up 5 votes
@Override
public int hashCode() {
  final int prime = 37;
  int result = super.hashCode();
  if (user != null) {
    result = prime * result + Bytes.hashCode(user);
  }
  return result;
}
 
Example 4
Project: ditb   File: HColumnDescriptor.java   View Source Code Vote up 5 votes
/**
 * @see java.lang.Object#hashCode()
 */
@Override
public int hashCode() {
  int result = Bytes.hashCode(this.name);
  result ^= Byte.valueOf(COLUMN_DESCRIPTOR_VERSION).hashCode();
  result ^= values.hashCode();
  result ^= configuration.hashCode();
  return result;
}
 
Example 5
Project: ditb   File: CellComparator.java   View Source Code Vote up 5 votes
private static int calculateHashForKeyValue(Cell cell) {
  //pre-calculate the 3 hashes made of byte ranges
  int rowHash = Bytes.hashCode(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength());
  int familyHash =
    Bytes.hashCode(cell.getFamilyArray(), cell.getFamilyOffset(), cell.getFamilyLength());
  int qualifierHash = Bytes.hashCode(cell.getQualifierArray(), cell.getQualifierOffset(),
    cell.getQualifierLength());

  //combine the 6 sub-hashes
  int hash = 31 * rowHash + familyHash;
  hash = 31 * hash + qualifierHash;
  hash = 31 * hash + (int)cell.getTimestamp();
  hash = 31 * hash + cell.getTypeByte();
  return hash;
}
 
Example 6
Project: ditb   File: BulkDeleteEndpoint.java   View Source Code Vote up 5 votes
@Override
public int hashCode() {
  int h = 31;
  h = h + 13 * Bytes.hashCode(this.family);
  h = h + 13 * Bytes.hashCode(this.qualifier);
  return h;
}
 
Example 7
Project: stroom-stats   File: ColumnQualifier.java   View Source Code Vote up 4 votes
private int buildHashCode() {
    return Bytes.hashCode(bytes, offset, ARRAY_LENGTH);
}
 
Example 8
Project: stroom-stats   File: UID.java   View Source Code Vote up 4 votes
private int buildHashCode() {
    return Bytes.hashCode(bytes, offset, UID_ARRAY_LENGTH);
}
 
Example 9
Project: ditb   File: HRegion.java   View Source Code Vote up 4 votes
@Override public int hashCode() {
  return Bytes.hashCode(getRegionInfo().getRegionName());
}
 
Example 10
Project: ditb   File: IndexDescriptor.java   View Source Code Vote up 4 votes
@Override
public int hashCode() {
  return Bytes.hashCode(qualifier);
}
 
Example 11
Project: ditb   File: Get.java   View Source Code Vote up 4 votes
@Override
public int hashCode() {
  // TODO: This is wrong.  Can't have two gets the same just because on same row.  But it
  // matches how equals works currently and gets rid of the findbugs warning.
  return Bytes.hashCode(this.getRow());
}
 
Example 12
Project: ditb   File: Increment.java   View Source Code Vote up 4 votes
@Override
public int hashCode() {
  // TODO: This is wrong.  Can't have two gets the same just because on same row.  But it
  // matches how equals works currently and gets rid of the findbugs warning.
  return Bytes.hashCode(this.getRow());
}
 
Example 13
Project: ditb   File: ZKUtil.java   View Source Code Vote up 4 votes
@Override
public int hashCode() {
  int ret = 17 + getPath().hashCode() * 31;
  return ret * 31 + Bytes.hashCode(data);
}
 
Example 14
Project: ditb   File: ZKUtil.java   View Source Code Vote up 4 votes
@Override
public int hashCode() {
  int ret = getPath().hashCode();
  return ret * 31 + Bytes.hashCode(data);
}
 
Example 15
Project: ditb   File: LRUDictionary.java   View Source Code Vote up 4 votes
@Override
public int hashCode() {
  return Bytes.hashCode(container, offset, length);
}