/** {@inheritDoc} */ @Override public EntityId getEntityIdFromHBaseRowKey(byte[] hbaseRowKey) { return HashedEntityId.fromHBaseRowKey(hbaseRowKey, mRowKeyFormat); } }
/** * Creates a hashed entity ID from a single component, either String or byte[]. * * @param rowKey Hashed entity ID specification as a String or byte[]. * @return the specified hashed entity ID. */ private EntityId getEntityId(Object rowKey) { return HashedEntityId.getEntityId(getBytesKeyComponent(rowKey), mRowKeyFormat); }
/** * 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); }
/** * 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); }