use of org.apache.flink.types.NullKeyFieldException 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
code *= HASH_SALT[i & 0x1F];
// component
}
return code;
} catch (NullPointerException npex) {
throw new NullKeyFieldException(this.keyFields[i]);
} catch (IndexOutOfBoundsException iobex) {
throw new KeyFieldOutOfBoundsException(this.keyFields[i]);
}
}
Aggregations