AMBARI-5799. Add filter by regex and sort capabilities to API. Change operator from filter to matches. (swagle)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f3db95ff Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f3db95ff Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f3db95ff Branch: refs/heads/trunk Commit: f3db95ff8af20f81c946aecff87d826ef89b786d Parents: 7e9a6df Author: Siddharth Wagle <swa...@hortonworks.com> Authored: Thu May 22 10:19:58 2014 -0700 Committer: Siddharth Wagle <swa...@hortonworks.com> Committed: Thu May 22 10:19:58 2014 -0700 ---------------------------------------------------------------------- .../java/org/apache/ambari/server/api/predicate/QueryLexer.java | 2 +- .../server/api/predicate/operators/RelationalOperatorFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f3db95ff/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java b/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java index 71cdeea..3940c34 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/QueryLexer.java @@ -49,7 +49,7 @@ public class QueryLexer { * All valid deliminators. */ private static final String[] ALL_DELIMS = - {".filter\\(",".in\\(",".isEmpty\\(","<=",">=","!=","=","<",">","&","|","!","(", ")"}; + {".matches\\(",".in\\(",".isEmpty\\(","<=",">=","!=","=","<",">","&","|","!","(", ")"}; /** * Map of token type to list of valid handlers for next token. http://git-wip-us.apache.org/repos/asf/ambari/blob/f3db95ff/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/operators/RelationalOperatorFactory.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/operators/RelationalOperatorFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/operators/RelationalOperatorFactory.java index 256bbc4..a460c84 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/operators/RelationalOperatorFactory.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/predicate/operators/RelationalOperatorFactory.java @@ -50,7 +50,7 @@ public class RelationalOperatorFactory { return new InOperator(); } else if (".isEmpty(".equals(operator)) { return new IsEmptyOperator(); - } else if (".filter(".equals(operator)) { + } else if (".matches(".equals(operator)) { return new FilterOperator(); } else { throw new RuntimeException("Invalid Operator Type: " + operator);