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,
Type type,
Map<String,String> options)
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,
Map<String,String> options)
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,
TypeObjectMap<T> typeObjectMap,
WorkerList workers,
Map<String,String> options)
Creates a
RecordRetriever with the specified parameters. |
RecordRetriever(GPUdb gpudb,
String tableName,
Type type,
WorkerList workers)
Creates a
RecordRetriever with the specified parameters. |
RecordRetriever(GPUdb gpudb,
String tableName,
Type type,
WorkerList workers,
Map<String,String> options)
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.
|
Map<String,String> |
getOptions()
Gets the options currently used for the retriever methods.
|
String |
getTableName()
Gets the name of the table from which records will be retrieved.
|
RecordRetriever |
setOptions(Map<String,String> options)
Sets the options to be used for the retriever methods.
|
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, Map<String,String> options) 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 retrievedoptions
- optional parameters to pass to GPUdb while retrievingGPUdbException
- 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, Type type, WorkerList workers, Map<String,String> options) 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)options
- optional parameters to pass to GPUdb while retrievingGPUdbException
- 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, Map<String,String> options) 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
retrievedoptions
- optional parameters to pass to GPUdb while retrievingGPUdbException
- 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 RecordRetriever(GPUdb gpudb, String tableName, TypeObjectMap<T> typeObjectMap, WorkerList workers, Map<String,String> options) 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)options
- optional parameters to pass to GPUdb while retrievingGPUdbException
- if a configuration error occursIllegalArgumentException
- if an invalid parameter is specifiedpublic GPUdb getGPUdb()
public String getTableName()
public Map<String,String> getOptions()
GetRecordsRequest.Options.EXPRESSION
options will
get overridden at the next getByKey
call with the appropriate
expression.setOptions
public RecordRetriever setOptions(Map<String,String> options)
options
- the options to be used during record retrievalRecordRetriever
instancecom.gpudb.protocol.GetRecordsRequest.Options.EXPRESSION
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 © 2020. All rights reserved.