BigtableDataGrpcClient (Cloud Bigtable HBase Client for Java 1.12.0 API)

com.google.cloud.bigtable.grpc

Class BigtableDataGrpcClient

  • All Implemented Interfaces:
    BigtableDataClient


    public class BigtableDataGrpcClient
    extends Object
    implements BigtableDataClient
    A gRPC client to access the v2 Bigtable data service.

    In addition to calling the underlying data service API via grpc, this class adds retry logic and some useful headers.

    Most of the methods are unary (single response). The only exception is ReadRows which is a streaming call.

    Version:
    $Id: $Id
    Author:
    sduskis
    • Field Detail

      • IS_RETRYABLE_MUTATION

        public static final Predicate<com.google.bigtable.v2.MutateRowRequest> IS_RETRYABLE_MUTATION
        Constant IS_RETRYABLE_MUTATION
    • Method Detail

      • mutateRow

        public com.google.bigtable.v2.MutateRowResponse mutateRow(com.google.bigtable.v2.MutateRowRequest request)
        Mutate a row atomically.
        Specified by:
        mutateRow in interface BigtableDataClient
        Parameters:
        request - a MutateRowRequest object.
        Returns:
        a MutateRowResponse object.
      • mutateRowAsync

        public ListenableFuture<com.google.bigtable.v2.MutateRowResponse> mutateRowAsync(com.google.bigtable.v2.MutateRowRequest request)
        Mutate a row atomically.
        Specified by:
        mutateRowAsync in interface BigtableDataClient
        Parameters:
        request - a MutateRowRequest object.
        Returns:
        a ListenableFuture that will finish when the mutation has completed.
      • mutateRows

        public List<com.google.bigtable.v2.MutateRowsResponse> mutateRows(com.google.bigtable.v2.MutateRowsRequest request)
        Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.
        Specified by:
        mutateRows in interface BigtableDataClient
        Parameters:
        request - a MutateRowsRequest object.
        Returns:
        a List object.
      • mutateRowsAsync

        public ListenableFuture<List<com.google.bigtable.v2.MutateRowsResponse>> mutateRowsAsync(com.google.bigtable.v2.MutateRowsRequest request)
        Mutates multiple rows in a batch. Each individual row is mutated atomically as in MutateRow, but the entire batch is not executed atomically.
        Specified by:
        mutateRowsAsync in interface BigtableDataClient
        Parameters:
        request - a MutateRowsRequest object.
        Returns:
        a ListenableFuture that will finish when the mutations have all been completed.
      • checkAndMutateRow

        public com.google.bigtable.v2.CheckAndMutateRowResponse checkAndMutateRow(com.google.bigtable.v2.CheckAndMutateRowRequest request)
        Mutate a row atomically dependent on a precondition.
        Specified by:
        checkAndMutateRow in interface BigtableDataClient
        Parameters:
        request - a CheckAndMutateRowRequest object.
        Returns:
        a CheckAndMutateRowResponse object.
      • checkAndMutateRowAsync

        public ListenableFuture<com.google.bigtable.v2.CheckAndMutateRowResponse> checkAndMutateRowAsync(com.google.bigtable.v2.CheckAndMutateRowRequest request)
        Mutate a row atomically dependent on a precondition.
        Specified by:
        checkAndMutateRowAsync in interface BigtableDataClient
        Parameters:
        request - a CheckAndMutateRowRequest object.
        Returns:
        a ListenableFuture that will finish when the mutation has completed.
      • readModifyWriteRow

        public com.google.bigtable.v2.ReadModifyWriteRowResponse readModifyWriteRow(com.google.bigtable.v2.ReadModifyWriteRowRequest request)
        Perform an atomic read-modify-write operation on a row.
        Specified by:
        readModifyWriteRow in interface BigtableDataClient
        Parameters:
        request - a ReadModifyWriteRowRequest object.
        Returns:
        a ReadModifyWriteRowResponse object.
      • readModifyWriteRowAsync

        public ListenableFuture<com.google.bigtable.v2.ReadModifyWriteRowResponse> readModifyWriteRowAsync(com.google.bigtable.v2.ReadModifyWriteRowRequest request)
        Perform an atomic read-modify-write operation on a row,
        Specified by:
        readModifyWriteRowAsync in interface BigtableDataClient
        Parameters:
        request - a ReadModifyWriteRowRequest object.
        Returns:
        a ListenableFuture that will finish when the mutation has completed.
      • sampleRowKeys

        public List<com.google.bigtable.v2.SampleRowKeysResponse> sampleRowKeys(com.google.bigtable.v2.SampleRowKeysRequest request)
        Sample row keys from a table.
        Specified by:
        sampleRowKeys in interface BigtableDataClient
        Parameters:
        request - a SampleRowKeysRequest object.
        Returns:
        an immutable List object.
      • sampleRowKeysAsync

        public ListenableFuture<List<com.google.bigtable.v2.SampleRowKeysResponse>> sampleRowKeysAsync(com.google.bigtable.v2.SampleRowKeysRequest request)
        Sample row keys from a table, returning a Future that will complete when the sampling has completed.
        Specified by:
        sampleRowKeysAsync in interface BigtableDataClient
        Parameters:
        request - a SampleRowKeysRequest object.
        Returns:
        a ListenableFuture object.
      • readRowsAsync

        public ListenableFuture<List<com.google.bigtable.v2.Row>> readRowsAsync(com.google.bigtable.v2.ReadRowsRequest request)
        Read multiple Rows into an in-memory list, in key order.
        Specified by:
        readRowsAsync in interface BigtableDataClient
        Parameters:
        request - a ReadRowsRequest object.
        Returns:
        a ListenableFuture that will finish when all reads have completed.
      • readRows

        public ResultScanner<com.google.bigtable.v2.Row> readRows(com.google.bigtable.v2.ReadRowsRequest request)
        Perform a scan over Rows, in key order.
        Specified by:
        readRows in interface BigtableDataClient
        Parameters:
        request - a ReadRowsRequest object.
        Returns:
        a ResultScanner object.