public void testHash() throws Exception { assertEquals( new ImmutableBytesWritable(Bytes.toBytes("xxabc"), 2, 3).hashCode(), new ImmutableBytesWritable(Bytes.toBytes("abc")).hashCode()); assertEquals( new ImmutableBytesWritable(Bytes.toBytes("xxabcd"), 2, 3).hashCode(), new ImmutableBytesWritable(Bytes.toBytes("abc")).hashCode()); assertNotSame( new ImmutableBytesWritable(Bytes.toBytes("xxabc"), 2, 3).hashCode(), new ImmutableBytesWritable(Bytes.toBytes("xxabc"), 2, 2).hashCode()); }
public ImmutableBytesPtr(byte[] bytes) { super(bytes); hashCode = super.hashCode(); }
public ImmutableBytesPtr(byte[] bytes) { super(bytes); hashCode = super.hashCode(); }
public ImmutableBytesPtr(byte[] bytes, int offset, int length) { super(bytes, offset, length); hashCode = super.hashCode(); }
public ImmutableBytesPtr(byte[] bytes, int offset, int length) { super(bytes, offset, length); hashCode = super.hashCode(); }
@Override public int hashCode() { int result = this.tableName.hashCode(); result = 31 * result + this.rowkey.hashCode(); return result; }
private int getPartition(ImmutableBytesWritable key) { // Simple implementation hash mod numFiles return Math.abs(key.hashCode()) % numSpillFiles; }
private int getPartition(ImmutableBytesWritable key) { // Simple implementation hash mod numFiles return Math.abs(key.hashCode()) % numSpillFiles; }
@Override public int hashCode() { // TODO do we need to keep the same hashcode logic as KeyValue? Everywhere else we don't keep // them by reference, but presumably clients might hash them. final int prime = 31; int result = super.hashCode(); result = prime * result + family.hashCode(); result = prime * result + qualifier.hashCode(); result = prime * result + row.hashCode(); result = prime * result + (int) (ts ^ (ts >>> 32)); result = prime * result + type.hashCode(); result = prime * result + value.hashCode(); return result; }
/** * @param b Use passed bytes as backing array for this instance. */ @Override public void set(final byte [] b) { super.set(b); hashCode = super.hashCode(); }
/** * @param b Use passed bytes as backing array for this instance. * @param offset * @param length */ @Override public void set(final byte [] b, final int offset, final int length) { super.set(b,offset,length); hashCode = super.hashCode(); }
@Override public void readFields(final DataInput in) throws IOException { super.readFields(in); hashCode = super.hashCode(); }
/** * @param b Use passed bytes as backing array for this instance. */ @Override public void set(final byte [] b) { super.set(b); hashCode = super.hashCode(); }
/** * @param b Use passed bytes as backing array for this instance. * @param offset * @param length */ @Override public void set(final byte [] b, final int offset, final int length) { super.set(b,offset,length); hashCode = super.hashCode(); }
@Override public void readFields(final DataInput in) throws IOException { super.readFields(in); hashCode = super.hashCode(); }
ResultEntry(Tuple result) { final int prime = 31; this.result = result; int hashCode = 0; for (ColumnProjector column : rowProjector.getColumnProjectors()) { Expression e = column.getExpression(); if (e.evaluate(this.result, ptr1)) { hashCode = prime * hashCode + ptr1.hashCode(); } } this.hashCode = hashCode; }
ResultEntry(Tuple result) { final int prime = 31; this.result = result; int hashCode = 0; for (ColumnProjector column : rowProjector.getColumnProjectors()) { Expression e = column.getExpression(); if (e.evaluate(this.result, ptr1)) { hashCode = prime * hashCode + ptr1.hashCode(); } } this.hashCode = hashCode; }
public ImmutableBytesPtr(ImmutableBytesWritable ibw) { super(ibw.get(), ibw.getOffset(), ibw.getLength()); hashCode = super.hashCode(); }
public ImmutableBytesPtr(ImmutableBytesWritable ibw) { super(ibw.get(), ibw.getOffset(), ibw.getLength()); hashCode = super.hashCode(); }