/** * Creates a HashedEntityId from the specified HBase row key. * * @param hbaseRowKey HBase row key. * @param format Row key hashing specification. * @return a new HashedEntityId with the specified HBase row key. */ static HashedEntityId fromHBaseRowKey(byte[] hbaseRowKey, RowKeyFormat format) { // TODO Validate that hbaseRowKey has the characteristics of the hashing method // specified in format // fijiRowKey is null: there is no (known) way to reverse the hash return new HashedEntityId(null, hbaseRowKey, format); }
/** * Creates a HashedEntityId from the specified Fiji row key. * * @param fijiRowKey Fiji row key. * @param format Row key hashing specification. * @return a new HashedEntityId with the specified Fiji row key. */ static HashedEntityId getEntityId(byte[] fijiRowKey, RowKeyFormat format) { Preconditions.checkNotNull(format); final byte[] hbaseRowKey = hashFijiRowKey(format, fijiRowKey); return new HashedEntityId(fijiRowKey, hbaseRowKey, format); }