Search in sources :

Example 1 with BaseBigtableDataClient

use of com.google.cloud.bigtable.data.v2.BaseBigtableDataClient in project gapic-generator-java by googleapis.

the class AsyncReadRows method asyncReadRows.

public static void asyncReadRows() throws Exception {
    // It may require modifications to work in your environment.
    try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        ReadRowsRequest request = ReadRowsRequest.newBuilder().setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()).setAppProfileId("appProfileId704923523").setRows(RowSet.newBuilder().build()).setFilter(RowFilter.newBuilder().build()).setRowsLimit(-944199211).build();
        ServerStream<ReadRowsResponse> stream = baseBigtableDataClient.readRowsCallable().call(request);
        for (ReadRowsResponse response : stream) {
        // Do something when a response is received.
        }
    }
}
Also used : ReadRowsResponse(com.google.bigtable.v2.ReadRowsResponse) ReadRowsRequest(com.google.bigtable.v2.ReadRowsRequest) BaseBigtableDataClient(com.google.cloud.bigtable.data.v2.BaseBigtableDataClient)

Example 2 with BaseBigtableDataClient

use of com.google.cloud.bigtable.data.v2.BaseBigtableDataClient in project gapic-generator-java by googleapis.

the class SyncMutateRowStringBytestringListmutationString method syncMutateRowStringBytestringListmutationString.

public static void syncMutateRowStringBytestringListmutationString() 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;
        List<Mutation> mutations = new ArrayList<>();
        String appProfileId = "appProfileId704923523";
        MutateRowResponse response = baseBigtableDataClient.mutateRow(tableName, rowKey, mutations, appProfileId);
    }
}
Also used : MutateRowResponse(com.google.bigtable.v2.MutateRowResponse) ByteString(com.google.protobuf.ByteString) ArrayList(java.util.ArrayList) ByteString(com.google.protobuf.ByteString) Mutation(com.google.bigtable.v2.Mutation) BaseBigtableDataClient(com.google.cloud.bigtable.data.v2.BaseBigtableDataClient)

Example 3 with BaseBigtableDataClient

use of com.google.cloud.bigtable.data.v2.BaseBigtableDataClient in project gapic-generator-java by googleapis.

the class SyncMutateRowTablenameBytestringListmutationString method syncMutateRowTablenameBytestringListmutationString.

public static void syncMutateRowTablenameBytestringListmutationString() 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<>();
        String appProfileId = "appProfileId704923523";
        MutateRowResponse response = baseBigtableDataClient.mutateRow(tableName, rowKey, mutations, appProfileId);
    }
}
Also used : TableName(com.google.bigtable.v2.TableName) MutateRowResponse(com.google.bigtable.v2.MutateRowResponse) ByteString(com.google.protobuf.ByteString) ArrayList(java.util.ArrayList) Mutation(com.google.bigtable.v2.Mutation) ByteString(com.google.protobuf.ByteString) BaseBigtableDataClient(com.google.cloud.bigtable.data.v2.BaseBigtableDataClient)

Example 4 with BaseBigtableDataClient

use of com.google.cloud.bigtable.data.v2.BaseBigtableDataClient in project gapic-generator-java by googleapis.

the class AsyncMutateRows method asyncMutateRows.

public static void asyncMutateRows() throws Exception {
    // It may require modifications to work in your environment.
    try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        MutateRowsRequest request = MutateRowsRequest.newBuilder().setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()).setAppProfileId("appProfileId704923523").addAllEntries(new ArrayList<MutateRowsRequest.Entry>()).build();
        ServerStream<MutateRowsResponse> stream = baseBigtableDataClient.mutateRowsCallable().call(request);
        for (MutateRowsResponse response : stream) {
        // Do something when a response is received.
        }
    }
}
Also used : MutateRowsResponse(com.google.bigtable.v2.MutateRowsResponse) MutateRowsRequest(com.google.bigtable.v2.MutateRowsRequest) ArrayList(java.util.ArrayList) BaseBigtableDataClient(com.google.cloud.bigtable.data.v2.BaseBigtableDataClient)

Example 5 with BaseBigtableDataClient

use of com.google.cloud.bigtable.data.v2.BaseBigtableDataClient in project gapic-generator-java by googleapis.

the class AsyncReadModifyWriteRow method asyncReadModifyWriteRow.

public static void asyncReadModifyWriteRow() throws Exception {
    // It may require modifications to work in your environment.
    try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        ReadModifyWriteRowRequest request = ReadModifyWriteRowRequest.newBuilder().setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()).setAppProfileId("appProfileId704923523").setRowKey(ByteString.EMPTY).addAllRules(new ArrayList<ReadModifyWriteRule>()).build();
        ApiFuture<ReadModifyWriteRowResponse> future = baseBigtableDataClient.readModifyWriteRowCallable().futureCall(request);
        // Do something.
        ReadModifyWriteRowResponse response = future.get();
    }
}
Also used : ReadModifyWriteRowRequest(com.google.bigtable.v2.ReadModifyWriteRowRequest) ArrayList(java.util.ArrayList) ReadModifyWriteRowResponse(com.google.bigtable.v2.ReadModifyWriteRowResponse) BaseBigtableDataClient(com.google.cloud.bigtable.data.v2.BaseBigtableDataClient)

Aggregations

BaseBigtableDataClient (com.google.cloud.bigtable.data.v2.BaseBigtableDataClient)22 ArrayList (java.util.ArrayList)18 ByteString (com.google.protobuf.ByteString)12 Mutation (com.google.bigtable.v2.Mutation)10 CheckAndMutateRowResponse (com.google.bigtable.v2.CheckAndMutateRowResponse)6 ReadModifyWriteRowResponse (com.google.bigtable.v2.ReadModifyWriteRowResponse)6 TableName (com.google.bigtable.v2.TableName)6 MutateRowResponse (com.google.bigtable.v2.MutateRowResponse)5 ReadModifyWriteRule (com.google.bigtable.v2.ReadModifyWriteRule)4 RowFilter (com.google.bigtable.v2.RowFilter)4 CheckAndMutateRowRequest (com.google.bigtable.v2.CheckAndMutateRowRequest)2 ReadModifyWriteRowRequest (com.google.bigtable.v2.ReadModifyWriteRowRequest)2 BaseBigtableDataSettings (com.google.cloud.bigtable.data.v2.BaseBigtableDataSettings)2 MutateRowRequest (com.google.bigtable.v2.MutateRowRequest)1 MutateRowsRequest (com.google.bigtable.v2.MutateRowsRequest)1 MutateRowsResponse (com.google.bigtable.v2.MutateRowsResponse)1 ReadRowsRequest (com.google.bigtable.v2.ReadRowsRequest)1 ReadRowsResponse (com.google.bigtable.v2.ReadRowsResponse)1 SampleRowKeysRequest (com.google.bigtable.v2.SampleRowKeysRequest)1 SampleRowKeysResponse (com.google.bigtable.v2.SampleRowKeysResponse)1