use of org.apache.flink.types.KeyFieldOutOfBoundsException in project flink by apache.
the class RecordComparator method hash.
// --------------------------------------------------------------------------------------------
@Override
public int hash(Record object) {
int i = 0;
try {
int code = 0;
for (; i < this.keyFields.length; i++) {
code ^= object.getField(this.keyFields[i], this.transientKeyHolders[i]).hashCode();
// salt code with (i % HASH_SALT.length)-th salt component
code *= HASH_SALT[i & 0x1F];
}
return code;
} catch (NullPointerException npex) {
throw new NullKeyFieldException(this.keyFields[i]);
} catch (IndexOutOfBoundsException iobex) {
throw new KeyFieldOutOfBoundsException(this.keyFields[i]);
}
}
Aggregations