public final class Statement extends Object
Constructor and Description |
---|
Statement() |
Modifier and Type | Method and Description |
---|---|
String[] |
getBinNames()
Get query bin names.
|
Filter |
getFilter()
Return query index filter.
|
Filter[] |
getFilters()
Return query filters.
|
Value[] |
getFunctionArgs()
Return aggregation function arguments.
|
String |
getFunctionName()
Return aggregation function name.
|
String |
getIndexName()
Get optional query index name.
|
String |
getNamespace()
Get query namespace.
|
String |
getPackageName()
Return aggregation file name.
|
PredExp[] |
getPredExp()
Return predicate expression filters.
|
ClassLoader |
getResourceLoader()
Return resource class loader.
|
String |
getResourcePath()
Return resource path.
|
String |
getSetName()
Get optional query setname.
|
long |
getTaskId()
Return task ID.
|
boolean |
isScan()
Return if full namespace/set scan is specified.
|
void |
prepare(boolean returnData)
Prepare statement just prior to execution.
|
boolean |
returnData()
Does command return data.
|
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.
|
void |
setAggregateFunction(String packageName,
String functionName,
Value... functionArgs)
Set Lua aggregation function parameters for a Lua package located on the filesystem.
|
void |
setBinNames(String... binNames)
Set query bin names.
|
void |
setFilter(Filter filter)
Set optional query index filter.
|
void |
setFilters(Filter... filters)
Set optional query index filters.
|
void |
setIndexName(String indexName)
Set optional query index name.
|
void |
setNamespace(String namespace)
Set query namespace.
|
void |
setPredExp(PredExp... predExp)
Set optional predicate expression filters in postfix notation.
|
void |
setSetName(String setName)
Set optional query setname.
|
void |
setTaskId(long taskId)
Set optional query task id.
|
public void setNamespace(String namespace)
public String getNamespace()
public void setSetName(String setName)
public String getSetName()
public void setIndexName(String indexName)
public String getIndexName()
public void setBinNames(String... binNames)
public String[] getBinNames()
public void setFilters(Filter... filters)
This method is obsolete. Use setFilter(Filter)
instead.
public Filter[] getFilters()
This method is obsolete. Use getFilter()
instead.
public void setFilter(Filter filter)
public Filter getFilter()
public void setPredExp(PredExp... predExp)
Postfix notation is described here: http://wiki.c2.com/?PostfixNotation
Example:
// (c >= 11 and c <= 20) or (d > 3 and (d < 5) stmt.setPredExp( PredExp.integerBin("c"), PredExp.integerValue(11), PredExp.integerGreaterEq(), PredExp.integerBin("c"), PredExp.integerValue(20), PredExp.integerLessEq(), PredExp.and(2), PredExp.integerBin("d"), PredExp.integerValue(3), PredExp.integerGreater(), PredExp.integerBin("d"), PredExp.integerValue(5), PredExp.integerLess(), PredExp.and(2), PredExp.or(2) ); // Record last update time > 2017-01-15 stmt.setPredExp( PredExp.recLastUpdate(), PredExp.integerValue(new GregorianCalendar(2017, 0, 15)), PredExp.integerGreater(), );
public PredExp[] getPredExp()
public void setTaskId(long taskId)
public long getTaskId()
public void setAggregateFunction(String packageName, String functionName, Value... functionArgs)
packageName
- server package where user defined function residesfunctionName
- aggregation function namefunctionArgs
- arguments to pass to function name, if anypublic void setAggregateFunction(ClassLoader resourceLoader, String resourcePath, String packageName, String functionName, Value... functionArgs)
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 anypublic ClassLoader getResourceLoader()
public String getResourcePath()
public String getPackageName()
public String getFunctionName()
public Value[] getFunctionArgs()
public boolean returnData()
public void prepare(boolean returnData)
public boolean isScan()
Copyright ? 2012–2018 Aerospike, Inc. All rights reserved.