Class Statement

java.lang.Object
com.aerospike.client.query.Statement

public final class Statement extends Object
Query statement parameters.
  • Constructor Details

    • Statement

      public Statement()
  • Method Details

    • setNamespace

      public void setNamespace(String namespace)
      Set query namespace.
    • getNamespace

      public String getNamespace()
      Get query namespace.
    • setSetName

      public void setSetName(String setName)
      Set optional query setname.
    • getSetName

      public String getSetName()
      Get optional query setname.
    • setIndexName

      public void setIndexName(String indexName)
      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

      public String getIndexName()
      Get optional query index name.
    • setBinNames

      public void setBinNames(String... binNames)
      Set query bin names.
    • getBinNames

      public String[] getBinNames()
      Get query bin names.
    • setFilter

      public void setFilter(Filter filter)
      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

      public Filter 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

      public void setAggregateFunction(String packageName, String functionName, Value... functionArgs)
      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 resides
      functionName - aggregation function name
      functionArgs - 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 webapps
      resourcePath - class path where Lua resource is located
      packageName - server package where user defined function resides
      functionName - aggregation function name
      functionArgs - arguments to pass to function name, if any
    • getResourceLoader

      public ClassLoader getResourceLoader()
      Return resource class loader.
    • getResourcePath

      public String getResourcePath()
      Return resource path.
    • getPackageName

      public String getPackageName()
      Return aggregation file name.
    • getFunctionName

      public String getFunctionName()
      Return aggregation function name.
    • getFunctionArgs

      public Value[] getFunctionArgs()
      Return aggregation function arguments.
    • setOperations

      public void setOperations(Operation[] operations)
      Set operations to be performed on a background query AerospikeClient.execute(com.aerospike.client.policy.WritePolicy, Statement, Operation...) A foreground query that returns records to the client will silently ignore these operations.
    • getOperations

      public Operation[] getOperations()
      Return operations to be performed on a background query.
    • setReturnData

      @Deprecated public void setReturnData(boolean returnData)
      Deprecated.
      Not used anymore.
    • returnData

      @Deprecated public boolean 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.