/** * @param b bytes to hash * @return A hash of <code>b</code> as an Integer that can be used as key in * Maps. */ public static Integer mapKey(final byte [] b) { return hashCode(b); }
/** * @param b bytes to hash * @param length length to hash * @return A hash of <code>b</code> as an Integer that can be used as key in * Maps. */ public static Integer mapKey(final byte [] b, final int length) { return hashCode(b, length); }
/** * @param b bytes to hash * @return Runs {@link WritableComparator#hashBytes(byte[], int)} on the * passed in array. This method is what {@link org.apache.hadoop.io.Text} * use calculating hash code. */ public static int hashCode(final byte [] b) { return hashCode(b, b.length); }
@Override public int hashCode() { return Bytes.hashCode(this.stopRowKey); } }
@Override public int hashCode() { int result = Bytes.hashCode(name); result ^= (int) COLUMN_DESCRIPTOR_VERSION; result ^= values.hashCode(); result ^= configuration.hashCode(); return result; }
@Override public int hashCode() { return columnOffset == null ? Objects.hash(this.limit, this.offset) : Objects.hash(this.limit, Bytes.hashCode(this.columnOffset)); } }
/** * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * No replacement. */ @Deprecated @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()); }
@Override public int hashCode() { int result = Bytes.hashCode(this.encodedRegionName); result = (int) (result ^ getSequenceId()); result = (int) (result ^ this.writeTime); return result; }
@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()); }
@Override public int hashCode() { return Bytes.hashCode(this.getPrefix()); } }
@Override public int hashCode() { return Bytes.hashCode(this.getPrefix()); } }
@Override public int hashCode() { int ret = 17 + getPath().hashCode() * 31; return ret * 31 + Bytes.hashCode(data); } }
@Override public int hashCode() { int ret = getPath().hashCode(); ret = ret * 31 + Bytes.hashCode(data); return ret * 31 + Integer.hashCode(version); } }
public void testNullHashCode() { byte [] b = null; Exception ee = null; try { Bytes.hashCode(b); } catch (Exception e) { ee = e; } assertNotNull(ee); }