com.google.cloud.bigtable.grpc
Class BigtableDataClientWrapper
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.BigtableDataClientWrapper
-
- All Implemented Interfaces:
- IBigtableDataClient
public class BigtableDataClientWrapper extends Object implements IBigtableDataClient
This class implements theIBigtableDataClient
interface and wrapsBigtableDataClient
with Google-cloud-java's models.
-
-
Constructor Summary
Constructors Constructor and Description BigtableDataClientWrapper(BigtableDataClient bigtableDataClient, com.google.cloud.bigtable.data.v2.internal.RequestContext requestContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Boolean
checkAndMutateRow(com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation conditionalRowMutation)
Mutate a row atomically dependent on a precondition.com.google.api.core.ApiFuture<Boolean>
checkAndMutateRowAsync(com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation conditionalRowMutation)
Mutate a row atomically dependent on a precondition.IBulkMutation
createBulkMutationBatcher()
CreatesIBulkMutation
batcher.void
mutateRow(com.google.cloud.bigtable.data.v2.models.RowMutation rowMutation)
Mutate a row atomically.com.google.api.core.ApiFuture<Void>
mutateRowAsync(com.google.cloud.bigtable.data.v2.models.RowMutation rowMutation)
Mutate a row atomically.ResultScanner<FlatRow>
readFlatRows(com.google.cloud.bigtable.data.v2.models.Query request)
Perform a scan overFlatRow
s, in key order.com.google.api.core.ApiFuture<List<FlatRow>>
readFlatRowsAsync(com.google.cloud.bigtable.data.v2.models.Query request)
Read multipleFlatRow
s into an in-memory list, in key order.void
readFlatRowsAsync(com.google.cloud.bigtable.data.v2.models.Query request, io.grpc.stub.StreamObserver<FlatRow> observer)
ReadFlatRow
asynchronously, and pass them to a stream observer to be processed.List<FlatRow>
readFlatRowsList(com.google.cloud.bigtable.data.v2.models.Query request)
Returns a list ofFlatRow
s, in key order.com.google.cloud.bigtable.data.v2.models.Row
readModifyWriteRow(com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow readModifyWriteRow)
Perform an atomic read-modify-write operation on a row.com.google.api.core.ApiFuture<com.google.cloud.bigtable.data.v2.models.Row>
readModifyWriteRowAsync(com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow readModifyWriteRow)
Perform an atomic read-modify-write operation on a row.ResultScanner<com.google.cloud.bigtable.data.v2.models.Row>
readRows(com.google.cloud.bigtable.data.v2.models.Query request)
Perform a scan overRow
s, in key order.com.google.api.core.ApiFuture<List<com.google.cloud.bigtable.data.v2.models.Row>>
readRowsAsync(com.google.cloud.bigtable.data.v2.models.Query request)
Read multipleRow
s into an in-memory list, in key order.List<com.google.cloud.bigtable.data.v2.models.KeyOffset>
sampleRowKeys(String tableId)
Sample row keys from a table.com.google.api.core.ApiFuture<List<com.google.cloud.bigtable.data.v2.models.KeyOffset>>
sampleRowKeysAsync(String tableId)
Sample row keys from a table, returning a Future that will complete when the sampling has completed.
-
-
-
Constructor Detail
-
BigtableDataClientWrapper
public BigtableDataClientWrapper(BigtableDataClient bigtableDataClient, com.google.cloud.bigtable.data.v2.internal.RequestContext requestContext)
-
-
Method Detail
-
mutateRow
public void mutateRow(com.google.cloud.bigtable.data.v2.models.RowMutation rowMutation)
Mutate a row atomically.- Specified by:
mutateRow
in interfaceIBigtableDataClient
- Parameters:
rowMutation
- aRowMutation
model object.
-
mutateRowAsync
public com.google.api.core.ApiFuture<Void> mutateRowAsync(com.google.cloud.bigtable.data.v2.models.RowMutation rowMutation)
Mutate a row atomically.- Specified by:
mutateRowAsync
in interfaceIBigtableDataClient
- Parameters:
rowMutation
- aRowMutation
model object.- Returns:
- a
ApiFuture
of typeVoid
will be set when request is successful otherwise exception will be thrown.
-
readModifyWriteRow
public com.google.cloud.bigtable.data.v2.models.Row readModifyWriteRow(com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow readModifyWriteRow)
Perform an atomic read-modify-write operation on a row.- Specified by:
readModifyWriteRow
in interfaceIBigtableDataClient
- Parameters:
readModifyWriteRow
- aReadModifyWriteRow
model object.- Returns:
Row
a modified row.
-
readModifyWriteRowAsync
public com.google.api.core.ApiFuture<com.google.cloud.bigtable.data.v2.models.Row> readModifyWriteRowAsync(com.google.cloud.bigtable.data.v2.models.ReadModifyWriteRow readModifyWriteRow)
Perform an atomic read-modify-write operation on a row.- Specified by:
readModifyWriteRowAsync
in interfaceIBigtableDataClient
- Parameters:
readModifyWriteRow
- aReadModifyWriteRow
model object.- Returns:
- a
ApiFuture
of typeRow
will be set when request is successful otherwise exception will be thrown.
-
createBulkMutationBatcher
public IBulkMutation createBulkMutationBatcher()
CreatesIBulkMutation
batcher.- Specified by:
createBulkMutationBatcher
in interfaceIBigtableDataClient
-
checkAndMutateRowAsync
public com.google.api.core.ApiFuture<Boolean> checkAndMutateRowAsync(com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation conditionalRowMutation)
Mutate a row atomically dependent on a precondition.- Specified by:
checkAndMutateRowAsync
in interfaceIBigtableDataClient
- Parameters:
conditionalRowMutation
- aConditionalRowMutation
model object.- Returns:
- a
ApiFuture
of typeBoolean
will be set when request is successful otherwise exception will be thrown.
-
checkAndMutateRow
public Boolean checkAndMutateRow(com.google.cloud.bigtable.data.v2.models.ConditionalRowMutation conditionalRowMutation)
Mutate a row atomically dependent on a precondition.- Specified by:
checkAndMutateRow
in interfaceIBigtableDataClient
- Parameters:
conditionalRowMutation
- aConditionalRowMutation
model object.- Returns:
- returns true if predicate returns any result.
-
sampleRowKeys
public List<com.google.cloud.bigtable.data.v2.models.KeyOffset> sampleRowKeys(String tableId)
Sample row keys from a table.- Specified by:
sampleRowKeys
in interfaceIBigtableDataClient
- Parameters:
tableId
- a String object.- Returns:
- an immutable
List
object.
-
sampleRowKeysAsync
public com.google.api.core.ApiFuture<List<com.google.cloud.bigtable.data.v2.models.KeyOffset>> sampleRowKeysAsync(String tableId)
Sample row keys from a table, returning a Future that will complete when the sampling has completed.- Specified by:
sampleRowKeysAsync
in interfaceIBigtableDataClient
- Parameters:
tableId
- a String object.- Returns:
- a
ApiFuture
object.
-
readRows
public ResultScanner<com.google.cloud.bigtable.data.v2.models.Row> readRows(com.google.cloud.bigtable.data.v2.models.Query request)
Perform a scan overRow
s, in key order.- Specified by:
readRows
in interfaceIBigtableDataClient
- Parameters:
request
- aQuery
object.- Returns:
- a
Row
object.
-
readRowsAsync
public com.google.api.core.ApiFuture<List<com.google.cloud.bigtable.data.v2.models.Row>> readRowsAsync(com.google.cloud.bigtable.data.v2.models.Query request)
Read multipleRow
s into an in-memory list, in key order.- Specified by:
readRowsAsync
in interfaceIBigtableDataClient
- Parameters:
request
- aQuery
object.- Returns:
- a
ApiFuture
that will finish when all reads have completed.
-
readFlatRowsList
public List<FlatRow> readFlatRowsList(com.google.cloud.bigtable.data.v2.models.Query request)
Returns a list ofFlatRow
s, in key order.- Specified by:
readFlatRowsList
in interfaceIBigtableDataClient
- Parameters:
request
- aQuery
object.- Returns:
- a List with
FlatRow
s.
-
readFlatRows
public ResultScanner<FlatRow> readFlatRows(com.google.cloud.bigtable.data.v2.models.Query request)
Perform a scan overFlatRow
s, in key order.- Specified by:
readFlatRows
in interfaceIBigtableDataClient
- Parameters:
request
- aQuery
object.- Returns:
- a
ResultScanner
object.
-
readFlatRowsAsync
public com.google.api.core.ApiFuture<List<FlatRow>> readFlatRowsAsync(com.google.cloud.bigtable.data.v2.models.Query request)
Read multipleFlatRow
s into an in-memory list, in key order.- Specified by:
readFlatRowsAsync
in interfaceIBigtableDataClient
- Parameters:
request
- aQuery
object.- Returns:
- a
ApiFuture
that will finish when all reads have completed.
-
readFlatRowsAsync
public void readFlatRowsAsync(com.google.cloud.bigtable.data.v2.models.Query request, io.grpc.stub.StreamObserver<FlatRow> observer)
ReadFlatRow
asynchronously, and pass them to a stream observer to be processed.- Specified by:
readFlatRowsAsync
in interfaceIBigtableDataClient
- Parameters:
request
- aQuery
object.observer
- aStreamObserver
object.
-
-