Interface DSLParser

All Known Implementing Classes:
DSLParserImpl

public interface DSLParser
Contains API to convert dot separated String path into an Aerospike filter - a functional language for applying predicates to bin data and record metadata.
Such filters are used in different areas of Aerospike Server functionality including the following:
  • filtering queries (acting as the WHERE clause),
  • filtering batch operations,
  • conditionally executing single key operations (get, put, delete, operate),
  • defining secondary indexes.
  • Method Details

    • parseExpression

      ParsedExpression parseExpression(ExpressionContext input)
      Parse DSL string into ParsedExpression.

      Examples:
      Path element
      $.binName Bin “binName”
      a Map key “a”
      '1' Map key (String) “1”
      1 Map key 1
      {1} Map index 1
      {=1} Map value (int) 1
      {=bb} Map value “bb”
      {='1'} Map value (String) “1”
      {#1} Map rank 1
      [1] List index 1
      [=1] List value 1
      [#1] List rank 1

      A nested element
      $.mapBinName.k [mapBinName -> mapKey("a")]
      $.mapBinName.a.aa.aaa [mapBinName -> mapKey("a") -> mapKey("aa") -> mapKey("aaa")]
      $.mapBinName.a.55 [mapBinName -> mapKey("a") -> mapKey(55)]
      $.listBinName.[1].aa [listBinName -> listIndex(1) -> mapKey("aa")]
      $.mapBinName.ab.cd.[-1].'10' [mapBinName -> mapKey("ab") -> mapKey("cd") -> listIndex(-1) -> mapKey("10")]
      Parameters:
      input - ExpressionContext containing input string of dot separated elements. If the input string has placeholders, matching values must be provided within input too
      Returns:
      ParsedExpression object
      Throws:
      DslParseException - in case of invalid syntax
    • parseExpression

      ParsedExpression parseExpression(ExpressionContext input, IndexContext indexContext)
      Parse DSL string into ParsedExpression.

      Examples:
      Path element
      $.binName Bin “binName”
      a Map key “a”
      '1' Map key (String) “1”
      1 Map key 1
      {1} Map index 1
      {=1} Map value (int) 1
      {=bb} Map value “bb”
      {='1'} Map value (String) “1”
      {#1} Map rank 1
      [1] List index 1
      [=1] List value 1
      [#1] List rank 1

      A nested element
      $.mapBinName.k [mapBinName -> mapKey("a")]
      $.mapBinName.a.aa.aaa [mapBinName -> mapKey("a") -> mapKey("aa") -> mapKey("aaa")]
      $.mapBinName.a.55 [mapBinName -> mapKey("a") -> mapKey(55)]
      $.listBinName.[1].aa [listBinName -> listIndex(1) -> mapKey("aa")]
      $.mapBinName.ab.cd.[-1].'10' [mapBinName -> mapKey("ab") -> mapKey("cd") -> listIndex(-1) -> mapKey("10")]
      Parameters:
      input - ExpressionContext containing input string of dot separated elements. If the input string has placeholders, matching values must be provided within input too
      indexContext - Class containing namespace and collection of Index objects that represent existing secondary indexes. Required for creating Filter. Can be null
      Returns:
      ParsedExpression object
      Throws:
      DslParseException - in case of invalid syntax
    • parseCTX

      com.aerospike.client.cdt.CTX[] parseCTX(String dslPath)
      Parse DSL path with CDT context into an array of CTX objects. The argument must represent a path with context, e.g. $.listBinName.[1], $.mapBinName.ab etc.
      Parameters:
      dslPath - Input string representing path with CDT context, must not be null
      Returns:
      Array of CTX
      Throws:
      DslParseException - in case of invalid syntax