public class BulkRead extends Object
ReadRowsRequest
s with a single row key into a single
ReadRowsRequest
with a RowSet
which will result in fewer round trips. This class
is not thread safe, and requires calling classes to make it thread safe.Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOG
Constant
LOG |
Constructor and Description |
---|
BulkRead(BigtableDataClient client,
BigtableTableName tableName,
int batchSizes,
ExecutorService threadPool)
Constructor for BulkRead.
|
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<FlatRow> |
add(com.google.bigtable.v2.ReadRowsRequest request)
Adds the key in the request to a batch read.
|
void |
flush()
Sends all remaining requests to the server.
|
int |
getBatchSizes() |
protected static final Logger LOG
LOG
public BulkRead(BigtableDataClient client, BigtableTableName tableName, int batchSizes, ExecutorService threadPool)
client
- a BigtableDataClient
object.tableName
- a BigtableTableName
object.batchSizes
- The number of keys to lookup per RPC.threadPool
- the ExecutorService
to execute the batched reads onpublic com.google.common.util.concurrent.ListenableFuture<FlatRow> add(com.google.bigtable.v2.ReadRowsRequest request)
request
- a ReadRowsRequest
with a single row key.ListenableFuture
that will be populated
with the FlatRow
that corresponds to the requestpublic void flush()
public int getBatchSizes()