/** {@inheritDoc} */ @Override @SuppressWarnings("unchecked") public <T> T getComponentByIndex(int idx) { Preconditions.checkState(!mRowKeyFormat.getSalt().getSuppressKeyMaterialization(), "Cannot retrieve components as materialization is suppressed"); Preconditions.checkArgument(idx >= 0 && idx < mComponentValues.size()); return (T) mComponentValues.get(idx); }
/** {@inheritDoc} */ @Override public List<Object> getComponents() { Preconditions.checkState(!mRowKeyFormat.getSalt().getSuppressKeyMaterialization(), "Cannot retrieve components as materialization is suppressed"); return Collections.unmodifiableList(mComponentValues); }
/** {@inheritDoc} */ @Override public String toString() { if (!mRowKeyFormat.getSalt().getSuppressKeyMaterialization()) { return Objects.toStringHelper(FormattedEntityId.class) .add("components", Joiner.on(",").join(mComponentValues)) .add("hbase", Bytes.toStringBinary(mHBaseRowKey)) .toString(); } else { return Objects.toStringHelper(FormattedEntityId.class) .addValue("components are suppressed") .add("hbase", Bytes.toStringBinary(mHBaseRowKey)) .toString(); } }
if (mRowKeyFormat.getSalt().getSuppressKeyMaterialization()) { return String.format("hbase=hex:%s", ByteArrayFormatter.toHex(mHBaseRowKey));
/** * Creates a new FormattedEntityId. * @param format Format of the row key as specified in the layout file. * @param hbaseRowKey Byte array containing the hbase row key. * @param fijiRowKey An ordered list of row key components. */ private FormattedEntityId(RowKeyFormat2 format, byte[] hbaseRowKey, List<Object> fijiRowKey) { mRowKeyFormat = Preconditions.checkNotNull(format); Preconditions.checkArgument(format.getEncoding() == RowKeyEncoding.FORMATTED); Preconditions.checkNotNull(format.getSalt(), "Formatted entityIds may not specify a null 'salt' field in RowKeyFormat2."); mHBaseRowKey = hbaseRowKey; if (format.getSalt().getSuppressKeyMaterialization()) { mComponentValues = null; } else { mComponentValues = fijiRowKey; } }
if (format.getSalt().getSuppressKeyMaterialization()) { return baos.toByteArray(); } else {
"FormattedEntityIdRowFilter only works with formatted entity IDs"); if (null != rowKeyFormat.getSalt()) { Preconditions.checkArgument(!rowKeyFormat.getSalt().getSuppressKeyMaterialization(), "FormattedEntityIdRowFilter only works with materialized keys");
if (format.getSalt().getSuppressKeyMaterialization()) { if (pos < hbaseRowKey.length) { throw new EntityIdException("Extra bytes in key after hash when materialization is"
case FORMATTED: final HashSpec hashSpec = ((RowKeyFormat2) keysFormat).getSalt(); if (!hashSpec.getSuppressKeyMaterialization()) { return new FijiRestEntityId(entityId.getComponents().toArray(), false); } else {
case FORMATTED: final HashSpec hashSpec = ((RowKeyFormat2) keysFormat).getSalt(); if (hashSpec.getSuppressKeyMaterialization()) { return new JsonEntityIdParser( String.format("hbase=%s", Bytes.toStringBinary(entityId.getHBaseRowKey())),
if (format.getSalt().getSuppressKeyMaterialization() && format.getRangeScanStartIndex() != format.getComponents().size()) { throw new InvalidLayoutException("Range scans are not supported if "