Package com.aerospike.client.query
Class Statement
java.lang.Object
com.aerospike.client.query.Statement
Query statement parameters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Get query bin names.Return query index filter.Value[]Return aggregation function arguments.Return aggregation function name.Get optional query index name.longReturn maximum number of records.Get query namespace.Return operations to be performed on a background query.Return aggregation file name.intReturn records per second.Return resource class loader.Return resource path.Get optional query setname.longReturn optional task id.booleanisScan()Return if full namespace/set scan is specified.longReturn taskId if set by user.booleanDeprecated.voidsetAggregateFunction(ClassLoader resourceLoader, String resourcePath, String packageName, String functionName, Value... functionArgs) Set Lua aggregation function parameters for a Lua package located in a resource file.voidsetAggregateFunction(String packageName, String functionName, Value... functionArgs) Set Lua aggregation function parameters for a Lua package located on the filesystem.voidsetBinNames(String... binNames) Set query bin names.voidSet optional query index filter.voidsetIndexName(String indexName) Set optional query index name.voidsetMaxRecords(long maxRecords) Set maximum number of records returned (for foreground query) or processed (for background execute query).voidsetNamespace(String namespace) Set query namespace.voidsetOperations(Operation[] operations) Set operations to be performed on a background queryAerospikeClient.execute(com.aerospike.client.policy.WritePolicy, Statement, Operation...)A foreground query that returns records to the client will silently ignore these operations.voidsetRecordsPerSecond(int recordsPerSecond) Limit returned records per second (rps) rate for each server.voidsetReturnData(boolean returnData) Deprecated.voidsetSetName(String setName) Set optional query setname.voidsetTaskId(long taskId) Set optional task id.
-
Constructor Details
-
Statement
public Statement()
-
-
Method Details
-
setNamespace
Set query namespace. -
getNamespace
Get query namespace. -
setSetName
Set optional query setname. -
getSetName
Get optional query setname. -
setIndexName
Set optional query index name. If not set, the server will determine the index from the filter's bin name. Note, the call is only applicable to pre-6.0 server versions, and is ignored by server versions 6.0 and later. -
getIndexName
Get optional query index name. -
setBinNames
Set query bin names. -
getBinNames
Get query bin names. -
setFilter
Set optional query index filter. This filter is applied to the secondary index on query. Query index filters must reference a bin which has a secondary index defined. -
getFilter
Return query index filter. -
setTaskId
public void setTaskId(long taskId) Set optional task id. -
getTaskId
public long getTaskId()Return optional task id. -
setMaxRecords
public void setMaxRecords(long maxRecords) Set maximum number of records returned (for foreground query) or processed (for background execute query). This number is divided by the number of nodes involved in the query. The actual number of records returned may be less than maxRecords if node record counts are small and unbalanced across nodes. -
getMaxRecords
public long getMaxRecords()Return maximum number of records. -
setRecordsPerSecond
public void setRecordsPerSecond(int recordsPerSecond) Limit returned records per second (rps) rate for each server. Do not apply rps limit if recordsPerSecond is zero (default). Currently only applicable to a query without a defined filter. -
getRecordsPerSecond
public int getRecordsPerSecond()Return records per second. -
setAggregateFunction
Set Lua aggregation function parameters for a Lua package located on the filesystem. This function will be called on both the server and client for each selected item.- Parameters:
packageName- server package where user defined function residesfunctionName- aggregation function namefunctionArgs- arguments to pass to function name, if any
-
setAggregateFunction
public void setAggregateFunction(ClassLoader resourceLoader, String resourcePath, String packageName, String functionName, Value... functionArgs) Set Lua aggregation function parameters for a Lua package located in a resource file. This function will be called on both the server and client for each selected item.- Parameters:
resourceLoader- class loader where resource is located. Example: MyClass.class.getClassLoader() or Thread.currentThread().getContextClassLoader() for webappsresourcePath- class path where Lua resource is locatedpackageName- server package where user defined function residesfunctionName- aggregation function namefunctionArgs- arguments to pass to function name, if any
-
getResourceLoader
Return resource class loader. -
getResourcePath
Return resource path. -
getPackageName
Return aggregation file name. -
getFunctionName
Return aggregation function name. -
getFunctionArgs
Return aggregation function arguments. -
setOperations
Set operations to be performed on a background queryAerospikeClient.execute(com.aerospike.client.policy.WritePolicy, Statement, Operation...)A foreground query that returns records to the client will silently ignore these operations. -
getOperations
Return operations to be performed on a background query. -
setReturnData
Deprecated.Not used anymore. -
returnData
Deprecated.Not used anymore. -
prepareTaskId
public long prepareTaskId()Return taskId if set by user. Otherwise return a new taskId. -
isScan
public boolean isScan()Return if full namespace/set scan is specified.
-