setRowKey(other.getRowKey());
@Test public void requestIsCorrect() { callable.futureCall( ConditionalRowMutation.create("my-table", "row-key").then(Mutation.create().deleteRow())); assertThat(inner.request) .isEqualTo( CheckAndMutateRowRequest.newBuilder() .setTableName( NameUtil.formatTableName( requestContext.getProjectId(), requestContext.getInstanceId(), "my-table")) .setRowKey(ByteString.copyFromUtf8("row-key")) .setAppProfileId(requestContext.getAppProfileId()) .addTrueMutations( com.google.bigtable.v2.Mutation.newBuilder() .setDeleteFromRow(DeleteFromRow.getDefaultInstance())) .build()); }
@Test public void toProtoTest() { Mutation ignoredThenMutation = Mutation.create().deleteRow(); ConditionalRowMutation mutation = ConditionalRowMutation.create(TABLE_ID, TEST_KEY).then(ignoredThenMutation); CheckAndMutateRowRequest actualProto = mutation.toProto(REQUEST_CONTEXT).toBuilder().clearTrueMutations().build(); assertThat(actualProto) .isEqualTo( CheckAndMutateRowRequest.newBuilder() .setTableName(NameUtil.formatTableName(PROJECT_ID, INSTANCE_ID, TABLE_ID)) .setAppProfileId(APP_PROFILE_ID) .setRowKey(TEST_KEY) .build()); }
setRowKey(other.getRowKey());
setRowKey(other.getRowKey());
CheckAndMutateRowRequest.newBuilder() .setTableName(tableName) .setRowKey(rowKey) .setPredicateFilter(predicateFilter) .addAllTrueMutations(trueMutations)
CheckAndMutateRowRequest.newBuilder() .setTableName(tableName == null ? null : tableName.toString()) .setRowKey(rowKey) .setPredicateFilter(predicateFilter) .addAllTrueMutations(trueMutations)
private ConditionalRowMutation(String tableId, ByteString rowKey) { this.tableId = tableId; builder.setRowKey(rowKey); }
CheckAndMutateRowRequest.newBuilder() .setTableName(tableName) .setRowKey(rowKey) .setPredicateFilter(predicateFilter) .addAllTrueMutations(trueMutations)
CheckAndMutateRowRequest.newBuilder() .setTableName(tableName == null ? null : tableName.toString()) .setRowKey(rowKey) .setPredicateFilter(predicateFilter) .addAllTrueMutations(trueMutations)
private ConditionalRowMutation(String tableId, ByteString rowKey) { this.tableId = tableId; builder.setRowKey(rowKey); }