use of com.google.api.core.InternalApi in project java-bigtable by googleapis.
the class DefaultRowAdapter method createRowFromProto.
/**
* Helper to convert a proto Row to a model Row.
*
* <p>For internal use only.
*/
@InternalApi
public Row createRowFromProto(com.google.bigtable.v2.Row row) {
RowBuilder<Row> builder = createRowBuilder();
builder.startRow(row.getKey());
for (Family family : row.getFamiliesList()) {
for (Column column : family.getColumnsList()) {
for (Cell cell : column.getCellsList()) {
builder.startCell(family.getName(), column.getQualifier(), cell.getTimestampMicros(), cell.getLabelsList(), cell.getValue().size());
builder.cellValue(cell.getValue());
builder.finishCell();
}
}
}
return builder.finishRow();
}
use of com.google.api.core.InternalApi in project java-bigtable by googleapis.
the class ConditionalRowMutation method toProto.
/**
* Creates the underlying {@link CheckAndMutateRowRequest} protobuf.
*
* <p>This method is considered an internal implementation detail and not meant to be used by
* applications.
*/
@InternalApi
public CheckAndMutateRowRequest toProto(RequestContext requestContext) {
Preconditions.checkState(!builder.getTrueMutationsList().isEmpty() || !builder.getFalseMutationsList().isEmpty(), "ConditionalRowMutations must have `then` or `otherwise` mutations.");
String tableName = NameUtil.formatTableName(requestContext.getProjectId(), requestContext.getInstanceId(), tableId);
return builder.setTableName(tableName.toString()).setAppProfileId(requestContext.getAppProfileId()).build();
}
Aggregations