Search in sources :

Example 1 with SetCell

use of com.google.bigtable.v2.Mutation.SetCell in project beam by apache.

the class BigtableClientWrapper method writeRow.

void writeRow(String key, String table, String familyColumn, String columnQualifier, byte[] value, long timestampMicros) {
    Mutation.SetCell setCell = Mutation.SetCell.newBuilder().setFamilyName(familyColumn).setColumnQualifier(byteStringUtf8(columnQualifier)).setValue(byteString(value)).setTimestampMicros(timestampMicros).build();
    Mutation mutation = Mutation.newBuilder().setSetCell(setCell).build();
    MutateRowRequest mutateRowRequest = MutateRowRequest.newBuilder().setRowKey(byteStringUtf8(key)).setTableName(bigtableOptions.getInstanceName().toTableNameStr(table)).addMutations(mutation).build();
    dataClient.mutateRow(mutateRowRequest);
}
Also used : MutateRowRequest(com.google.bigtable.v2.MutateRowRequest) Mutation(com.google.bigtable.v2.Mutation)

Aggregations

MutateRowRequest (com.google.bigtable.v2.MutateRowRequest)1 Mutation (com.google.bigtable.v2.Mutation)1