*/
private static LinkedHashMap<String, Object> getEntityIdColumnValues(
final KijiTableLayout layout,
final EntityId entityId
) {
RowKeyFormat2 keyFormat = (RowKeyFormat2) layout.getDesc().getKeysFormat();
final LinkedHashMap<String, Object> columnValues = Maps.newLinkedHashMap();
switch (keyFormat.getEncoding()) {
case RAW: {
columnValues.put(RAW_KEY_COL, ByteBuffer.wrap(entityId.getHBaseRowKey()));
break;
}
case FORMATTED: {
final List<RowKeyComponent> components = keyFormat.getComponents();
final List<Object> values = entityId.getComponents();
Preconditions.checkArgument(components.size() == values.size(),
"Number of entity ID components (%s) must match the number of entity ID values (%s).",
components, values);
for (int i = 0; i < components.size(); i++) {
columnValues.put(
translateEntityIDComponentNameToColumnName(components.get(i).getName()),
values.get(i));
}
break;
}
default: throw new IllegalArgumentException(
String.format("Unknown row key encoding %s.", keyFormat.getEncoding()));
}
return columnValues;
}