components[i] = null; } else if (null != rowKeyFormat2 && ComponentType.LONG == rowKeyFormat2.getComponents().get(i).getType()) { components[i] = ((Number) component).longValue(); } else {
/** * Get the names and types of Entity ID columns in the Cassandra table. * * @param layout The table layout. * @return The names and types of Entity ID columns. */ private static LinkedHashMap<String, String> getEntityIdColumnTypes( final FijiTableLayout layout ) { LinkedHashMap<String, String> columns = Maps.newLinkedHashMap(); RowKeyFormat2 keyFormat = (RowKeyFormat2) layout.getDesc().getKeysFormat(); switch (keyFormat.getEncoding()) { case RAW: { columns.put(RAW_KEY_COL, BYTES_TYPE); break; } case FORMATTED: { for (RowKeyComponent component : keyFormat.getComponents()) { columns.put( translateEntityIDComponentNameToColumnName(component.getName()), getCQLType(component.getType())); } break; } default: throw new IllegalArgumentException( String.format("Unknown row key encoding %s.", keyFormat.getEncoding())); } return columns; }
/** * Transforms a list of RowKeyComponents into a list of the column names. * * @param components to transform into columns. * @return a list of columns. */ private static List<String> transformToColumns(List<RowKeyComponent> components) { List<String> list = Lists.newArrayList(); for (RowKeyComponent component : components) { list.add(translateEntityIDComponentNameToColumnName(component.getName())); } return list; }
final ImmutableList.Builder<String> entityIDColumns = ImmutableList.builder(); for (final RowKeyComponent component : mRowKeyFormat.getComponents()) { entityIDColumns.add(ENTITY_ID_PREFIX + component.getName());
for (pos = 0; pos < hbaseKey.size(); pos++) { baos.write(hbaseKey.get(pos), 0, hbaseKey.get(pos).length); if (format.getComponents().get(pos).getType() == ComponentType.STRING || format.getComponents().get(pos) == null) {
components[i] = null; } else if (null != format && ComponentType.LONG == format.getComponents().get(i).getType()) { components[i] = ((Number) component).longValue(); } else {
for (int i = 0; i < mComponents.length; i++) { final Object component = mComponents[i]; switch (mRowKeyFormat.getComponents().get(i).getType()) { case INTEGER: if (null == component) { default: throw new IllegalStateException("Unknown component type: " + mRowKeyFormat.getComponents().get(i).getType());
switch (format.getComponents().get(fijiRowElem).getType()) { case STRING: