com.google.cloud.bigtable.grpc.async
Class BulkRead
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.async.BulkRead
-
public class BulkRead extends Object
This class combines a collection ofReadRowsRequest
s with a single row key into a singleReadRowsRequest
with aRowSet
which will result in fewer round trips. This class is not thread safe, and requires calling classes to make it thread safe.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Field Summary
Fields Modifier and Type Field and Description protected static Logger
LOG
ConstantLOG
-
Constructor Summary
Constructors Constructor and Description BulkRead(IBigtableDataClient client, BigtableTableName tableName, int batchSizes, ExecutorService threadPool)
Constructor for BulkRead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description com.google.api.core.ApiFuture<FlatRow>
add(com.google.cloud.bigtable.data.v2.models.Query query)
Adds the key in the request to a batch read.void
flush()
Sends all remaining requests to the server.int
getBatchSizes()
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
ConstantLOG
-
-
Constructor Detail
-
BulkRead
public BulkRead(IBigtableDataClient client, BigtableTableName tableName, int batchSizes, ExecutorService threadPool)
Constructor for BulkRead.- Parameters:
client
- aIBigtableDataClient
object.tableName
- aBigtableTableName
object.batchSizes
- The number of keys to lookup per RPC.threadPool
- theExecutorService
to execute the batched reads on
-
-
Method Detail
-
add
public com.google.api.core.ApiFuture<FlatRow> add(com.google.cloud.bigtable.data.v2.models.Query query)
Adds the key in the request to a batch read. The future will be resolved when the batch response is received.- Parameters:
query
- aQuery
with a single row key.- Returns:
- a
ApiFuture
that will be populated with theFlatRow
that corresponds to the request
-
flush
public void flush()
Sends all remaining requests to the server. This method does not wait for the method to complete.
-
getBatchSizes
public int getBatchSizes()
-
-