T
- the type of object being retrievedpublic class RecordRetriever<T> extends Object
RecordRetriever
instances are thread safe and
may be used from any number of threads simultaneously.Constructor and Description |
---|
RecordRetriever(GPUdb gpudb,
String tableName,
Type type)
Creates a
RecordRetriever with the specified parameters. |
RecordRetriever(GPUdb gpudb,
String tableName,
TypeObjectMap<T> typeObjectMap)
Creates a
RecordRetriever with the specified parameters. |
RecordRetriever(GPUdb gpudb,
String tableName,
TypeObjectMap<T> typeObjectMap,
WorkerList workers)
Creates a
RecordRetriever with the specified parameters. |
RecordRetriever(GPUdb gpudb,
String tableName,
Type type,
WorkerList workers)
Creates a
RecordRetriever with the specified parameters. |
Modifier and Type | Method and Description |
---|---|
GetRecordsResponse<T> |
getByKey(List<Object> keyValues,
String expression)
Retrieves records for a given shard key, optionally further limited by an
additional expression.
|
GPUdb |
getGPUdb()
Gets the GPUdb instance from which records will be retrieved.
|
String |
getTableName()
Gets the name of the table from which records will be retrieved.
|
public RecordRetriever(GPUdb gpudb, String tableName, Type type) throws GPUdbException
RecordRetriever
with the specified parameters.gpudb
- the GPUdb instance to retrieve records fromtableName
- the table to retrieve records fromtype
- the type of records being retrievedGPUdbException
- if a configuration error occursIllegalArgumentException
- if an invalid parameter is specifiedpublic RecordRetriever(GPUdb gpudb, String tableName, Type type, WorkerList workers) throws GPUdbException
RecordRetriever
with the specified parameters.gpudb
- the GPUdb instance to retrieve records fromtableName
- the table to retrieve records fromtype
- the type of records being retrievedworkers
- worker list for multi-head retrieval (null
to
disable multi-head retrieval)GPUdbException
- if a configuration error occursIllegalArgumentException
- if an invalid parameter is specifiedpublic RecordRetriever(GPUdb gpudb, String tableName, TypeObjectMap<T> typeObjectMap) throws GPUdbException
RecordRetriever
with the specified parameters.gpudb
- the GPUdb instance to retrieve records fromtableName
- the table to retrieve records fromtypeObjectMap
- type object map for the type of records being
retrievedGPUdbException
- if a configuration error occursIllegalArgumentException
- if an invalid parameter is specifiedpublic RecordRetriever(GPUdb gpudb, String tableName, TypeObjectMap<T> typeObjectMap, WorkerList workers) throws GPUdbException
RecordRetriever
with the specified parameters.gpudb
- the GPUdb instance to retrieve records fromtableName
- the table to retrieve records fromtypeObjectMap
- type object map for the type of records being
retrievedworkers
- worker list for multi-head retrieval (null
to disable multi-head retrieval)GPUdbException
- if a configuration error occursIllegalArgumentException
- if an invalid parameter is specifiedpublic GPUdb getGPUdb()
public String getTableName()
public GetRecordsResponse<T> getByKey(List<Object> keyValues, String expression) throws GPUdbException
All fields in both the shard key and the expression must have defined attribute indexes, unless the shard key is also a primary key and all referenced fields are in the primary key. The expression must be limited to basic equality and inequality comparisons that can be evaluated using the attribute indexes.
keyValues
- list of values that make up the shard key; the values
must be in the same order as in the table and have the
correct data typesexpression
- additional filter to be applied, or null
for
noneresponse
object containing the resultsGPUdbException
- if an error occurs during the operationCopyright © 2019. All rights reserved.