Search in sources :

Example 11 with BaseBigtableDataClient

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

the class SyncCreateSetEndpoint method syncCreateSetEndpoint.

public static void syncCreateSetEndpoint() throws Exception {
    // This snippet has been automatically generated for illustrative purposes only.
    // It may require modifications to work in your environment.
    BaseBigtableDataSettings baseBigtableDataSettings = BaseBigtableDataSettings.newBuilder().setEndpoint(myEndpoint).build();
    BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create(baseBigtableDataSettings);
}
Also used : BaseBigtableDataSettings(com.google.cloud.bigtable.data.v2.BaseBigtableDataSettings) BaseBigtableDataClient(com.google.cloud.bigtable.data.v2.BaseBigtableDataClient)

Example 12 with BaseBigtableDataClient

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

the class AsyncMutateRow method asyncMutateRow.

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

Example 13 with BaseBigtableDataClient

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

the class SyncMutateRowStringBytestringListmutation method syncMutateRowStringBytestringListmutation.

public static void syncMutateRowStringBytestringListmutation() 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<>();
        MutateRowResponse response = baseBigtableDataClient.mutateRow(tableName, rowKey, mutations);
    }
}
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 14 with BaseBigtableDataClient

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

the class AsyncCheckAndMutateRow method asyncCheckAndMutateRow.

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

Example 15 with BaseBigtableDataClient

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

the class AsyncSampleRowKeys method asyncSampleRowKeys.

public static void asyncSampleRowKeys() throws Exception {
    // It may require modifications to work in your environment.
    try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) {
        SampleRowKeysRequest request = SampleRowKeysRequest.newBuilder().setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()).setAppProfileId("appProfileId704923523").build();
        ServerStream<SampleRowKeysResponse> stream = baseBigtableDataClient.sampleRowKeysCallable().call(request);
        for (SampleRowKeysResponse response : stream) {
        // Do something when a response is received.
        }
    }
}
Also used : SampleRowKeysResponse(com.google.bigtable.v2.SampleRowKeysResponse) SampleRowKeysRequest(com.google.bigtable.v2.SampleRowKeysRequest) 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