use of com.google.spanner.v1.Mutation in project gapic-generator-java by googleapis.
the class SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString method syncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.
public static void syncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString() throws Exception {
// It may require modifications to work in your environment.
try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
String tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString();
ByteString rowKey = ByteString.EMPTY;
RowFilter predicateFilter = RowFilter.newBuilder().build();
List<Mutation> trueMutations = new ArrayList<>();
List<Mutation> falseMutations = new ArrayList<>();
String appProfileId = "appProfileId704923523";
CheckAndMutateRowResponse response = baseBigtableDataClient.checkAndMutateRow(tableName, rowKey, predicateFilter, trueMutations, falseMutations, appProfileId);
}
}
use of com.google.spanner.v1.Mutation in project gapic-generator-java by googleapis.
the class SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation method syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.
public static void syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation() throws Exception {
// It may require modifications to work in your environment.
try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.EMPTY;
RowFilter predicateFilter = RowFilter.newBuilder().build();
List<Mutation> trueMutations = new ArrayList<>();
List<Mutation> falseMutations = new ArrayList<>();
CheckAndMutateRowResponse response = baseBigtableDataClient.checkAndMutateRow(tableName, rowKey, predicateFilter, trueMutations, falseMutations);
}
}
use of com.google.spanner.v1.Mutation in project gapic-generator-java by googleapis.
the class SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString method syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.
public static void syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString() throws Exception {
// It may require modifications to work in your environment.
try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.EMPTY;
RowFilter predicateFilter = RowFilter.newBuilder().build();
List<Mutation> trueMutations = new ArrayList<>();
List<Mutation> falseMutations = new ArrayList<>();
String appProfileId = "appProfileId704923523";
CheckAndMutateRowResponse response = baseBigtableDataClient.checkAndMutateRow(tableName, rowKey, predicateFilter, trueMutations, falseMutations, appProfileId);
}
}
use of com.google.spanner.v1.Mutation in project gapic-generator-java by googleapis.
the class SyncMutateRowTablenameBytestringListmutation method syncMutateRowTablenameBytestringListmutation.
public static void syncMutateRowTablenameBytestringListmutation() throws Exception {
// It may require modifications to work in your environment.
try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]");
ByteString rowKey = ByteString.EMPTY;
List<Mutation> mutations = new ArrayList<>();
MutateRowResponse response = baseBigtableDataClient.mutateRow(tableName, rowKey, mutations);
}
}
use of com.google.spanner.v1.Mutation in project grpc-gcp-java by GoogleCloudPlatform.
the class DataStoreChecksumClient method commitTransaction.
private static void commitTransaction(DatastoreBlockingStub stub, String projectId) {
int transactionBytes = 2000;
String payload = new String(new char[transactionBytes]).replace('\0', 'x');
Key key = Key.newBuilder().addPath(PathElement.newBuilder().setKind("Data").setName("data1").build()).build();
Entity entity = Entity.newBuilder().setKey(key).putProperties("2kb", Value.newBuilder().setExcludeFromIndexes(true).setStringValue(payload).build()).build();
Mutation mutation = Mutation.newBuilder().setUpdate(entity).build();
CommitRequest commitRequest = CommitRequest.newBuilder().setProjectId(projectId).setMode(Mode.NON_TRANSACTIONAL).addMutations(mutation).build();
CommitResponse commitResponse = stub.commit(commitRequest);
System.out.println("index updates: " + commitResponse.getIndexUpdates());
}
Aggregations