Package com.aerospike.dsl.api
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:
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 Summary
Modifier and TypeMethodDescriptioncom.aerospike.client.cdt.CTX[]Parse DSL path with CDT context into an array ofCTXobjects.parseExpression(ExpressionContext input) Parse DSL string intoParsedExpression.parseExpression(ExpressionContext input, IndexContext indexContext) Parse DSL string intoParsedExpression.
-
Method Details
-
parseExpression
Parse DSL string intoParsedExpression.
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-ExpressionContextcontaining input string of dot separated elements. If the input string has placeholders, matching values must be provided withininputtoo- Returns:
ParsedExpressionobject- Throws:
DslParseException- in case of invalid syntax
-
parseExpression
Parse DSL string intoParsedExpression.
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-ExpressionContextcontaining input string of dot separated elements. If the input string has placeholders, matching values must be provided withininputtooindexContext- Class containing namespace and collection ofIndexobjects that represent existing secondary indexes. Required for creatingFilter. Can be null- Returns:
ParsedExpressionobject- Throws:
DslParseException- in case of invalid syntax
-
parseCTX
Parse DSL path with CDT context into an array ofCTXobjects. 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
-