Search in sources :

Example 1 with InternalApi

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();
}
Also used : Column(com.google.bigtable.v2.Column) Family(com.google.bigtable.v2.Family) Cell(com.google.bigtable.v2.Cell) InternalApi(com.google.api.core.InternalApi)

Example 2 with InternalApi

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();
}
Also used : ByteString(com.google.protobuf.ByteString) InternalApi(com.google.api.core.InternalApi)

Aggregations

InternalApi (com.google.api.core.InternalApi)2 Cell (com.google.bigtable.v2.Cell)1 Column (com.google.bigtable.v2.Column)1 Family (com.google.bigtable.v2.Family)1 ByteString (com.google.protobuf.ByteString)1