You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by km...@apache.org on 2016/12/23 21:09:54 UTC

[01/25] geode git commit: CTR: remove incorrect links to Pivotal Native Client product APIs

Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2231 b440f4de2 -> e3286fa8e


CTR: remove incorrect links to Pivotal Native Client product APIs


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/e3286fa8
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/e3286fa8
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/e3286fa8

Branch: refs/heads/feature/GEODE-2231
Commit: e3286fa8ec0b88ac19500a9d582dba9bddea1889
Parents: 7fe3823
Author: Karen Miller <km...@pivotal.io>
Authored: Thu Dec 22 16:21:54 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 geode-docs/getting_started/querying_quick_reference.html.md.erb | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/e3286fa8/geode-docs/getting_started/querying_quick_reference.html.md.erb
----------------------------------------------------------------------
diff --git a/geode-docs/getting_started/querying_quick_reference.html.md.erb b/geode-docs/getting_started/querying_quick_reference.html.md.erb
index 5a117d2..74ea3eb 100644
--- a/geode-docs/getting_started/querying_quick_reference.html.md.erb
+++ b/geode-docs/getting_started/querying_quick_reference.html.md.erb
@@ -511,8 +511,6 @@ If you are querying a Java application\u2019s local cache or querying other members
 
 If you are writing a Java client to server query, use [org.apache.geode.cache.client.Pool.getQueryService](/releases/latest/javadoc/org/apache/geode/cache/client/Pool.html).
 
-If you are writing a native client to server query, use the [.NET API](/releases/latest/net_api/DotNetDocs/Index.html) or the [C++ API](/releases/latest/cpp_api/cppdocs/index.html).
-
 ## <a id="reference_D5CE64F5FD6F4A808AEFB748C867189E__section_3E6E4B33D57846008EF4404D2B687597" class="no-quick-link"></a>How do I invoke an object's method in a query?
 
 To use a method in a query, use the attribute name that maps to the public method you want to invoke. For example:


[03/25] geode git commit: GEODE-165: Removed OQL generated files and added the target into geode-core/build.gradle.

Posted by km...@apache.org.
http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/oql.g
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/oql.g b/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/oql.g
deleted file mode 100644
index a743752..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/oql.g
+++ /dev/null
@@ -1,1195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
-**  oql.g
-**
-** Built with Antlr 2.7.4
-**   java antlr.Tool oql.g
-*/
-
-header {
-package org.apache.geode.cache.query.internal.parse;
-import java.util.*;
-import org.apache.geode.cache.query.internal.types.*;
-}
-
-options {
-    language="Java";
-}
-
-class OQLLexer extends Lexer ;
-options {
-    k=2;
-    charVocabulary = '\u0000'..'\uFFFE';
-    testLiterals=false;     // don't automatically test for literals
-    caseSensitive=false;
-    caseSensitiveLiterals = false;
-    defaultErrorHandler = false;
-}
-
-{
-    static {
-        // Set up type names for verbose AST printing
-        antlr.BaseAST.setVerboseStringConversion(true, OQLParser._tokenNames);
-    }
-
-    protected Token makeToken(int t) {
-        Token tok = super.makeToken(t);
-        if (tok.getType() == EOF) tok.setText("EOF");
-        if (tok.getText() == null) {
-          tok.setText("(no text)");
-        }
-        return tok;
-    }
-}    
-
-
-        /* punctuation */
-TOK_RPAREN  :       ')'             ;
-TOK_LPAREN  :       '('             ;
-TOK_COMMA   :       ','             ;
-TOK_SEMIC   :       ';'             ;
-TOK_DOTDOT  :       ".."            ;
-TOK_COLON   :       ':'             ;
-TOK_DOT     :       '.'             ;
-TOK_INDIRECT:       '-' '>'         { $setType(TOK_DOT); } ;
-TOK_CONCAT  :       '|' '|'         ;
-TOK_EQ      :       '='             ;
-TOK_PLUS    :       '+'             ;
-TOK_MINUS   :       '-'             ;
-TOK_SLASH   :       '/'             ;
-TOK_STAR    :       '*'             ;
-TOK_LE      :       '<' '='         ;
-TOK_GE      :       '>' '='         ;
-TOK_NE      :       '<' '>'         ;
-TOK_NE_ALT  :       '!' '='         { $setType(TOK_NE); }  ;
-TOK_LT      :       '<'             ;
-TOK_GT      :       '>'             ;
-TOK_LBRACK  :       '['             ;
-TOK_RBRACK  :       ']'             ;
-TOK_DOLLAR  :       '$'             ;
-
-/* Character Classes */
-protected
-LETTER : ('\u0061'..'\u007a' |
-       '\u00c0'..'\u00d6' |
-       '\u00a1'..'\u00bf' |
-       '\u00d8'..'\u00f6' |
-       '\u00f8'..'\u00ff' |
-       '\u0100'..'\u065f' |
-       '\u066a'..'\u06ef' |
-       '\u06fa'..'\u0965' |
-       '\u0970'..'\u09e5' |
-       '\u09f0'..'\u0a65' |
-       '\u0a70'..'\u0ae5' |
-       '\u0af0'..'\u0b65' |
-       '\u0b70'..'\u0be6' |
-       '\u0bf0'..'\u0c65' |
-       '\u0c70'..'\u0ce5' |
-       '\u0cf0'..'\u0d65' |
-       '\u0d70'..'\u0e4f' |
-       '\u0e5a'..'\u0ecf' |
-       '\u0eda'..'\u103f' |
-       '\u104a'..'\u1fff' |
-       '\u2000'..'\u206f' |       
-       '\u3040'..'\u318f' |
-       '\u3300'..'\u337f' |
-       '\u3400'..'\u3d2d' |
-       '\u4e00'..'\u9fff' |
-       '\uf900'..'\ufaff')
-    ;
-
-protected
-DIGIT : ('\u0030'..'\u0039' |
-       '\u0660'..'\u0669' |
-       '\u06f0'..'\u06f9' |
-       '\u0966'..'\u096f' |
-       '\u09e6'..'\u09ef' |
-       '\u0a66'..'\u0a6f' |
-       '\u0ae6'..'\u0aef' |
-       '\u0b66'..'\u0b6f' |
-       '\u0be7'..'\u0bef' |
-       '\u0c66'..'\u0c6f' |
-       '\u0ce6'..'\u0cef' |
-       '\u0d66'..'\u0d6f' |
-       '\u0e50'..'\u0e59' |
-       '\u0ed0'..'\u0ed9' |
-       '\u1040'..'\u1049')
-    ;
-
-protected
-ALL_UNICODE : ('\u0061'..'\ufffd')	
-    ;
-
-/*
- * Names
- */
-protected
-NameFirstCharacter:
-        ( LETTER | '_' )
-    ;
-
-protected
-NameCharacter:
-        ( LETTER | '_' | DIGIT | '$') // an internal $ is used for internal use identifiers
-    ;
-
-protected
-RegionNameCharacter:
-        ( ALL_UNICODE | '_' | DIGIT | '+' | '-' | ':' | '#' | '@' | '$') // an internal $ is used for internal use identifiers
-    ;
-
-QuotedIdentifier
-       options {testLiterals=false;}
-            :
-    
-            '"'! NameFirstCharacter ( NameCharacter )* '"'!
-    ;
-
-
-
-Identifier
-        options {testLiterals=true;}
-            :
-
-            NameFirstCharacter ( NameCharacter )*
-    ;
-
-
-
-RegionPath :  ( ( (TOK_SLASH ( RegionNameCharacter )+ )+ ) | 
-			  ( (TOK_SLASH StringLiteral )+ ) ) 
-    ;
-
-
-/* Numbers */
-// a numeric literal
-NUM_INT
-	{boolean isDecimal=false; Token t=null;}
-    :   (	'0' {isDecimal = true;} // special case for just '0'
-			(	'x'
-				(						// hex
-					// the 'e'|'E' and float suffix stuff look
-					// like hex digits, hence the (...)+ doesn't
-					// know when to stop: ambig.  ANTLR resolves
-					// it correctly by matching immediately.  It
-					// is therefor ok to hush warning.
-					options {
-						warnWhenFollowAmbig=false;
-					}
-				:	HEX_DIGIT
-				)+
-
-			|	//float or double with leading zero
-				(('0'..'9')+ ('.'|EXPONENT|FLOAT_SUFFIX)) => ('0'..'9')+
-
-			|	('0'..'7')+					// octal
-			)?
-		|	('1'..'9') ('0'..'9')*  {isDecimal=true;}		// non-zero decimal
-		)
-		(	'l' { _ttype = NUM_LONG; }
-
-		// only check to see if it's a float if looks like decimal so far
-		|	{isDecimal}?
-            (   '.' ('0'..'9')* (EXPONENT)? (f2:FLOAT_SUFFIX {t=f2;})?
-            |   EXPONENT (f3:FLOAT_SUFFIX {t=f3;})?
-            |   f4:FLOAT_SUFFIX {t=f4;}
-            )
-            {
-			if (t != null && t.getText().toUpperCase() .indexOf('F') >= 0) {
-                _ttype = NUM_FLOAT;
-			}
-            else {
-	           	_ttype = NUM_DOUBLE; // assume double
-			}
-			}
-        )?
-	;
-
-
-// a couple protected methods to assist in matching floating point numbers
-protected
-EXPONENT
-	:	'e' ('+'|'-')? ('0'..'9')+
-	;
-
-
-protected
-FLOAT_SUFFIX
-	:	'f'|'d'
-	;
-
-// hexadecimal digit
-protected
-HEX_DIGIT
-	:	('0'..'9'| 'a'..'f')
-	;
-
-
-protected
-QUOTE
-        :       '\''
-        ;
-
-StringLiteral :
-        QUOTE!
-        (
-            QUOTE QUOTE!
-        |   '\n'                { newline(); }
-        |   ~( '\'' | '\n' )
-        )*
-        QUOTE!
-
-    ;
-
-
-// Whitespace -- ignored
-WS	:	(	' '
-		|	'\t'
-		|	'\f'
-			// handle newlines
-		|	(	options {generateAmbigWarnings=false;}
-			:	"\r\n"  // Evil DOS
-			|	'\r'    // Macintosh
-			|	'\n'    // Unix (the right way)
-			)
-			{ newline(); }
-		)+
-		{ _ttype = Token.SKIP; }
-	;
-
-
-// Single-line comments
-SL_COMMENT
-	:	"--"
-		(~('\n'|'\r'))* ('\n'|'\r'('\n')?)?
-		{$setType(Token.SKIP); newline();}
-	;
-
-// multiple-line comments
-ML_COMMENT
-	:	"/*"
-		(	/*	'\r' '\n' can be matched in one alternative or by matching
-				'\r' in one iteration and '\n' in another.  I am trying to
-				handle any flavor of newline that comes in, but the language
-				that allows both "\r\n" and "\r" and "\n" to all be valid
-				newline is ambiguous.  Consequently, the resulting grammar
-				must be ambiguous.  I'm shutting this warning off.
-			 */
-			options {
-				generateAmbigWarnings=false;
-			}
-		:
-			{ LA(2)!='/' }? '*'
-		|	'\r' '\n'		{newline();}
-		|	'\r'			{newline();}
-		|	'\n'			{newline();}
-		|	~('*'|'\n'|'\r')
-		)*
-		"*/"
-		{$setType(Token.SKIP);}
-	;
-
-
-
-
-/***************************** OQL PARSER *************************************/
-
-class OQLParser
-extends Parser("org.apache.geode.cache.query.internal.parse.UtilParser");
-
-options {
-    buildAST = true;
-    k = 2;
-    codeGenMakeSwitchThreshold = 3;
-    codeGenBitsetTestThreshold = 4;
-    defaultErrorHandler = false;
-}
-
-tokens {
-    QUERY_PROGRAM;
-    QUALIFIED_NAME;
-    QUERY_PARAM;
-    ITERATOR_DEF;
-    PROJECTION_ATTRS;
-    PROJECTION;
-    TYPECAST;
-    COMBO;
-    METHOD_INV;
-    POSTFIX; 
-    OBJ_CONSTRUCTOR;
-    IMPORTS;
-    SORT_CRITERION;
-    LIMIT;
-    HINT;
-    AGG_FUNC;
-    SUM;
-    AVG;
-    COUNT;
-    MAX;
-    MIN;
-}
-
-queryProgram :
-		( traceCommand )?
-       	( 
-       
-       		( declaration ( TOK_SEMIC! declaration )* ( TOK_SEMIC! query ) ) (TOK_SEMIC!)?
-        	|   
-        	query (TOK_SEMIC!)?
-       	)
-       	EOF!
-        { #queryProgram =
-          #([QUERY_PROGRAM, "queryProgram",
-            "org.apache.geode.cache.query.internal.parse.GemFireAST"],
-            #queryProgram); }
-    ;
-
-traceCommand:
-		( 	
-			TOK_LT!
-			"trace"^<AST=org.apache.geode.cache.query.internal.parse.ASTTrace>
-			TOK_GT!
-		)
-	;
-     
-
-loneFromClause :
-    iteratorDef
-        (
-            TOK_COMMA!
-            iteratorDef
-        )* EOF!
-    { #loneFromClause =
-          #([LITERAL_from, "from",
-            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
-            #loneFromClause); }
-    ;
-
-loneProjectionAttributes :
-    projectionAttributes EOF!
-    ;
-
-declaration :
-
-            defineQuery
-        |   importQuery
-        |   undefineQuery
-        |   paramTypeDecl
-
-    ;
-
-importQuery :
-
-        "import"^<AST=org.apache.geode.cache.query.internal.parse.ASTImport>
-        qualifiedName
-        (
-            "as" identifier
-        )?
-
-    ;
-
-loneImports :
-        importQuery ( TOK_SEMIC! importQuery )*
-        (TOK_SEMIC!)?
-        EOF!
-        // combine into a single node
-        { #loneImports = #([IMPORTS, "imports",
-            "org.apache.geode.cache.query.internal.parse.GemFireAST"],
-                #loneImports); }
-    ;
-
-paramTypeDecl :
-    
-        "declare"^ (queryParam) (TOK_COMMA! queryParam)* type
-    ;
-        
-
-qualifiedName :
-
-        identifier
-        (
-            TOK_DOT!
-            identifier
-        )*
-    ;
-
-
-defineQuery :
-
-        "define"^
-            ( "query"! )?
-        identifier
-
-        (
-            TOK_LPAREN!
-            type
-            identifier
-            (
-                TOK_COMMA!
-                type
-                identifier
-            )*
-            TOK_RPAREN!
-        )?
-
-        "as"!
-        query
-    ;
-
-undefineQuery :
-
-        "undefine"^
-        ( "query"! )?
-        identifier
-    ;
-
-query :
-
-        (
-            selectExpr
-        |   expr
-        )
-    ;
-
-selectExpr :
-		( hintCommand )?
-        "select"^<AST=org.apache.geode.cache.query.internal.parse.ASTSelect>
-
-        (
-            // ambig. betweed this distinct and a distinct conversion expr
-            // the first distinct keyword here must be for the select,
-            // so take adv. of greedy and turn off warning
-            options {
-                warnWhenFollowAmbig = false;
-            } :
-
-            "distinct" <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
-            | "all" <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
-        )?
-
-        
-		(			
-          projectionAttributes
-		)
-        fromClause
-        ( whereClause )?
-        ( groupClause )?
-        ( orderClause )?
-        ( limitClause )?
-    ;
-
-fromClause :
-
-        "from"^<AST=org.apache.geode.cache.query.internal.parse.ASTCombination>
-        iteratorDef
-        (
-            TOK_COMMA!
-            iteratorDef
-        )*
-    ;
-
-iteratorDef! :
-
-            (identifier "in" ) =>
-
-            id1:identifier
-            "in"!
-            ex1:expr ( "type"! t1:type )?
-            { #iteratorDef = #([ITERATOR_DEF, "iterDef", "org.apache.geode.cache.query.internal.parse.ASTIteratorDef"], #ex1, #id1, #t1); }
-
-        |   ex2:expr
-            (
-                ( "as"! )?
-                id2:identifier
-            )?
-            ( "type"! t2:type )?
-
-            { #iteratorDef = #([ITERATOR_DEF, "iterDef", "org.apache.geode.cache.query.internal.parse.ASTIteratorDef"], #ex2, #id2, #t2); }
-    ;
-
-whereClause :
-
-        "where"! expr
-    ;
-    
-limitClause! :
-
-        "limit" (TOK_DOLLAR NUM_INT
-        { #limitClause = #([LIMIT, "limitParam",
-               "org.apache.geode.cache.query.internal.parse.ASTParameter"],
-                   #NUM_INT); }
-         | n:NUM_INT{ #limitClause =#[LIMIT,n.getText(),"org.apache.geode.cache.query.internal.parse.ASTLimit"] ; })
-    ;
-
-projectionAttributes :
-
-        (
-            projection
-            (
-                TOK_COMMA!
-                projection
-            )*
-            { #projectionAttributes = #([PROJECTION_ATTRS, "projectionAttrs",
-                "org.apache.geode.cache.query.internal.parse.ASTCombination"],
-                #projectionAttributes); }
-
-        |   TOK_STAR <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
-        )
-    ;
-
-projection!{ AST node  = null;}:
-        
-            lb1:identifier TOK_COLON!  ( tok1:aggregateExpr{node = #tok1;} | tok2:expr{node = #tok2;})
-            { #projection = #([PROJECTION, "projection",
-            "org.apache.geode.cache.query.internal.parse.ASTProjection"],  node, #lb1); } 
-        |
-            (tok3:aggregateExpr{node = #tok3;} | tok4:expr{node = #tok4;})
-            (
-                "as"
-                lb2: identifier
-            )?
-            { #projection = #([PROJECTION, "projection",
-            "org.apache.geode.cache.query.internal.parse.ASTProjection"], node, #lb2); }
-    ;
-
-
-            
-
-groupClause :
-
-        "group"^<AST=org.apache.geode.cache.query.internal.parse.ASTGroupBy>
-        "by"!  groupByList
-
-        (
-            "having"!
-            expr
-        )?
-    ;
-    
-hintCommand :
-		 	
-			TOK_LT!
-			"hint"^<AST=org.apache.geode.cache.query.internal.parse.ASTHint>
-			hintIdentifier
-			(
-			  TOK_COMMA! hintIdentifier
-			)*
-			TOK_GT!
-		
-	;
-
-      
-hintIdentifier :
- 	n:StringLiteral{ #hintIdentifier =#[HINT,n.getText(),"org.apache.geode.cache.query.internal.parse.ASTHintIdentifier"] ; }       
-;
-
-orderClause :
-
-        "order"^<AST=org.apache.geode.cache.query.internal.parse.ASTOrderBy>
-        "by"!
-        sortCriterion
-        (
-            TOK_COMMA! sortCriterion
-        )*
-    ;
-
-sortCriterion :
-
-        tok:expr { #sortCriterion = #([SORT_CRITERION, "asc", "org.apache.geode.cache.query.internal.parse.ASTSortCriterion"],
-            tok); }        
-        (
-            "asc"! {#sortCriterion.setText("asc");}
-        |   "desc"! {#sortCriterion.setText("desc");}
-
-        )?
-    ;
-
-expr :
-
-        castExpr
-
-     ;
-
-
-castExpr
-	:	
-
-        // Have to backtrack to see if operator follows.  If no operator
-        // follows, it's a typecast.  No semantic checking needed to parse.
-        // if it _looks_ like a cast, it _is_ a cast; else it's a "(expr)"
-    	(TOK_LPAREN type TOK_RPAREN castExpr)=>
-        lp:TOK_LPAREN^<AST=org.apache.geode.cache.query.internal.parse.ASTTypeCast>
-                {#lp.setType(TYPECAST); #lp.setText("typecast");}
-            type TOK_RPAREN!
-        castExpr
-
-    |	orExpr
-	;
-
-orExpr
-      { boolean cmplx = false; } :
-       
-            orelseExpr ( "or"! orelseExpr  { cmplx = true; } )*
-       { if (cmplx) {
-            #orExpr = #([LITERAL_or, "or",
-                    "org.apache.geode.cache.query.internal.parse.ASTOr"],
-                #orExpr); } }
-      ;
-
-orelseExpr 
-       { boolean cmplx = false; } :
-            andExpr ( "orelse"! andExpr { cmplx = true; } )*
-       { if (cmplx) { #orelseExpr = #([LITERAL_orelse, "or"], #orelseExpr); } }
-      ;
-
-
-andExpr 
-        { boolean cmplx = false; } :
-           quantifierExpr ( "and"! quantifierExpr { cmplx = true; } )*
-        { if (cmplx) {
-            #andExpr = #([LITERAL_and, "and",
-                    "org.apache.geode.cache.query.internal.parse.ASTAnd"],
-                    #andExpr); } }
-    ;
-
-quantifierExpr :
-
-            "for"^
-            "all"!
-            inClause TOK_COLON! andthenExpr
-
-        |   
-            ("exists" identifier "in" ) => 
-            "exists"^
-            inClause
-            TOK_COLON! andthenExpr
-
-        |   andthenExpr
-
-    ;
-
-
-inClause :
-            identifier "in"! expr
-         ;
-
-
-
-andthenExpr 
-         { boolean cmplx = false; } :
-            equalityExpr ( "andthen"! equalityExpr { cmplx = true; } )*
-            { if (cmplx) { #andthenExpr = #([LITERAL_andthen, "andthen"], #andthenExpr); } }
-         ;
-
-
-equalityExpr :
-
-            relationalExpr
-
-            (   
-                (   (
-                        TOK_EQ^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
-                    |   TOK_NE^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
-                    )
-                    (   "all"^
-                    |   "any"^
-                    |   "some"^
-                    )?
-                relationalExpr )+
-    
-            |   (  "like"^<AST=org.apache.geode.cache.query.internal.parse.ASTLike>
-                relationalExpr )*
-            )
-    ;
-
-relationalExpr :
-
-        additiveExpr
-        (
-            (
-                TOK_LT^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
-            |   TOK_GT^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
-            |   TOK_LE^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
-            |   TOK_GE^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
-            )
-
-            (
-                // Simple comparison of expressions
-                additiveExpr
-
-                // Comparison of queries
-            |   (
-                    "all"^
-                |   "any"^
-                |   "some"^
-                )
-                additiveExpr
-            )
-        )*
-    ;
-
-additiveExpr :
-
-        multiplicativeExpr
-        (
-            (
-                TOK_PLUS^
-            |   TOK_MINUS^
-            |   TOK_CONCAT^
-            |   "union"^
-            |   "except"^
-            )
-            multiplicativeExpr
-        )*
-    ;
-
-multiplicativeExpr :
-
-        inExpr
-        (
-            (
-                TOK_STAR^
-            |   TOK_SLASH^
-            |   "mod"^
-            |   "intersect"^
-            )
-            inExpr
-        )*
-    ;
-
-inExpr :
-
-        unaryExpr
-        (
-            "in"^<AST=org.apache.geode.cache.query.internal.parse.ASTIn> unaryExpr
-        )?
-    ;
-
-unaryExpr :
-
-        (
-            (
-                TOK_PLUS!
-            |   TOK_MINUS^<AST=org.apache.geode.cache.query.internal.parse.ASTUnary>
-            |   "abs"^
-            |   "not"^<AST=org.apache.geode.cache.query.internal.parse.ASTUnary>
-            )
-        )*
-        postfixExpr
-
-    ;
-
-postfixExpr
-         { boolean cmplx = false; } :
-            primaryExpr
-
-            (   
-                TOK_LBRACK!
-                    index TOK_RBRACK!
-                { cmplx = true; }
-    
-            |   ( TOK_DOT! | TOK_INDIRECT! ) 
-                  (  methodInvocation[false]
-                   | identifier )
-                { cmplx = true; }
-            )*
-            { if (cmplx) {
-                #postfixExpr = #([POSTFIX, "postfix",
-                   "org.apache.geode.cache.query.internal.parse.ASTPostfix"],
-                    #postfixExpr);
-              }
-            }
-
-    ;
-
-methodInvocation! [boolean implicitReceiver] :
-    
-            methodName:identifier args:argList  
-            { #methodInvocation =
-                #([METHOD_INV, "methodInv",
-                    "org.apache.geode.cache.query.internal.parse.ASTMethodInvocation"],
-                  #methodName, #args); 
-              ((ASTMethodInvocation)#methodInvocation).setImplicitReceiver(implicitReceiver); }
-        ;
-
-index :
-
-        // single element
-        (
-          expr
-          (
-            // multiple elements: OQL defines a comma-delimited list of
-            // indexes in its grammar, but seemingly fails to define the
-            // semantics.
-            // This grammar is left in just in case someone figures out what
-            // this means, but for now this will throw an UnsupportedOperationException
-            // at query compilation time
-            // (throw new UnsupportedOperationException("Only one index expression supported"))
-            (
-                TOK_COMMA!
-                expr 
-            )*
-
-            // Range of elements
-            |   TOK_COLON^ expr
-          ) 
-          | TOK_STAR
-        )
-        { #index = #([TOK_LBRACK, "index",
-            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
-                #index);
-        }
-    ;
-
-argList :
-
-        t:TOK_LPAREN^<AST=org.apache.geode.cache.query.internal.parse.ASTCombination>
-        (
-            expr
-            (
-                TOK_COMMA!
-                expr
-            )*
-        )?
-        TOK_RPAREN!
-    ;
-
-primaryExpr :
-
-        (
-            conversionExpr
-        |   collectionExpr
-        |   aggregateExpr
-        |   undefinedExpr
-        |   ( identifier TOK_LPAREN identifier TOK_COLON ) =>
-                objectConstruction
-        |   structConstruction
-        |   collectionConstruction
-        |   methodInvocation[true]
-        |   identifier
-        |   queryParam
-        |   literal
-        |   TOK_LPAREN! query TOK_RPAREN!
-        |   RegionPath<AST=org.apache.geode.cache.query.internal.parse.ASTRegionPath>
-        )
-    ;
-
-
-conversionExpr :
-	(
-
-	    (
-                  "listtoset"^
-              |   "element"^<AST=org.apache.geode.cache.query.internal.parse.ASTConversionExpr>
-            
-              |   "distinct"^
-              |   "flatten"^
-            )
-            TOK_LPAREN! query TOK_RPAREN!
-        |
-           (  
-              (
-               "nvl"^<AST=org.apache.geode.cache.query.internal.parse.ASTConversionExpr>
-              )
-              TOK_LPAREN!
-              expr TOK_COMMA! expr
-              TOK_RPAREN! 
-           ) 
-        |
-           (  
-              (
-               "to_date"^<AST=org.apache.geode.cache.query.internal.parse.ASTConversionExpr>
-              )
-              TOK_LPAREN!
-              stringLiteral TOK_COMMA! stringLiteral
-              TOK_RPAREN! 
-           )    
-	)
-    ;
-
-collectionExpr :
-
-        (
-            "first"^
-        |   "last"^
-        |   "unique"^
-        |   "exists"^
-        )
-        TOK_LPAREN! query TOK_RPAREN!
-
-    ;
-
-
-
-            
-aggregateExpr  { int aggFunc = -1; boolean distinctOnly = false; }:
-
-             !("sum" {aggFunc = SUM;} | "avg" {aggFunc = AVG;} )
-              TOK_LPAREN ("distinct"! {distinctOnly = true;} ) ? tokExpr1:expr TOK_RPAREN 
-              { #aggregateExpr = #([AGG_FUNC, "aggregate", "org.apache.geode.cache.query.internal.parse.ASTAggregateFunc"],
-              #tokExpr1); 
-                ((ASTAggregateFunc)#aggregateExpr).setAggregateFunctionType(aggFunc);
-                ((ASTAggregateFunc)#aggregateExpr).setDistinctOnly(distinctOnly);
-               }
-             
-             |
-             !("min" {aggFunc = MIN;} | "max" {aggFunc = MAX;} )
-              TOK_LPAREN  tokExpr2:expr TOK_RPAREN 
-              { #aggregateExpr = #([AGG_FUNC, "aggregate", "org.apache.geode.cache.query.internal.parse.ASTAggregateFunc"],
-              #tokExpr2); 
-                ((ASTAggregateFunc)#aggregateExpr).setAggregateFunctionType(aggFunc);               
-               }
-             
-             |
-              "count"^<AST=org.apache.geode.cache.query.internal.parse.ASTAggregateFunc>
-              TOK_LPAREN!  ( TOK_STAR <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
-              | ("distinct"! {distinctOnly = true;} ) ? expr ) TOK_RPAREN! 
-              {  
-                 ((ASTAggregateFunc)#aggregateExpr).setAggregateFunctionType(COUNT);
-                 #aggregateExpr.setText("aggregate");
-                 ((ASTAggregateFunc)#aggregateExpr).setDistinctOnly(distinctOnly);
-              }
-    ;
-
-undefinedExpr :
-
-        (
-            "is_undefined"^<AST=org.apache.geode.cache.query.internal.parse.ASTUndefinedExpr>
-        |   "is_defined"^<AST=org.apache.geode.cache.query.internal.parse.ASTUndefinedExpr>
-        )
-        TOK_LPAREN!
-        query
-        TOK_RPAREN!
-    ;
-
-objectConstruction :
-
-        identifier
-        t:TOK_LPAREN^
-            {#t.setType(OBJ_CONSTRUCTOR);}
-        fieldList
-        TOK_RPAREN!
-    ;
-
-structConstruction :
-
-        "struct"^
-        TOK_LPAREN!
-        fieldList
-        TOK_RPAREN!
-    ;
-
-
-groupByList :
-
-        expr
-        (
-            TOK_COMMA!
-            expr
-        )*
-        /*{ #groupByList = #([COMBO, "groupByList",
-            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
-                #groupByList); }*/
-  ;
-
-    
-fieldList :
-
-        identifier TOK_COLON! expr
-        (
-            TOK_COMMA!
-            identifier
-            TOK_COLON! expr
-        )*
-        { #fieldList = #([COMBO, "fieldList",
-            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
-                #fieldList); }
-    ;
-
-collectionConstruction :
-        (
-            (
-                "array"^
-            |   "set"^<AST=org.apache.geode.cache.query.internal.parse.ASTConstruction>
-            |   "bag"^
-            )
-            argList
-
-        |   "list"^
-            TOK_LPAREN
-            (
-                expr
-                (
-                    TOK_DOTDOT expr
-                |   (
-                        TOK_COMMA expr
-                    )*
-                )
-            )?
-            TOK_RPAREN
-        )
-    ;
-
-queryParam! :
-
-        TOK_DOLLAR NUM_INT
-        { #queryParam = #([QUERY_PARAM, "queryParam",
-               "org.apache.geode.cache.query.internal.parse.ASTParameter"],
-                   #NUM_INT); }
-        
-    ;
-
-type :
-    
-      (
-//            ( "unsigned" )? // ignored
-//            (
-                typ00:"short"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ00.setJavaType(TypeUtils.getObjectType(Short.class)); }
-            |   typ01:"long"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ01.setJavaType(TypeUtils.getObjectType(Long.class)); }
-//            )
-        |   typ02:"int"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ02.setJavaType(TypeUtils.getObjectType(Integer.class)); }
-        |   typ03:"float"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ03.setJavaType(TypeUtils.getObjectType(Float.class)); }
-        |   typ04:"double"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ04.setJavaType(TypeUtils.getObjectType(Double.class)); }
-        |   typ05:"char"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ05.setJavaType(TypeUtils.getObjectType(Character.class)); }
-        |   typ06:"string"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ06.setJavaType(TypeUtils.getObjectType(String.class)); }
-        |   typ07:"boolean"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ07.setJavaType(TypeUtils.getObjectType(Boolean.class)); }
-        |   typ08:"byte"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ08.setJavaType(TypeUtils.getObjectType(Byte.class)); } 
-        |   typ09:"octet"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ09.setJavaType(TypeUtils.getObjectType(Byte.class)); }
-        |   "enum"^ // unsupported
-            (
-                identifier
-                TOK_DOT
-            )?
-            identifier
-        |   typ10:"date"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ10.setJavaType(TypeUtils.getObjectType(java.sql.Date.class)); }
-        |   typ11:"time"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ11.setJavaType(TypeUtils.getObjectType(java.sql.Time.class)); }
-        |   "interval" // unsupported
-        |   typ12:"timestamp"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ12.setJavaType(TypeUtils.getObjectType(java.sql.Timestamp.class)); }
-        |   typ13:"set"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                TOK_LT! type TOK_GT!
-                    { #typ13.setJavaType(new CollectionTypeImpl(Set.class, TypeUtils.OBJECT_TYPE /*resolved later*/)); } 
-        |   typ14:"collection"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                TOK_LT! type TOK_GT!
-                    { #typ14.setJavaType(new CollectionTypeImpl(Collection.class, TypeUtils.OBJECT_TYPE /*resolved later*/)); } 
-        |   "bag"^ TOK_LT! type TOK_GT! // not supported
-        |   typ15:"list"^<AST=org.apache.geode.cache.query.internal.parse.ASTType> TOK_LT! type TOK_GT!
-                    { #typ15.setJavaType(new CollectionTypeImpl(List.class, TypeUtils.OBJECT_TYPE /*resolved later*/)); }
-        |   typ16:"array"^<AST=org.apache.geode.cache.query.internal.parse.ASTType> TOK_LT! type TOK_GT!
-                    { #typ16.setJavaType(new CollectionTypeImpl(Object[].class, TypeUtils.OBJECT_TYPE /*resolved later*/)); }
-        |   (typ17:"dictionary"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ17.setJavaType(new MapTypeImpl(Map.class, TypeUtils.OBJECT_TYPE , TypeUtils.OBJECT_TYPE /*resolved later*/)); }
-                | typ18:"map"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
-                    { #typ18.setJavaType(new MapTypeImpl(Map.class, TypeUtils.OBJECT_TYPE , TypeUtils.OBJECT_TYPE /*resolved later*/)); }
-            )
-            TOK_LT! type TOK_COMMA! type TOK_GT!
-        |!   id:identifier { String txt = #id.getText();
-                #type = #[Identifier, txt, "org.apache.geode.cache.query.internal.parse.ASTType"];
-                 ((ASTType)#type).setTypeName(txt); }
-      )
-      
-
-    ;
-
-literal :
-
-            objectLiteral
-        |   booleanLiteral
-        |   numericLiteral
-        |   charLiteral
-        |   stringLiteral
-        |   dateLiteral
-        |   timeLiteral
-        |   timestampLiteral
-    ;
-
-objectLiteral :
-
-        "nil"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-      | "null"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-      | "undefined"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-    ;
-
-booleanLiteral :
-
-        (
-            "true"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-        |   "false"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-        )
-    ;
-
-numericLiteral :
-
-        (   NUM_INT<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-          | NUM_LONG<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-          | NUM_FLOAT<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-          | NUM_DOUBLE<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-        )
-        
-    ;
-
-
-charLiteral :
-
-        "char"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-            StringLiteral
-    ;
-
-
-stringLiteral :
-
-        StringLiteral<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-    ;
-
-dateLiteral :
-
-        "date"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-            StringLiteral
-    ;
-
-timeLiteral :
-
-        "time"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-            StringLiteral
-    ;
-
-timestampLiteral :
-
-        "timestamp"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
-           StringLiteral
-    ;
-
-identifier :
-        Identifier<AST=org.apache.geode.cache.query.internal.parse.ASTIdentifier>
-    |   q:QuotedIdentifier<AST=org.apache.geode.cache.query.internal.parse.ASTIdentifier> 
-            { #q.setType(Identifier); }
-    ;
-

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/test/java/org/apache/geode/cache/query/functional/FunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/functional/FunctionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/functional/FunctionJUnitTest.java
index 4819e87..8bb2610 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/functional/FunctionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/functional/FunctionJUnitTest.java
@@ -26,6 +26,7 @@ import java.util.Collection;
 import java.util.Date;
 import java.util.Iterator;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -41,7 +42,6 @@ import org.apache.geode.cache.query.internal.CompiledFunction;
 import org.apache.geode.cache.query.internal.CompiledLiteral;
 import org.apache.geode.cache.query.internal.CompiledValue;
 import org.apache.geode.cache.query.internal.ExecutionContext;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
 @Category(IntegrationTest.class)

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledAggregateFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledAggregateFunctionJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledAggregateFunctionJUnitTest.java
index a2bc0b5..f3bcc02 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledAggregateFunctionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledAggregateFunctionJUnitTest.java
@@ -20,6 +20,7 @@ import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.jmock.Mockery;
 import org.junit.Before;
 import org.junit.Test;
@@ -41,7 +42,6 @@ import org.apache.geode.cache.query.internal.aggregate.MaxMin;
 import org.apache.geode.cache.query.internal.aggregate.Sum;
 import org.apache.geode.cache.query.internal.aggregate.SumDistinct;
 import org.apache.geode.cache.query.internal.aggregate.SumDistinctPRQueryNode;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java
index e94ea4f..21745d5 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/CompiledJunctionInternalsJUnitTest.java
@@ -32,6 +32,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -47,7 +48,6 @@ import org.apache.geode.cache.query.data.Address;
 import org.apache.geode.cache.query.data.Employee;
 import org.apache.geode.cache.query.data.Portfolio;
 import org.apache.geode.cache.query.internal.index.IndexManager;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/test/java/org/apache/geode/cache/query/internal/QCompilerJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QCompilerJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QCompilerJUnitTest.java
index f0a4cac..9b32fda 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/QCompilerJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/QCompilerJUnitTest.java
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
@@ -34,7 +35,6 @@ import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.query.CacheUtils;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
 /**

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/test/java/org/apache/geode/cache/query/internal/SelectResultsComparatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/SelectResultsComparatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/SelectResultsComparatorJUnitTest.java
index 9f3858f..3dbfc56 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/SelectResultsComparatorJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/SelectResultsComparatorJUnitTest.java
@@ -25,11 +25,11 @@ import java.util.Random;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.query.SelectResults;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
index f52f3aa..302a633 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/RangeIndexAPIJUnitTest.java
@@ -25,6 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -48,7 +49,6 @@ import org.apache.geode.cache.query.internal.ExecutionContext;
 import org.apache.geode.cache.query.internal.QCompiler;
 import org.apache.geode.cache.query.internal.QueryExecutionContext;
 import org.apache.geode.cache.query.internal.RuntimeIterator;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilTest.java b/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilTest.java
index 7dcdf74..126d13b 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/types/TypeUtilTest.java
@@ -16,10 +16,10 @@ package org.apache.geode.cache.query.internal.types;
 
 import static org.junit.Assert.*;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.pdx.internal.PdxString;
 import org.apache.geode.test.junit.categories.UnitTest;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/gradle/rat.gradle
----------------------------------------------------------------------
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index 4b4a3cc..df2db2c 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -136,12 +136,6 @@ rat {
     'geode-site/website/layouts/**',
 
 
-    // ANTLR generated files
-    'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexer.java',
-    'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.java',
-    'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLParser.java',
-    'geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.txt',
-
     // Service META-INF
     '**/META-INF/services/org.xml.sax.ext.EntityResolver2',
     '**/META-INF/services/org.apache.geode.internal.cache.CacheService',


[12/25] geode git commit: GEODE-2188: ExampleSecurityManager references SampleSecurityManager in javadoc

Posted by km...@apache.org.
GEODE-2188: ExampleSecurityManager references SampleSecurityManager in javadoc

* this closes #316


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/ca211b78
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/ca211b78
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/ca211b78

Branch: refs/heads/feature/GEODE-2231
Commit: ca211b78fac79114d711e7b36f0fd906c8382645
Parents: 3f655c0
Author: Kevin J. Duling <kd...@pivotal.io>
Authored: Wed Dec 14 13:23:19 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../security/ExampleSecurityManager.java        |  66 ++++++++++--
 .../security/ExampleSecurityManagerTest.java    | 104 +++++++++++++++++++
 .../security/SampleSecurityManagerTest.java     | 103 ------------------
 .../geode/security/TestSecurityManager.java     |  11 +-
 4 files changed, 167 insertions(+), 117 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/ca211b78/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java b/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java
index 612726a..84f97de 100644
--- a/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java
+++ b/geode-core/src/main/java/org/apache/geode/examples/security/ExampleSecurityManager.java
@@ -46,7 +46,7 @@ import java.util.stream.StreamSupport;
  * A Geode member must be configured with the following:
  *
  * <p>
- * {@code security-manager = org.apache.geode.security.examples.SampleSecurityManager}
+ * {@code security-manager = org.apache.geode.security.examples.ExampleSecurityManager}
  *
  * <p>
  * The class can be initialized with from a JSON resource called {@code security.json}. This file
@@ -130,7 +130,7 @@ public class ExampleSecurityManager implements SecurityManager {
 
     if (!initializeFromJsonResource(jsonPropertyValue)) {
       throw new AuthenticationFailedException(
-          "SampleSecurityManager: unable to find json resource \"" + jsonPropertyValue
+          "ExampleSecurityManager: unable to find json resource \"" + jsonPropertyValue
               + "\" as specified by [" + SECURITY_JSON + "].");
     }
   }
@@ -142,11 +142,11 @@ public class ExampleSecurityManager implements SecurityManager {
 
     User userObj = this.userNameToUser.get(user);
     if (userObj == null) {
-      throw new AuthenticationFailedException("SampleSecurityManager: wrong username/password");
+      throw new AuthenticationFailedException("ExampleSecurityManager: wrong username/password");
     }
 
     if (user != null && !userObj.password.equals(password) && !"".equals(user)) {
-      throw new AuthenticationFailedException("SampleSecurityManager: wrong username/password");
+      throw new AuthenticationFailedException("ExampleSecurityManager: wrong username/password");
     }
 
     return user;
@@ -165,7 +165,7 @@ public class ExampleSecurityManager implements SecurityManager {
     }
   }
 
-  boolean initializeFromJsonResource(final String jsonResource) {
+  public boolean initializeFromJsonResource(final String jsonResource) {
     try {
       InputStream input = ClassLoader.getSystemResourceAsStream(jsonResource);
       if (input != null) {
@@ -177,7 +177,7 @@ public class ExampleSecurityManager implements SecurityManager {
     return false;
   }
 
-  User getUser(final String user) {
+  public User getUser(final String user) {
     return this.userNameToUser.get(user);
   }
 
@@ -257,15 +257,65 @@ public class ExampleSecurityManager implements SecurityManager {
     return roleMap;
   }
 
-  static class Role {
+  public static class Role {
     List<ResourcePermission> permissions = new ArrayList<>();
+
+    public List<ResourcePermission> getPermissions() {
+      return permissions;
+    }
+
+    public void setPermissions(final List<ResourcePermission> permissions) {
+      this.permissions = permissions;
+    }
+
+    public String getName() {
+      return name;
+    }
+
+    public void setName(final String name) {
+      this.name = name;
+    }
+
+    public String getServerGroup() {
+      return serverGroup;
+    }
+
+    public void setServerGroup(final String serverGroup) {
+      this.serverGroup = serverGroup;
+    }
+
     String name;
     String serverGroup;
   }
 
-  static class User {
+  public static class User {
     String name;
     Set<Role> roles = new HashSet<>();
+
+    public String getName() {
+      return name;
+    }
+
+    public void setName(final String name) {
+      this.name = name;
+    }
+
+    public Set<Role> getRoles() {
+      return roles;
+    }
+
+    public void setRoles(final Set<Role> roles) {
+      this.roles = roles;
+    }
+
+    public String getPassword() {
+      return password;
+    }
+
+    public void setPassword(final String password) {
+      this.password = password;
+    }
+
     String password;
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/ca211b78/geode-core/src/test/java/org/apache/geode/security/ExampleSecurityManagerTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/ExampleSecurityManagerTest.java b/geode-core/src/test/java/org/apache/geode/security/ExampleSecurityManagerTest.java
new file mode 100644
index 0000000..9093a7b
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/security/ExampleSecurityManagerTest.java
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.security;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.geode.examples.security.ExampleSecurityManager;
+import org.apache.geode.examples.security.ExampleSecurityManager.User;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.util.Properties;
+
+@Category({IntegrationTest.class, SecurityTest.class})
+public class ExampleSecurityManagerTest {
+
+  private ExampleSecurityManager exampleSecurityManager;
+  private String jsonResource;
+  private File jsonFile;
+  private String json;
+
+  @Rule
+  public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+  @Before
+  public void setUp() throws Exception {
+    // resource file
+    this.jsonResource = "org/apache/geode/security/templates/security.json";
+    InputStream inputStream = ClassLoader.getSystemResourceAsStream(this.jsonResource);
+
+    assertThat(inputStream).isNotNull();
+
+    // non-resource file
+    this.jsonFile = new File(temporaryFolder.getRoot(), "security.json");
+    IOUtils.copy(inputStream, new FileOutputStream(this.jsonFile));
+
+    // string
+    this.json = FileUtils.readFileToString(this.jsonFile, "UTF-8");
+    this.exampleSecurityManager = new ExampleSecurityManager();
+  }
+
+  @Test
+  public void shouldDefaultToSecurityJsonInClasspathIfNullProperties() throws Exception {
+    this.exampleSecurityManager.init(null);
+    verifySecurityManagerState();
+  }
+
+  @Test
+  public void shouldDefaultToSecurityJsonInClasspathIfEmptyProperties() throws Exception {
+    this.exampleSecurityManager.init(new Properties());
+    verifySecurityManagerState();
+  }
+
+  @Test
+  public void shouldInitializeFromJsonResource() throws Exception {
+    this.exampleSecurityManager.initializeFromJsonResource(this.jsonResource);
+    verifySecurityManagerState();
+  }
+
+  @Test
+  public void initShouldUsePropertyAsJsonResource() throws Exception {
+    Properties securityProperties = new Properties();
+    securityProperties.setProperty(TestSecurityManager.SECURITY_JSON, this.jsonResource);
+    this.exampleSecurityManager.init(securityProperties);
+    verifySecurityManagerState();
+  }
+
+  private void verifySecurityManagerState() {
+    User adminUser = this.exampleSecurityManager.getUser("admin");
+    assertThat(adminUser).isNotNull();
+    assertThat(adminUser.getName()).isEqualTo("admin");
+    assertThat(adminUser.getPassword()).isEqualTo("secret");
+    assertThat(adminUser.getRoles()).hasSize(1);
+
+    User guestUser = this.exampleSecurityManager.getUser("guest");
+    assertThat(guestUser).isNotNull();
+    assertThat(guestUser.getName()).isEqualTo("guest");
+    assertThat(guestUser.getPassword()).isEqualTo("guest");
+    assertThat(guestUser.getRoles()).hasSize(1);
+    // TODO: need to do more verification
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/ca211b78/geode-core/src/test/java/org/apache/geode/security/SampleSecurityManagerTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/SampleSecurityManagerTest.java b/geode-core/src/test/java/org/apache/geode/security/SampleSecurityManagerTest.java
deleted file mode 100644
index 96cabf6..0000000
--- a/geode-core/src/test/java/org/apache/geode/security/SampleSecurityManagerTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.security;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.geode.security.TestSecurityManager.User;
-import org.apache.geode.test.junit.categories.IntegrationTest;
-import org.apache.geode.test.junit.categories.SecurityTest;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.util.Properties;
-
-@Category({IntegrationTest.class, SecurityTest.class})
-public class SampleSecurityManagerTest {
-
-  private TestSecurityManager sampleSecurityManager;
-  private String jsonResource;
-  private File jsonFile;
-  private String json;
-
-  @Rule
-  public TemporaryFolder temporaryFolder = new TemporaryFolder();
-
-  @Before
-  public void setUp() throws Exception {
-    // resource file
-    this.jsonResource = "org/apache/geode/security/templates/security.json";
-    InputStream inputStream = ClassLoader.getSystemResourceAsStream(this.jsonResource);
-
-    assertThat(inputStream).isNotNull();
-
-    // non-resource file
-    this.jsonFile = new File(temporaryFolder.getRoot(), "security.json");
-    IOUtils.copy(inputStream, new FileOutputStream(this.jsonFile));
-
-    // string
-    this.json = FileUtils.readFileToString(this.jsonFile, "UTF-8");
-    this.sampleSecurityManager = new TestSecurityManager();
-  }
-
-  @Test
-  public void shouldDefaultToSecurityJsonInClasspathIfNullProperties() throws Exception {
-    this.sampleSecurityManager.init(null);
-    verifySecurityManagerState();
-  }
-
-  @Test
-  public void shouldDefaultToSecurityJsonInClasspathIfEmptyProperties() throws Exception {
-    this.sampleSecurityManager.init(new Properties());
-    verifySecurityManagerState();
-  }
-
-  @Test
-  public void shouldInitializeFromJsonResource() throws Exception {
-    this.sampleSecurityManager.initializeFromJsonResource(this.jsonResource);
-    verifySecurityManagerState();
-  }
-
-  @Test
-  public void initShouldUsePropertyAsJsonResource() throws Exception {
-    Properties securityProperties = new Properties();
-    securityProperties.setProperty(TestSecurityManager.SECURITY_JSON, this.jsonResource);
-    this.sampleSecurityManager.init(securityProperties);
-    verifySecurityManagerState();
-  }
-
-  private void verifySecurityManagerState() {
-    User adminUser = this.sampleSecurityManager.getUser("admin");
-    assertThat(adminUser).isNotNull();
-    assertThat(adminUser.name).isEqualTo("admin");
-    assertThat(adminUser.password).isEqualTo("secret");
-    assertThat(adminUser.roles).hasSize(1);
-
-    User guestUser = this.sampleSecurityManager.getUser("guest");
-    assertThat(guestUser).isNotNull();
-    assertThat(guestUser.name).isEqualTo("guest");
-    assertThat(guestUser.password).isEqualTo("guest");
-    assertThat(guestUser.roles).hasSize(1);
-    // TODO: need to do more verification
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/ca211b78/geode-core/src/test/java/org/apache/geode/security/TestSecurityManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/TestSecurityManager.java b/geode-core/src/test/java/org/apache/geode/security/TestSecurityManager.java
index 3fbd96a..6080b5d 100644
--- a/geode-core/src/test/java/org/apache/geode/security/TestSecurityManager.java
+++ b/geode-core/src/test/java/org/apache/geode/security/TestSecurityManager.java
@@ -42,7 +42,7 @@ import java.util.stream.StreamSupport;
  * A Geode member must be configured with the following:
  *
  * <p>
- * {@code security-manager = org.apache.geode.security.examples.SampleSecurityManager}
+ * {@code security-manager = org.apache.geode.security.examples.TestSecurityManager}
  *
  * <p>
  * The class can be initialized with from a JSON resource called {@code security.json}. This file
@@ -125,9 +125,8 @@ public class TestSecurityManager implements SecurityManager {
     }
 
     if (!initializeFromJsonResource(jsonPropertyValue)) {
-      throw new AuthenticationFailedException(
-          "SampleSecurityManager: unable to find json resource \"" + jsonPropertyValue
-              + "\" as specified by [" + SECURITY_JSON + "].");
+      throw new AuthenticationFailedException("TestSecurityManager: unable to find json resource \""
+          + jsonPropertyValue + "\" as specified by [" + SECURITY_JSON + "].");
     }
   }
 
@@ -138,11 +137,11 @@ public class TestSecurityManager implements SecurityManager {
 
     User userObj = this.userNameToUser.get(user);
     if (userObj == null) {
-      throw new AuthenticationFailedException("SampleSecurityManager: wrong username/password");
+      throw new AuthenticationFailedException("TestSecurityManager: wrong username/password");
     }
 
     if (user != null && !userObj.password.equals(password) && !"".equals(user)) {
-      throw new AuthenticationFailedException("SampleSecurityManager: wrong username/password");
+      throw new AuthenticationFailedException("TestSecurityManager: wrong username/password");
     }
 
     return user;


[13/25] geode git commit: GEODE-2167: fix BundledJarsJUnitTest.verifyBundledJarsHaveNotChanged on Windows

Posted by km...@apache.org.
GEODE-2167: fix BundledJarsJUnitTest.verifyBundledJarsHaveNotChanged on Windows

expectedJarFile path should be set on Windows properly.

* reworded commit message [klund]
* this closes #308 [klund]


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/31ee3388
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/31ee3388
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/31ee3388

Branch: refs/heads/feature/GEODE-2231
Commit: 31ee33882d6bf2a15201e1e7bdf9eecda1fdc16b
Parents: ca211b7
Author: Kai Jiang <ji...@gmail.com>
Authored: Fri Dec 9 01:32:11 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 geode-assembly/.gitignore                                   | 1 +
 .../src/test/java/org/apache/geode/util/test/TestUtil.java  | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/31ee3388/geode-assembly/.gitignore
----------------------------------------------------------------------
diff --git a/geode-assembly/.gitignore b/geode-assembly/.gitignore
new file mode 100644
index 0000000..fb03fbe
--- /dev/null
+++ b/geode-assembly/.gitignore
@@ -0,0 +1 @@
+bundled_jars.txt
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/geode/blob/31ee3388/geode-core/src/test/java/org/apache/geode/util/test/TestUtil.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/util/test/TestUtil.java b/geode-core/src/test/java/org/apache/geode/util/test/TestUtil.java
index abc51ef..927008b 100644
--- a/geode-core/src/test/java/org/apache/geode/util/test/TestUtil.java
+++ b/geode-core/src/test/java/org/apache/geode/util/test/TestUtil.java
@@ -19,6 +19,7 @@ import java.io.IOException;
 import java.net.URISyntaxException;
 import java.net.URL;
 
+import org.apache.commons.lang.SystemUtils;
 import org.apache.geode.internal.FileUtil;
 
 public class TestUtil {
@@ -46,11 +47,15 @@ public class TestUtil {
         File tmpFile = File.createTempFile(filename, null);
         tmpFile.deleteOnExit();
         FileUtil.copy(resource, tmpFile);
-        return tmpFile.getAbsolutePath();
+        return compatibleWithWindows(tmpFile.getAbsolutePath());
       }
-      return path;
+      return compatibleWithWindows(path);
     } catch (URISyntaxException | IOException e) {
       throw new RuntimeException("Failed getting path to resource " + name, e);
     }
   }
+
+  private static String compatibleWithWindows(String path) {
+    return SystemUtils.IS_OS_WINDOWS ? path.substring(1) : path;
+  }
 }


[17/25] geode git commit: GEODE-1943: Minor modification to test

Posted by km...@apache.org.
GEODE-1943: Minor modification to test


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a9031bfa
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a9031bfa
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a9031bfa

Branch: refs/heads/feature/GEODE-2231
Commit: a9031bfa9343b66d0713229829e6dc400592c118
Parents: a67e496
Author: Jason Huynh <hu...@gmail.com>
Authored: Mon Dec 19 14:16:59 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../SessionReplicationIntegrationJUnitTest.java     | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/a9031bfa/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java b/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
index 50bc0ad..3bd517c 100644
--- a/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
+++ b/extensions/geode-modules-session/src/test/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
@@ -844,20 +844,16 @@ public class SessionReplicationIntegrationJUnitTest {
     };
 
     tester.setAttribute("callback_1", c_1);
-
     servletHolder.setInitParameter("test.callback", "callback_1");
-
+    String url = tester.createConnector(true);
     tester.start();
-    // ContextManager.getInstance().putContext(
-    // servletHolder.getServlet().getServletConfig().getServletContext());
 
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    WebConversation wc = new WebConversation();
+    WebRequest req = new GetMethodWebRequest(url + "/test/hello");
+    req.setHeaderField("Host", "tester");
 
-    assertEquals("OK", response.getContent());
+    final WebResponse webResponse = wc.getResponse(req);
+    assertEquals("OK", webResponse.getResponseMessage());
   }
 
   /**


[02/25] geode git commit: GEODE-2099: The GfshConnectorRule has been refactored to use awaitility to wait and retry till connection is ready.

Posted by km...@apache.org.
GEODE-2099: The GfshConnectorRule has been refactored to use awaitility to wait and retry till connection is ready.

* remove the flaky category


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/577bda18
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/577bda18
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/577bda18

Branch: refs/heads/feature/GEODE-2231
Commit: 577bda1844e7b4dbb90626ae2fdd539f3c45ac6a
Parents: e8b0388
Author: Jinmei Liao <ji...@pivotal.io>
Authored: Tue Dec 20 14:56:09 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/577bda18/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java
index 2777b15..38f98e7 100644
--- a/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/ConnectToLocatorSSLDUnitTest.java
@@ -98,7 +98,6 @@ public class ConnectToLocatorSSLDUnitTest extends JUnit4DistributedTestCase {
   }
 
   @Test
-  @Category(FlakyTest.class) // GEODE-2099
   public void testConnectToLocatorWithSSLJMX() throws Exception {
     securityProps.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannels.JMX);
     securityProps.setProperty(SSL_KEYSTORE, jks.getCanonicalPath());
@@ -112,7 +111,6 @@ public class ConnectToLocatorSSLDUnitTest extends JUnit4DistributedTestCase {
   }
 
   @Test
-  @Category(FlakyTest.class) // GEODE-2099
   public void testConnectToLocatorWithLegacyClusterSSL() throws Exception {
     securityProps.setProperty(CLUSTER_SSL_ENABLED, "true");
     securityProps.setProperty(CLUSTER_SSL_KEYSTORE, jks.getCanonicalPath());
@@ -125,7 +123,6 @@ public class ConnectToLocatorSSLDUnitTest extends JUnit4DistributedTestCase {
   }
 
   @Test
-  @Category(FlakyTest.class) // GEODE-2099
   public void testConnectToLocatorWithLegacyJMXSSL() throws Exception {
     securityProps.setProperty(JMX_MANAGER_SSL_ENABLED, "true");
     securityProps.setProperty(JMX_MANAGER_SSL_KEYSTORE, jks.getCanonicalPath());


[22/25] geode git commit: Revert "GEODE-2243: Adjust path of spotless formatter"

Posted by km...@apache.org.
Revert "GEODE-2243: Adjust path of spotless formatter"

This reverts commit c1998d7398b837ee1e699bfd1952719443045d71.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/24097a8d
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/24097a8d
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/24097a8d

Branch: refs/heads/feature/GEODE-2231
Commit: 24097a8de481c3c3b09d7b84944d740f932d58f4
Parents: f1846b1
Author: Dan Smith <up...@apache.org>
Authored: Wed Dec 21 17:38:14 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/24097a8d/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index d788250..360310f 100755
--- a/build.gradle
+++ b/build.gradle
@@ -91,7 +91,7 @@ subprojects {
   spotless {
     lineEndings = 'unix';
     java {
-      eclipseFormatFile "${rootProject.projectDir}/../open/etc/eclipse-java-google-style.xml"
+      eclipseFormatFile "${rootProject.projectDir}/etc/eclipse-java-google-style.xml"
     }
   }
 }


[15/25] geode git commit: GEODE-2119: gfsh user and password visible in clear text

Posted by km...@apache.org.
GEODE-2119: gfsh user and password visible in clear text

Made changes to suppress the password from being displayed in the log files and on the console.

* this closes #311 [klund]


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/03f75327
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/03f75327
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/03f75327

Branch: refs/heads/feature/GEODE-2231
Commit: 03f75327fcf2812072f792d1880f2925b4056bc2
Parents: 31ee338
Author: Kevin J. Duling <kd...@pivotal.io>
Authored: Wed Dec 7 13:23:38 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../geode/distributed/AbstractLauncher.java     | 101 ++++++------
 .../java/org/apache/geode/internal/Banner.java  |  37 ++---
 .../geode/internal/util/ArgumentRedactor.java   | 154 +++++++++++++++++++
 .../management/internal/cli/shell/Gfsh.java     |  95 ++++++------
 .../util/ArgumentRedactorJUnitTest.java         | 125 +++++++++++++++
 5 files changed, 399 insertions(+), 113 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/03f75327/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java
index 0e40785..d5626dd 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/AbstractLauncher.java
@@ -15,6 +15,8 @@
 
 package org.apache.geode.distributed;
 
+import static org.apache.geode.distributed.ConfigurationProperties.NAME;
+
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.unsafe.RegisterSignalHandlerSupport;
@@ -28,28 +30,37 @@ import org.apache.geode.internal.lang.StringUtils;
 import org.apache.geode.internal.lang.SystemUtils;
 import org.apache.geode.internal.process.PidUnavailableException;
 import org.apache.geode.internal.process.ProcessUtils;
+import org.apache.geode.internal.util.ArgumentRedactor;
 import org.apache.geode.internal.util.SunAPINotFoundException;
 import org.apache.geode.management.internal.cli.json.GfJsonObject;
 
-import java.io.*;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.net.BindException;
 import java.net.InetAddress;
 import java.net.URL;
 import java.sql.Timestamp;
 import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.FileHandler;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-
 /**
  * The AbstractLauncher class is a base class for implementing various launchers to construct and
  * run different GemFire processes, like Cache Servers, Locators, Managers, HTTP servers and so on.
- * 
+ *
  * @see java.lang.Comparable
  * @see java.lang.Runnable
  * @see org.apache.geode.lang.Identifiable
@@ -85,7 +96,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
   protected final transient AtomicBoolean running = new AtomicBoolean(false);
 
   protected Logger logger = Logger.getLogger(getClass().getName()); // TODO:KIRK: does this need
-                                                                    // log4j2?
+  // log4j2?
 
   public AbstractLauncher() {
     try {
@@ -135,7 +146,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
    * Properties. The property is considered "set" if the String value of the property is not
    * non-null, non-empty and non-blank. Therefore, the Properties may "have" a property with name,
    * but having no value as determined by this method.
-   * 
+   *
    * @param properties the Properties used in determining whether the given property is set.
    * @param propertyName a String indicating the name of the property to check if set.
    * @return a boolean indicating whether the specified property with name has been given a value in
@@ -148,7 +159,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
   /**
    * Loads the GemFire properties at the specified URL.
-   * 
+   *
    * @param url the URL to the gemfire.properties to load.
    * @return a Properties instance populated with the gemfire.properties.
    * @see java.net.URL
@@ -188,7 +199,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
   /**
    * This method attempts to make a best effort determination for whether the Attach API classes are
    * on the classpath.
-   * 
+   *
    * @param t the Throwable being evaluated for missing Attach API classes.
    * @return a boolean indicating whether the Exception or Error condition is a result of the Attach
    *         API missing from the classpath.
@@ -223,7 +234,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
   /**
    * Determines if the Attach API is on the classpath.
-   * 
+   *
    * @return a boolean value indicating if the Attach API is on the classpath.
    */
   boolean isAttachAPIOnClasspath() {
@@ -233,7 +244,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
   /**
    * Determines whether the Locator launcher is in debug mode.
-   * 
+   *
    * @return a boolean to indicate whether the Locator launcher is in debug mode.
    * @see #setDebug(boolean)
    */
@@ -244,7 +255,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
   /**
    * Sets the debug mode of the GemFire launcher class. This mutable property of the launcher
    * enables the user to turn the debug mode on and off programmatically.
-   * 
+   *
    * @param debug a boolean used to enable or disable debug mode.
    * @see #isDebugging()
    */
@@ -254,7 +265,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
   /**
    * Determines whether the Locator referenced by this launcher is running.
-   * 
+   *
    * @return a boolean valued indicating if the referenced Locator is running.
    */
   public boolean isRunning() {
@@ -319,7 +330,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
   /**
    * Gets the name of the log file used to log information about this GemFire service.
-   * 
+   *
    * @return a String value indicating the name of this GemFire service's log file.
    */
   public abstract String getLogFileName();
@@ -328,7 +339,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
    * Gets the name or ID of the member in the GemFire distributed system. This method prefers name
    * if specified, otherwise the ID is returned. If name was not specified to the Builder that
    * created this Launcher and this call is not in-process, then null is returned.
-   * 
+   *
    * @return a String value indicating the member's name if specified, otherwise the member's ID is
    *         returned if this call is made in-process, or finally, null is returned if neither name
    *         name was specified or the call is out-of-process.
@@ -367,21 +378,21 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
   /**
    * Gets the user-specified process ID (PID) of the running GemFire service that AbstractLauncher
    * implementations can use to determine status, or stop the service.
-   * 
+   *
    * @return an Integer value indicating the process ID (PID) of the running GemFire service.
    */
   public abstract Integer getPid();
 
   /**
    * Gets the name of the GemFire service.
-   * 
+   *
    * @return a String indicating the name of the GemFire service.
    */
   public abstract String getServiceName();
 
   /**
    * Gets the working directory pathname in which the process will be run.
-   * 
+   *
    * @return a String value indicating the pathname of the Server's working directory.
    */
   public String getWorkingDirectory() {
@@ -391,7 +402,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
   /**
    * Prints the specified debug message to standard err, replacing any placeholder values with the
    * specified arguments on output, if debugging has been enabled.
-   * 
+   *
    * @param message the String value written to standard err.
    * @param args an Object array containing arguments to replace the placeholder values in the
    *        message.
@@ -412,7 +423,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
   /**
    * Prints the stack trace of the given Throwable to standard err if debugging has been enabled.
-   * 
+   *
    * @param t the Throwable who's stack trace is printed to standard err.
    * @see java.lang.System#err
    * @see #isDebugging()
@@ -427,7 +438,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
   /**
    * Prints the specified informational message to standard err, replacing any placeholder values
    * with the specified arguments on output.
-   * 
+   *
    * @param message the String value written to standard err.
    * @param args an Object array containing arguments to replace the placeholder values in the
    *        message.
@@ -445,7 +456,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
   /**
    * Redirects the standard out and standard err to the configured log file as specified in the
    * GemFire distributed system properties.
-   * 
+   *
    * @param distributedSystem the GemFire model for a distributed system.
    * @throws IOException if the standard out and err redirection was unsuccessful.
    */
@@ -458,7 +469,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
   /**
    * Gets the version of GemFire currently running.
-   * 
+   *
    * @return a String representation of GemFire's version.
    */
   public String version() {
@@ -635,7 +646,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the Java classpath used when launching the GemFire service.
-     * 
+     *
      * @return a String value indicating the Java classpath used when launching the GemFire service.
      * @see java.lang.System#getProperty(String) with 'java.class.path'
      */
@@ -645,7 +656,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the version of GemFire used to launch and run the GemFire service.
-     * 
+     *
      * @return a String indicating the version of GemFire used in the running GemFire service.
      */
     public String getGemFireVersion() {
@@ -654,7 +665,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the version of Java used to launch and run the GemFire service.
-     * 
+     *
      * @return a String indicating the version of the Java runtime used in the running GemFire
      *         service.
      * @see java.lang.System#getProperty(String) with 'java.verson'
@@ -665,7 +676,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the arguments passed to the JVM process that is running the GemFire service.
-     * 
+     *
      * @return a List of String value each representing an argument passed to the JVM of the GemFire
      *         service.
      * @see java.lang.management.RuntimeMXBean#getInputArguments()
@@ -676,7 +687,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets GemFire member's name for the process.
-     * 
+     *
      * @return a String indicating the GemFire member's name for the process.
      */
     public String getMemberName() {
@@ -685,7 +696,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the process ID of the running GemFire service if known, otherwise returns null.
-     * 
+     *
      * @return a integer value indicating the process ID (PID) of the running GemFire service, or
      *         null if the PID cannot be determined.
      */
@@ -695,7 +706,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the location of the GemFire service (usually the host in combination with the port).
-     * 
+     *
      * @return a String indication the location (such as host/port) of the GemFire service.
      */
     public String getServiceLocation() {
@@ -704,14 +715,14 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the name of the GemFire service.
-     * 
+     *
      * @return a String indicating the name of the GemFire service.
      */
     protected abstract String getServiceName();
 
     /**
      * Gets the state of the GemFire service.
-     * 
+     *
      * @return a Status enumerated type representing the state of the GemFire service.
      * @see org.apache.geode.distributed.AbstractLauncher.Status
      */
@@ -721,7 +732,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets description of the the service's current state.
-     * 
+     *
      * @return a String describing the service's current state.
      */
     public String getStatusMessage() {
@@ -730,7 +741,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * The date and time the GemFire service was last in this state.
-     * 
+     *
      * @return a Timestamp signifying the last date and time the GemFire service was in this state.
      * @see java.sql.Timestamp
      */
@@ -741,7 +752,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
     /**
      * Gets the amount of time in milliseconds that the JVM process with the GemFire service has
      * been running.
-     * 
+     *
      * @return a long value indicating the number of milliseconds that the GemFire service JVM has
      *         been running.
      * @see java.lang.management.RuntimeMXBean#getUptime()
@@ -753,7 +764,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
     /**
      * Gets the directory in which the GemFire service is running. This is also the location where
      * all GemFire service files (log files, the PID file, and so on) are written.
-     * 
+     *
      * @return a String value indicating the GemFire service's working (running) directory.
      */
     public String getWorkingDirectory() {
@@ -762,7 +773,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the path of the log file for the process.
-     * 
+     *
      * @return a String value indicating the path of the log file for the process.
      */
     public String getLogFile() {
@@ -771,7 +782,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the host or IP address for the process and its service.
-     * 
+     *
      * @return a String value representing the host or IP address for the process and its service.
      */
     public String getHost() {
@@ -780,7 +791,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the port for the process and its service.
-     * 
+     *
      * @return an Integer value indicating the port for the process and its service.
      */
     public String getPort() {
@@ -789,7 +800,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets a String describing the state of the GemFire service.
-     * 
+     *
      * @return a String describing the state of the GemFire service.
      */
     @Override
@@ -799,14 +810,14 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
           return LocalizedStrings.Launcher_ServiceStatus_STARTING_MESSAGE.toLocalizedString(
               getServiceName(), getWorkingDirectory(), getServiceLocation(), getMemberName(),
               toString(getTimestamp()), toString(getPid()), toString(getGemFireVersion()),
-              toString(getJavaVersion()), getLogFile(), toString(getJvmArguments().toArray()),
+              toString(getJavaVersion()), getLogFile(), ArgumentRedactor.redact(getJvmArguments()),
               toString(getClasspath()));
         case ONLINE:
           return LocalizedStrings.Launcher_ServiceStatus_RUNNING_MESSAGE.toLocalizedString(
               getServiceName(), getWorkingDirectory(), getServiceLocation(), getMemberName(),
               getStatus(), toString(getPid()), toDaysHoursMinutesSeconds(getUptime()),
               toString(getGemFireVersion()), toString(getJavaVersion()), getLogFile(),
-              toString(getJvmArguments().toArray()), toString(getClasspath()));
+              ArgumentRedactor.redact(getJvmArguments()), toString(getClasspath()));
         case STOPPED:
           return LocalizedStrings.Launcher_ServiceStatus_STOPPED_MESSAGE
               .toLocalizedString(getServiceName(), getWorkingDirectory(), getServiceLocation());
@@ -856,7 +867,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Looks up the Status enum type by description. The lookup operation is case-insensitive.
-     * 
+     *
      * @param description a String value describing the Locator's status.
      * @return a Status enumerated type matching the description.
      */
@@ -872,7 +883,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets the description of the Status enum type.
-     * 
+     *
      * @return a String describing the Status enum type.
      */
     public String getDescription() {
@@ -881,7 +892,7 @@ public abstract class AbstractLauncher<T extends Comparable<T>> implements Runna
 
     /**
      * Gets a String representation of the Status enum type.
-     * 
+     *
      * @return a String representing the Status enum type.
      * @see #getDescription()
      */

http://git-wip-us.apache.org/repos/asf/geode/blob/03f75327/geode-core/src/main/java/org/apache/geode/internal/Banner.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/Banner.java b/geode-core/src/main/java/org/apache/geode/internal/Banner.java
index 5ad70b8..b6a89bf 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/Banner.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/Banner.java
@@ -18,12 +18,20 @@ import org.apache.geode.SystemFailure;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.DistributionConfigImpl;
 import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.util.ArgumentRedactor;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.StringTokenizer;
+import java.util.TreeMap;
 
 /**
  * Utility class to print banner information at manager startup.
@@ -45,10 +53,10 @@ public class Banner {
 
   /**
    * Print information about this process to the specified stream.
-   * 
+   *
    * @param args possibly null list of command line arguments
    */
-  private static void print(PrintWriter out, String args[]) {
+  static void print(PrintWriter out, String args[]) {
     Map sp = new TreeMap((Properties) System.getProperties().clone()); // fix for 46822
     int processId = -1;
     final String SEPERATOR =
@@ -105,7 +113,7 @@ public class Banner {
     sp.remove("user.dir");
     out.println("Home dir: " + sp.get("user.home"));
     sp.remove("user.home");
-    List<String> allArgs = new ArrayList<String>();
+    List<String> allArgs = new ArrayList<>();
     {
       RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();
       if (runtimeBean != null) {
@@ -114,16 +122,15 @@ public class Banner {
     }
 
     if (args != null && args.length != 0) {
-      for (int i = 0; i < args.length; i++) {
-        allArgs.add(args[i]);
-      }
+      Collections.addAll(allArgs, args);
     }
     if (!allArgs.isEmpty()) {
       out.println("Command Line Parameters:");
       for (String arg : allArgs) {
-        out.println("  " + arg);
+        out.println("  " + ArgumentRedactor.redact(arg));
       }
     }
+
     out.println("Class Path:");
     prettyPrintPath((String) sp.get("java.class.path"), out);
     sp.remove("java.class.path");
@@ -139,17 +146,7 @@ public class Banner {
       while (it.hasNext()) {
         Map.Entry me = (Map.Entry) it.next();
         String key = me.getKey().toString();
-        // SW: Filter out the security properties since they may contain
-        // sensitive information.
-        if (!key
-            .startsWith(DistributionConfig.GEMFIRE_PREFIX + DistributionConfig.SECURITY_PREFIX_NAME)
-            && !key.startsWith(DistributionConfigImpl.SECURITY_SYSTEM_PREFIX
-                + DistributionConfig.SECURITY_PREFIX_NAME)
-            && !key.toLowerCase().contains("password") /* bug 45381 */) {
-          out.println("    " + key + " = " + me.getValue());
-        } else {
-          out.println("    " + key + " = " + "********");
-        }
+        out.println("    " + key + " = " + ArgumentRedactor.redact(String.valueOf(me.getValue())));
       }
       out.println("Log4J 2 Configuration:");
       out.println("    " + LogService.getConfigInformation());
@@ -159,7 +156,7 @@ public class Banner {
 
   /**
    * Return a string containing the banner information.
-   * 
+   *
    * @param args possibly null list of command line arguments
    */
   public static String getString(String args[]) {

http://git-wip-us.apache.org/repos/asf/geode/blob/03f75327/geode-core/src/main/java/org/apache/geode/internal/util/ArgumentRedactor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/util/ArgumentRedactor.java b/geode-core/src/main/java/org/apache/geode/internal/util/ArgumentRedactor.java
new file mode 100644
index 0000000..419f3f9
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/internal/util/ArgumentRedactor.java
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.util;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+public class ArgumentRedactor {
+
+  private ArgumentRedactor() {}
+
+  public static String redact(final List<String> args) {
+    StringBuilder redacted = new StringBuilder();
+    for (String arg : args) {
+      redacted.append(redact(arg)).append(" ");
+    }
+    return redacted.toString().trim();
+  }
+
+  /**
+   * Accept a map of key/value pairs and produce a printable string, redacting any necessary values.
+   * 
+   * @param map A {@link Map} of key/value pairs such as a collection of properties
+   *
+   * @return A printable string with redacted fields. E.g., "username=jdoe password=********"
+   */
+  public static String redact(final Map<String, String> map) {
+    StringBuilder redacted = new StringBuilder();
+    for (Entry<String, String> entry : map.entrySet()) {
+      redacted.append(entry.getKey());
+      redacted.append("=");
+      redacted.append(redact(entry));
+      redacted.append(" ");
+    }
+    return redacted.toString().trim();
+  }
+
+  /**
+   * Returns the redacted value of the {@link Entry} if the key indicates redaction is necessary.
+   * Otherwise, value is returned, unchanged.
+   * 
+   * @param entry A key/value pair
+   *
+   * @return The redacted string for value.
+   */
+  public static String redact(Entry<String, String> entry) {
+    return redact(entry.getKey(), entry.getValue());
+  }
+
+  /**
+   * Parse a string to find key=value pairs and redact the values if necessary. If more than one
+   * key=value pair exists in the input, each pair must be preceeded by a hyphen '-' to delineate
+   * the pairs. <br>
+   * Example:<br>
+   * Single value: "password=secret" or "--password=secret" Mulitple values: "-Dflag -Dkey=value
+   * --classpath=."
+   * 
+   * @param line The input to be parsed
+   * @return A redacted string that has sensitive information obscured.
+   */
+  public static String redact(String line) {
+    StringBuilder redacted = new StringBuilder();
+    if (line.startsWith("-")) {
+      line = " " + line;
+      String[] args = line.split(" -");
+      StringBuilder param = new StringBuilder();
+      for (String arg : args) {
+        if (arg.isEmpty()) {
+          param.append("-");
+        } else {
+          String[] pair = arg.split("=", 2);
+          param.append(pair[0].trim());
+          if (pair.length == 1) {
+            redacted.append(param);
+          } else {
+            redacted.append(param).append("=").append(redact(param.toString(), pair[1].trim()));
+          }
+          redacted.append(" ");
+        }
+        param.setLength(0);
+        param.append("-");
+      }
+    } else {
+      String[] args = line.split("=", 2);
+      if (args.length == 1) {
+        redacted.append(line);
+      } else {
+        redacted.append(args[0].trim()).append("=").append(redact(args[0], args[1]));
+      }
+      redacted.append(" ");
+    }
+    return redacted.toString().trim();
+  }
+
+  /**
+   * Return a redacted value if the key indicates redaction is necessary. Otherwise, return the
+   * value unchanged.
+   *
+   * @param key A string such as a system property, jvm parameter or similar in a key=value
+   *        situation.
+   * @param value A string that is the value assigned to the key.
+   *
+   * @return A redacted string if the key indicates it should be redacted, otherwise the string is
+   *         unchanged.
+   */
+  public static String redact(String key, String value) {
+    if (shouldBeRedacted(key)) {
+      return "********";
+    }
+    return value.trim();
+  }
+
+  /**
+   * Determine whether a key's value should be redacted.
+   * 
+   * @param key The key in question.
+   *
+   * @return true if the value should be redacted, otherwise false.
+   */
+  private static boolean shouldBeRedacted(String key) {
+    if (key == null) {
+      return false;
+    }
+
+    // Clean off any flags such as -J and -D to get to the actual start of the parameter
+    String compareKey = key;
+    if (key.startsWith("-J")) {
+      compareKey = key.substring(2);
+    }
+    if (compareKey.startsWith("-D")) {
+      compareKey = compareKey.substring(2);
+    }
+    return compareKey.toLowerCase().contains("password");
+    // return compareKey
+    // .startsWith(DistributionConfig.GEMFIRE_PREFIX + DistributionConfig.SECURITY_PREFIX_NAME)
+    // || compareKey.startsWith(
+    // DistributionConfigImpl.SECURITY_SYSTEM_PREFIX + DistributionConfig.SECURITY_PREFIX_NAME)
+    // || compareKey.toLowerCase().contains("password");
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/03f75327/geode-core/src/main/java/org/apache/geode/management/internal/cli/shell/Gfsh.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/shell/Gfsh.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/shell/Gfsh.java
index cc5882a..bcf1b41 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/shell/Gfsh.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/shell/Gfsh.java
@@ -14,42 +14,13 @@
  */
 package org.apache.geode.management.internal.cli.shell;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.logging.Level;
-import java.util.logging.LogManager;
-import java.util.logging.Logger;
-
 import jline.Terminal;
 import jline.console.ConsoleReader;
-import org.springframework.shell.core.AbstractShell;
-import org.springframework.shell.core.CommandMarker;
-import org.springframework.shell.core.Converter;
-import org.springframework.shell.core.ExecutionStrategy;
-import org.springframework.shell.core.ExitShellRequest;
-import org.springframework.shell.core.JLineLogHandler;
-import org.springframework.shell.core.JLineShell;
-import org.springframework.shell.core.Parser;
-import org.springframework.shell.event.ShellStatus.Status;
-
 import org.apache.geode.internal.Banner;
 import org.apache.geode.internal.GemFireVersion;
 import org.apache.geode.internal.lang.ClassUtils;
 import org.apache.geode.internal.process.signal.AbstractSignalNotificationHandler;
+import org.apache.geode.internal.util.ArgumentRedactor;
 import org.apache.geode.internal.util.HostName;
 import org.apache.geode.internal.util.SunAPINotFoundException;
 import org.apache.geode.management.cli.CommandProcessingException;
@@ -70,6 +41,35 @@ import org.apache.geode.management.internal.cli.shell.jline.GfshHistory;
 import org.apache.geode.management.internal.cli.shell.jline.GfshUnsupportedTerminal;
 import org.apache.geode.management.internal.cli.shell.unsafe.GfshSignalHandler;
 import org.apache.geode.management.internal.cli.util.CommentSkipHelper;
+import org.springframework.shell.core.AbstractShell;
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.Converter;
+import org.springframework.shell.core.ExecutionStrategy;
+import org.springframework.shell.core.ExitShellRequest;
+import org.springframework.shell.core.JLineLogHandler;
+import org.springframework.shell.core.JLineShell;
+import org.springframework.shell.core.Parser;
+import org.springframework.shell.event.ShellStatus.Status;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Scanner;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
 
 /**
  * Extends an interactive shell provided by
@@ -84,7 +84,7 @@ import org.apache.geode.management.internal.cli.util.CommentSkipHelper;
  * <p />
  * Additionally, this class is used to maintain GemFire SHell (gfsh) specific information like:
  * environment TODO
- *
+ * 
  *
  * @since GemFire 7.0
  */
@@ -180,7 +180,7 @@ public class Gfsh extends JLineShell {
 
   /**
    * Create a GemFire shell with console using the specified arguments.
-   *
+   * 
    * @param args arguments to be used to create a GemFire shell instance
    * @throws IOException
    * @throws ClassNotFoundException
@@ -192,7 +192,7 @@ public class Gfsh extends JLineShell {
   /**
    * Create a GemFire shell using the specified arguments. Console for user inputs is made available
    * if <code>launchShell</code> is set to <code>true</code>.
-   *
+   * 
    * @param launchShell whether to make Console available
    * @param args arguments to be used to create a GemFire shell instance or execute command
    * @throws IOException
@@ -208,10 +208,10 @@ public class Gfsh extends JLineShell {
     this.gfshFileLogger = LogWrapper.getInstance();
     this.gfshFileLogger.configure(this.gfshConfig);
     this.ansiHandler = ANSIHandler.getInstance(this.gfshConfig.isANSISupported()); // TODO -
-                                                                                   // Abhishek :
-                                                                                   // should take it
-                                                                                   // from
-                                                                                   // ConsoleReader.terminal??
+    // Abhishek :
+    // should take it
+    // from
+    // ConsoleReader.terminal??
 
     /* 3. log system properties & gfsh environment */
     this.gfshFileLogger.info(Banner.getString(args));
@@ -397,7 +397,7 @@ public class Gfsh extends JLineShell {
   /**
    * Returns the {@link ExecutionStrategy} implementation used by this implementation of
    * {@link AbstractShell}. {@link Gfsh} uses {@link GfshExecutionStrategy}.
-   *
+   * 
    * @return ExecutionStrategy used by Gfsh
    */
   @Override
@@ -408,7 +408,7 @@ public class Gfsh extends JLineShell {
   /**
    * Returns the {@link Parser} implementation used by this implementation of
    * {@link AbstractShell}.{@link Gfsh} uses {@link GfshParser}.
-   *
+   * 
    * @return Parser used by Gfsh
    */
   @Override
@@ -420,7 +420,7 @@ public class Gfsh extends JLineShell {
   /**
    * Executes the given command string. We have over-ridden the behavior to extend the original
    * implementation to store the 'last command execution status'.
-   *
+   * 
    * @param line command string to be executed
    * @return true if execution is successful; false otherwise
    */
@@ -684,7 +684,7 @@ public class Gfsh extends JLineShell {
 
   /**
    * Set the last command execution status
-   *
+   * 
    * @param lastExecutionStatus last command execution status
    */
   public void setLastExecutionStatus(int lastExecutionStatus) {
@@ -782,7 +782,7 @@ public class Gfsh extends JLineShell {
         String lineRead = "";
         StringBuilder linesBuffer = new StringBuilder();
         String linesBufferString = ""; // used to check whether the string in a buffer contains a
-                                       // ";".
+        // ";".
         int commandSrNum = 0;
         CommentSkipHelper commentSkipper = new CommentSkipHelper();
 
@@ -804,13 +804,12 @@ public class Gfsh extends JLineShell {
           if (!linesBufferString.endsWith(SyntaxConstants.CONTINUATION_CHARACTER)) { // see 45893
             // String command = null;
 
-
             List<String> commandList = MultiCommandHelper.getMultipleCommands(linesBufferString);
             for (String cmdLet : commandList) {
-              String trimmedCommand = cmdLet.trim();
-              if (!trimmedCommand.isEmpty()) {
+              if (!cmdLet.isEmpty()) {
+                String redactedCmdLet = ArgumentRedactor.redact(cmdLet);
                 ++commandSrNum;
-                Gfsh.println(commandSrNum + ". Executing - " + cmdLet);
+                Gfsh.println(commandSrNum + ". Executing - " + redactedCmdLet);
                 Gfsh.println();
                 boolean executeSuccess = executeScriptLine(cmdLet);
                 if (!executeSuccess) {
@@ -1138,14 +1137,14 @@ public class Gfsh extends JLineShell {
    *
    * For example: if the terminal width were 5 and the string "123 456789 01234" were passed in with
    * an indentation level of 2, then the returned string would be:
-   * 
+   *
    * <pre>
    *         123
    *         45678
    *         9
    *         01234
    * </pre>
-   * 
+   *
    * @param string String to wrap (add breakpoints and indent)
    * @param indentationLevel The number of indentation levels to use.
    * @return The wrapped string.

http://git-wip-us.apache.org/repos/asf/geode/blob/03f75327/geode-core/src/test/java/org/apache/geode/internal/util/ArgumentRedactorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/util/ArgumentRedactorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/util/ArgumentRedactorJUnitTest.java
new file mode 100644
index 0000000..b40d485
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/internal/util/ArgumentRedactorJUnitTest.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.internal.util;
+
+import static org.apache.geode.internal.util.ArgumentRedactor.redact;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.apache.geode.test.junit.categories.UnitTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * ArgumentRedactor Tester.
+ */
+@Category(UnitTest.class)
+public class ArgumentRedactorJUnitTest {
+  @Test
+  public void testRedactArgList() throws Exception {
+    List<String> argList = new ArrayList<>();
+    argList.add("gemfire.security-password=secret");
+    argList.add("gemfire.security-properties=./security.properties");
+    argList.add("gemfire.sys.security-value=someValue");
+    argList.add("gemfire.use-cluster-configuration=true");
+    argList.add("someotherstringvalue");
+    argList.add("login-password=secret");
+    argList.add("login-name=admin");
+    argList.add("gemfire-password = super-secret");
+    argList.add("geode-password= confidential");
+    argList.add("some-other-password =shhhh");
+    String redacted = redact(argList);
+    assertTrue(redacted.contains("gemfire.security-password=********"));
+    assertTrue(redacted.contains("gemfire.security-properties=./security.properties"));
+    assertTrue(redacted.contains("gemfire.sys.security-value=someValue"));
+    assertTrue(redacted.contains("gemfire.use-cluster-configuration=true"));
+    assertTrue(redacted.contains("someotherstringvalue"));
+    assertTrue(redacted.contains("login-password=********"));
+    assertTrue(redacted.contains("login-name=admin"));
+    assertTrue(redacted.contains("gemfire-password=********"));
+    assertTrue(redacted.contains("geode-password=********"));
+    assertTrue(redacted.contains("some-other-password=********"));
+  }
+
+  @Test
+  public void testRedactMap() throws Exception {
+    Map<String, String> argMap = new HashMap<>();
+    argMap.put("gemfire.security-password", "secret");
+    argMap.put("gemfire.security-properties", "./security.properties");
+    argMap.put("gemfire.sys.security-value", "someValue");
+    argMap.put("gemfire.use-cluster-configuration", "true");
+    argMap.put("login-password", "secret");
+    argMap.put("login-name", "admin");
+    String redacted = redact(argMap);
+    assertTrue(redacted.contains("gemfire.security-password=********"));
+    assertTrue(redacted.contains("gemfire.security-properties=./security.properties"));
+    assertTrue(redacted.contains("gemfire.sys.security-value=someValue"));
+    assertTrue(redacted.contains("gemfire.use-cluster-configuration=true"));
+    assertTrue(redacted.contains("login-password=********"));
+    assertTrue(redacted.contains("login-name=admin"));
+  }
+
+  @Test
+  public void testRedactArg() throws Exception {
+    String arg = "-Dgemfire.security-password=secret";
+    assertTrue(redact(arg).endsWith("password=********"));
+
+    arg = "-Dgemfire.security-properties=./security-properties";
+    assertEquals(arg, (redact(arg)));
+
+    arg = "-J-Dgemfire.sys.security-value=someValue";
+    assertEquals(arg, (redact(arg)));
+
+    arg = "-Dgemfire.sys.value=printable";
+    assertEquals(arg, redact(arg));
+
+    arg = "-Dgemfire.use-cluster-configuration=true";
+    assertEquals(arg, redact(arg));
+
+    arg = "someotherstringvalue";
+    assertEquals(arg, redact(arg));
+
+    arg = "--password=foo";
+    assertEquals("--password=********", redact(arg));
+
+    arg = "--classpath=.";
+    assertEquals(arg, redact(arg));
+
+    arg = "-DmyArg -Duser-password=foo --classpath=.";
+    assertEquals("-DmyArg -Duser-password=******** --classpath=.", redact(arg));
+
+    arg = "-DmyArg -Duser-password=foo -DOtherArg -Dsystem-password=bar";
+    assertEquals("-DmyArg -Duser-password=******** -DOtherArg -Dsystem-password=********",
+        redact(arg));
+
+    arg =
+        "-Dlogin-password=secret -Dlogin-name=admin -Dgemfire-password = super-secret --geode-password= confidential -J-Dsome-other-password =shhhh";
+    String redacted = redact(arg);
+    assertTrue(redacted.contains("login-password=********"));
+    assertTrue(redacted.contains("login-name=admin"));
+    assertTrue(redacted.contains("gemfire-password=********"));
+    assertTrue(redacted.contains("geode-password=********"));
+    assertTrue(redacted.contains("some-other-password=********"));
+
+    arg = "-Dgemfire.security-properties=\"c:\\Program Files (x86)\\My Folder\"";
+    assertEquals(arg, (redact(arg)));
+  }
+}


[18/25] geode git commit: GEODE-2215: GatewaySenderAdvisor checks the current processor to see if it has started

Posted by km...@apache.org.
GEODE-2215: GatewaySenderAdvisor checks the current processor to see if it has started

  * Previously it was checking the top level sender (possibly a concurrent sendor)
  * This allowed a race condition where the top level sender was still starting up
  * but the individual processors were ready to process.  They would check the flag
  * and because the sender was not ready, the processors would act and start initiating
  * failover, which left the processor in a very weird state


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/0b011171
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/0b011171
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/0b011171

Branch: refs/heads/feature/GEODE-2231
Commit: 0b0111710fc92406e46e495d6724dd46a25ef402
Parents: a9031bf
Author: Jason Huynh <hu...@gmail.com>
Authored: Fri Dec 9 15:28:23 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../apache/geode/internal/cache/wan/GatewaySenderAdvisor.java   | 5 +++--
 .../cache/wan/serial/SerialGatewaySenderEventProcessor.java     | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/0b011171/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
index ace780e..baa9d9c 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderAdvisor.java
@@ -475,7 +475,8 @@ public class GatewaySenderAdvisor extends DistributionAdvisor {
     this.lockObtainingThread.start();
   }
 
-  public void waitToBecomePrimary() throws InterruptedException {
+  public void waitToBecomePrimary(AbstractGatewaySenderEventProcessor callingProcessor)
+      throws InterruptedException {
     if (isPrimary()) {
       return;
     }
@@ -484,7 +485,7 @@ public class GatewaySenderAdvisor extends DistributionAdvisor {
           LocalizedStrings.GatewayImpl_0__WAITING_TO_BECOME_PRIMARY_GATEWAY, this.sender.getId()));
       while (!isPrimary()) {
         this.primaryLock.wait(1000);
-        if (sender.getEventProcessor() != null && sender.getEventProcessor().isStopped()) {
+        if (sender.getEventProcessor() != null && callingProcessor.isStopped()) {
           logger.info("The event processor is stopped, not to wait for being primary any more.");
           return;
         }

http://git-wip-us.apache.org/repos/asf/geode/blob/0b011171/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
index 9755adb..0aa0ed9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderEventProcessor.java
@@ -143,7 +143,7 @@ public class SerialGatewaySenderEventProcessor extends AbstractGatewaySenderEven
   protected boolean waitForPrimary() {
 
     try {
-      this.sender.getSenderAdvisor().waitToBecomePrimary();
+      this.sender.getSenderAdvisor().waitToBecomePrimary(this);
     } catch (InterruptedException e) {
       // No need to set the interrupt bit, we're exiting the thread.
       if (!stopped()) {


[04/25] geode git commit: GEODE-165: Removed OQL generated files and added the target into geode-core/build.gradle.

Posted by km...@apache.org.
http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLParser.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLParser.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLParser.java
deleted file mode 100644
index 6cba302..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLParser.java
+++ /dev/null
@@ -1,3650 +0,0 @@
-// $ANTLR 2.7.4: "oql.g" -> "OQLParser.java"$
-
-package org.apache.geode.cache.query.internal.parse;
-
-import java.util.*;
-import org.apache.geode.cache.query.internal.types.*;
-
-import antlr.TokenBuffer;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.ANTLRException;
-import antlr.LLkParser;
-import antlr.Token;
-import antlr.TokenStream;
-import antlr.RecognitionException;
-import antlr.NoViableAltException;
-import antlr.MismatchedTokenException;
-import antlr.SemanticException;
-import antlr.ParserSharedInputState;
-import antlr.collections.impl.BitSet;
-import antlr.collections.AST;
-import java.util.Hashtable;
-import antlr.ASTFactory;
-import antlr.ASTPair;
-import antlr.collections.impl.ASTArray;
-
-/***************************** OQL PARSER *************************************/
-public class OQLParser extends org.apache.geode.cache.query.internal.parse.UtilParser
-    implements OQLLexerTokenTypes {
-
-  protected OQLParser(TokenBuffer tokenBuf, int k) {
-    super(tokenBuf, k);
-    tokenNames = _tokenNames;
-    buildTokenTypeASTClassMap();
-    astFactory = new ASTFactory(getTokenTypeToASTClassMap());
-  }
-
-  public OQLParser(TokenBuffer tokenBuf) {
-    this(tokenBuf, 2);
-  }
-
-  protected OQLParser(TokenStream lexer, int k) {
-    super(lexer, k);
-    tokenNames = _tokenNames;
-    buildTokenTypeASTClassMap();
-    astFactory = new ASTFactory(getTokenTypeToASTClassMap());
-  }
-
-  public OQLParser(TokenStream lexer) {
-    this(lexer, 2);
-  }
-
-  public OQLParser(ParserSharedInputState state) {
-    super(state, 2);
-    tokenNames = _tokenNames;
-    buildTokenTypeASTClassMap();
-    astFactory = new ASTFactory(getTokenTypeToASTClassMap());
-  }
-
-  public final void queryProgram() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST queryProgram_AST = null;
-
-    {
-      if ((LA(1) == TOK_LT) && (LA(2) == LITERAL_trace)) {
-        traceCommand();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    {
-      if ((_tokenSet_2.member(LA(1)))) {
-        {
-          declaration();
-          astFactory.addASTChild(currentAST, returnAST);
-          {
-            _loop107: do {
-              if ((LA(1) == TOK_SEMIC) && (_tokenSet_2.member(LA(2)))) {
-                match(TOK_SEMIC);
-                declaration();
-                astFactory.addASTChild(currentAST, returnAST);
-              } else {
-                break _loop107;
-              }
-
-            } while (true);
-          }
-          {
-            match(TOK_SEMIC);
-            query();
-            astFactory.addASTChild(currentAST, returnAST);
-          }
-        }
-        {
-          if ((LA(1) == TOK_SEMIC)) {
-            match(TOK_SEMIC);
-          } else if ((LA(1) == EOF)) {
-          } else {
-            throw new NoViableAltException(LT(1), getFilename());
-          }
-
-        }
-      } else if ((_tokenSet_3.member(LA(1)))) {
-        query();
-        astFactory.addASTChild(currentAST, returnAST);
-        {
-          if ((LA(1) == TOK_SEMIC)) {
-            match(TOK_SEMIC);
-          } else if ((LA(1) == EOF)) {
-          } else {
-            throw new NoViableAltException(LT(1), getFilename());
-          }
-
-        }
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    match(Token.EOF_TYPE);
-    if (inputState.guessing == 0) {
-      queryProgram_AST = (AST) currentAST.root;
-      queryProgram_AST =
-          (AST) astFactory
-              .make((new ASTArray(2))
-                  .add((AST) astFactory.create(QUERY_PROGRAM, "queryProgram",
-                      "org.apache.geode.cache.query.internal.parse.GemFireAST"))
-                  .add(queryProgram_AST));
-      currentAST.root = queryProgram_AST;
-      currentAST.child = queryProgram_AST != null && queryProgram_AST.getFirstChild() != null
-          ? queryProgram_AST.getFirstChild() : queryProgram_AST;
-      currentAST.advanceChildToEnd();
-    }
-    queryProgram_AST = (AST) currentAST.root;
-    returnAST = queryProgram_AST;
-  }
-
-  public final void traceCommand() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST traceCommand_AST = null;
-
-    {
-      match(TOK_LT);
-      org.apache.geode.cache.query.internal.parse.ASTTrace tmp7_AST = null;
-      tmp7_AST = (org.apache.geode.cache.query.internal.parse.ASTTrace) astFactory.create(LT(1),
-          "org.apache.geode.cache.query.internal.parse.ASTTrace");
-      astFactory.makeASTRoot(currentAST, tmp7_AST);
-      match(LITERAL_trace);
-      match(TOK_GT);
-    }
-    traceCommand_AST = (AST) currentAST.root;
-    returnAST = traceCommand_AST;
-  }
-
-  public final void declaration() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST declaration_AST = null;
-
-    switch (LA(1)) {
-      case LITERAL_define: {
-        defineQuery();
-        astFactory.addASTChild(currentAST, returnAST);
-        declaration_AST = (AST) currentAST.root;
-        break;
-      }
-      case LITERAL_import: {
-        importQuery();
-        astFactory.addASTChild(currentAST, returnAST);
-        declaration_AST = (AST) currentAST.root;
-        break;
-      }
-      case LITERAL_undefine: {
-        undefineQuery();
-        astFactory.addASTChild(currentAST, returnAST);
-        declaration_AST = (AST) currentAST.root;
-        break;
-      }
-      case LITERAL_declare: {
-        paramTypeDecl();
-        astFactory.addASTChild(currentAST, returnAST);
-        declaration_AST = (AST) currentAST.root;
-        break;
-      }
-      default: {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-    }
-    returnAST = declaration_AST;
-  }
-
-  public final void query() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST query_AST = null;
-
-    {
-      if ((LA(1) == TOK_LT || LA(1) == LITERAL_select)) {
-        selectExpr();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((_tokenSet_4.member(LA(1)))) {
-        expr();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    query_AST = (AST) currentAST.root;
-    returnAST = query_AST;
-  }
-
-  public final void loneFromClause() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST loneFromClause_AST = null;
-
-    iteratorDef();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop115: do {
-        if ((LA(1) == TOK_COMMA)) {
-          match(TOK_COMMA);
-          iteratorDef();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop115;
-        }
-
-      } while (true);
-    }
-    match(Token.EOF_TYPE);
-    if (inputState.guessing == 0) {
-      loneFromClause_AST = (AST) currentAST.root;
-      loneFromClause_AST = (AST) astFactory.make((new ASTArray(2))
-          .add((AST) astFactory.create(LITERAL_from, "from",
-              "org.apache.geode.cache.query.internal.parse.ASTCombination"))
-          .add(loneFromClause_AST));
-      currentAST.root = loneFromClause_AST;
-      currentAST.child = loneFromClause_AST != null && loneFromClause_AST.getFirstChild() != null
-          ? loneFromClause_AST.getFirstChild() : loneFromClause_AST;
-      currentAST.advanceChildToEnd();
-    }
-    loneFromClause_AST = (AST) currentAST.root;
-    returnAST = loneFromClause_AST;
-  }
-
-  public final void iteratorDef() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST iteratorDef_AST = null;
-    AST id1_AST = null;
-    AST ex1_AST = null;
-    AST t1_AST = null;
-    AST ex2_AST = null;
-    AST id2_AST = null;
-    AST t2_AST = null;
-
-    boolean synPredMatched153 = false;
-    if (((LA(1) == QuotedIdentifier || LA(1) == Identifier) && (LA(2) == LITERAL_in))) {
-      int _m153 = mark();
-      synPredMatched153 = true;
-      inputState.guessing++;
-      try {
-        {
-          identifier();
-          match(LITERAL_in);
-        }
-      } catch (RecognitionException pe) {
-        synPredMatched153 = false;
-      }
-      rewind(_m153);
-      inputState.guessing--;
-    }
-    if (synPredMatched153) {
-      identifier();
-      id1_AST = (AST) returnAST;
-      match(LITERAL_in);
-      expr();
-      ex1_AST = (AST) returnAST;
-      {
-        if ((LA(1) == LITERAL_type)) {
-          match(LITERAL_type);
-          type();
-          t1_AST = (AST) returnAST;
-        } else if ((_tokenSet_5.member(LA(1)))) {
-        } else {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-
-      }
-      if (inputState.guessing == 0) {
-        iteratorDef_AST = (AST) currentAST.root;
-        iteratorDef_AST = (AST) astFactory.make((new ASTArray(4))
-            .add((AST) astFactory.create(ITERATOR_DEF, "iterDef",
-                "org.apache.geode.cache.query.internal.parse.ASTIteratorDef"))
-            .add(ex1_AST).add(id1_AST).add(t1_AST));
-        currentAST.root = iteratorDef_AST;
-        currentAST.child = iteratorDef_AST != null && iteratorDef_AST.getFirstChild() != null
-            ? iteratorDef_AST.getFirstChild() : iteratorDef_AST;
-        currentAST.advanceChildToEnd();
-      }
-    } else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_6.member(LA(2)))) {
-      expr();
-      ex2_AST = (AST) returnAST;
-      {
-        if ((LA(1) == QuotedIdentifier || LA(1) == Identifier || LA(1) == LITERAL_as)) {
-          {
-            if ((LA(1) == LITERAL_as)) {
-              match(LITERAL_as);
-            } else if ((LA(1) == QuotedIdentifier || LA(1) == Identifier)) {
-            } else {
-              throw new NoViableAltException(LT(1), getFilename());
-            }
-
-          }
-          identifier();
-          id2_AST = (AST) returnAST;
-        } else if ((_tokenSet_7.member(LA(1)))) {
-        } else {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-
-      }
-      {
-        if ((LA(1) == LITERAL_type)) {
-          match(LITERAL_type);
-          type();
-          t2_AST = (AST) returnAST;
-        } else if ((_tokenSet_5.member(LA(1)))) {
-        } else {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-
-      }
-      if (inputState.guessing == 0) {
-        iteratorDef_AST = (AST) currentAST.root;
-        iteratorDef_AST = (AST) astFactory.make((new ASTArray(4))
-            .add((AST) astFactory.create(ITERATOR_DEF, "iterDef",
-                "org.apache.geode.cache.query.internal.parse.ASTIteratorDef"))
-            .add(ex2_AST).add(id2_AST).add(t2_AST));
-        currentAST.root = iteratorDef_AST;
-        currentAST.child = iteratorDef_AST != null && iteratorDef_AST.getFirstChild() != null
-            ? iteratorDef_AST.getFirstChild() : iteratorDef_AST;
-        currentAST.advanceChildToEnd();
-      }
-    } else {
-      throw new NoViableAltException(LT(1), getFilename());
-    }
-
-    returnAST = iteratorDef_AST;
-  }
-
-  public final void loneProjectionAttributes() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST loneProjectionAttributes_AST = null;
-
-    projectionAttributes();
-    astFactory.addASTChild(currentAST, returnAST);
-    match(Token.EOF_TYPE);
-    loneProjectionAttributes_AST = (AST) currentAST.root;
-    returnAST = loneProjectionAttributes_AST;
-  }
-
-  public final void projectionAttributes() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST projectionAttributes_AST = null;
-
-    {
-      if ((_tokenSet_4.member(LA(1)))) {
-        projection();
-        astFactory.addASTChild(currentAST, returnAST);
-        {
-          _loop164: do {
-            if ((LA(1) == TOK_COMMA)) {
-              match(TOK_COMMA);
-              projection();
-              astFactory.addASTChild(currentAST, returnAST);
-            } else {
-              break _loop164;
-            }
-
-          } while (true);
-        }
-        if (inputState.guessing == 0) {
-          projectionAttributes_AST = (AST) currentAST.root;
-          projectionAttributes_AST = (AST) astFactory.make((new ASTArray(2))
-              .add((AST) astFactory.create(PROJECTION_ATTRS, "projectionAttrs",
-                  "org.apache.geode.cache.query.internal.parse.ASTCombination"))
-              .add(projectionAttributes_AST));
-          currentAST.root = projectionAttributes_AST;
-          currentAST.child =
-              projectionAttributes_AST != null && projectionAttributes_AST.getFirstChild() != null
-                  ? projectionAttributes_AST.getFirstChild() : projectionAttributes_AST;
-          currentAST.advanceChildToEnd();
-        }
-      } else if ((LA(1) == TOK_STAR)) {
-        org.apache.geode.cache.query.internal.parse.ASTDummy tmp17_AST = null;
-        tmp17_AST = (org.apache.geode.cache.query.internal.parse.ASTDummy) astFactory.create(LT(1),
-            "org.apache.geode.cache.query.internal.parse.ASTDummy");
-        astFactory.addASTChild(currentAST, tmp17_AST);
-        match(TOK_STAR);
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    projectionAttributes_AST = (AST) currentAST.root;
-    returnAST = projectionAttributes_AST;
-  }
-
-  public final void defineQuery() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST defineQuery_AST = null;
-
-    AST tmp18_AST = null;
-    tmp18_AST = astFactory.create(LT(1));
-    astFactory.makeASTRoot(currentAST, tmp18_AST);
-    match(LITERAL_define);
-    {
-      if ((LA(1) == LITERAL_query)) {
-        match(LITERAL_query);
-      } else if ((LA(1) == QuotedIdentifier || LA(1) == Identifier)) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    identifier();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      if ((LA(1) == TOK_LPAREN)) {
-        match(TOK_LPAREN);
-        type();
-        astFactory.addASTChild(currentAST, returnAST);
-        identifier();
-        astFactory.addASTChild(currentAST, returnAST);
-        {
-          _loop135: do {
-            if ((LA(1) == TOK_COMMA)) {
-              match(TOK_COMMA);
-              type();
-              astFactory.addASTChild(currentAST, returnAST);
-              identifier();
-              astFactory.addASTChild(currentAST, returnAST);
-            } else {
-              break _loop135;
-            }
-
-          } while (true);
-        }
-        match(TOK_RPAREN);
-      } else if ((LA(1) == LITERAL_as)) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    match(LITERAL_as);
-    query();
-    astFactory.addASTChild(currentAST, returnAST);
-    defineQuery_AST = (AST) currentAST.root;
-    returnAST = defineQuery_AST;
-  }
-
-  public final void importQuery() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST importQuery_AST = null;
-
-    org.apache.geode.cache.query.internal.parse.ASTImport tmp24_AST = null;
-    tmp24_AST = (org.apache.geode.cache.query.internal.parse.ASTImport) astFactory.create(LT(1),
-        "org.apache.geode.cache.query.internal.parse.ASTImport");
-    astFactory.makeASTRoot(currentAST, tmp24_AST);
-    match(LITERAL_import);
-    qualifiedName();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      if ((LA(1) == LITERAL_as)) {
-        AST tmp25_AST = null;
-        tmp25_AST = astFactory.create(LT(1));
-        astFactory.addASTChild(currentAST, tmp25_AST);
-        match(LITERAL_as);
-        identifier();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((LA(1) == EOF || LA(1) == TOK_SEMIC)) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    importQuery_AST = (AST) currentAST.root;
-    returnAST = importQuery_AST;
-  }
-
-  public final void undefineQuery() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST undefineQuery_AST = null;
-
-    AST tmp26_AST = null;
-    tmp26_AST = astFactory.create(LT(1));
-    astFactory.makeASTRoot(currentAST, tmp26_AST);
-    match(LITERAL_undefine);
-    {
-      if ((LA(1) == LITERAL_query)) {
-        match(LITERAL_query);
-      } else if ((LA(1) == QuotedIdentifier || LA(1) == Identifier)) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    identifier();
-    astFactory.addASTChild(currentAST, returnAST);
-    undefineQuery_AST = (AST) currentAST.root;
-    returnAST = undefineQuery_AST;
-  }
-
-  public final void paramTypeDecl() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST paramTypeDecl_AST = null;
-
-    AST tmp28_AST = null;
-    tmp28_AST = astFactory.create(LT(1));
-    astFactory.makeASTRoot(currentAST, tmp28_AST);
-    match(LITERAL_declare);
-    {
-      queryParam();
-      astFactory.addASTChild(currentAST, returnAST);
-    }
-    {
-      _loop127: do {
-        if ((LA(1) == TOK_COMMA)) {
-          match(TOK_COMMA);
-          queryParam();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop127;
-        }
-
-      } while (true);
-    }
-    type();
-    astFactory.addASTChild(currentAST, returnAST);
-    paramTypeDecl_AST = (AST) currentAST.root;
-    returnAST = paramTypeDecl_AST;
-  }
-
-  public final void qualifiedName() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST qualifiedName_AST = null;
-
-    identifier();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop130: do {
-        if ((LA(1) == TOK_DOT)) {
-          match(TOK_DOT);
-          identifier();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop130;
-        }
-
-      } while (true);
-    }
-    qualifiedName_AST = (AST) currentAST.root;
-    returnAST = qualifiedName_AST;
-  }
-
-  public final void identifier() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST identifier_AST = null;
-    Token q = null;
-    org.apache.geode.cache.query.internal.parse.ASTIdentifier q_AST = null;
-
-    if ((LA(1) == Identifier)) {
-      org.apache.geode.cache.query.internal.parse.ASTIdentifier tmp31_AST = null;
-      tmp31_AST = (org.apache.geode.cache.query.internal.parse.ASTIdentifier) astFactory
-          .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTIdentifier");
-      astFactory.addASTChild(currentAST, tmp31_AST);
-      match(Identifier);
-      identifier_AST = (AST) currentAST.root;
-    } else if ((LA(1) == QuotedIdentifier)) {
-      q = LT(1);
-      q_AST = (org.apache.geode.cache.query.internal.parse.ASTIdentifier) astFactory.create(q,
-          "org.apache.geode.cache.query.internal.parse.ASTIdentifier");
-      astFactory.addASTChild(currentAST, q_AST);
-      match(QuotedIdentifier);
-      if (inputState.guessing == 0) {
-        q_AST.setType(Identifier);
-      }
-      identifier_AST = (AST) currentAST.root;
-    } else {
-      throw new NoViableAltException(LT(1), getFilename());
-    }
-
-    returnAST = identifier_AST;
-  }
-
-  public final void loneImports() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST loneImports_AST = null;
-
-    importQuery();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop122: do {
-        if ((LA(1) == TOK_SEMIC) && (LA(2) == LITERAL_import)) {
-          match(TOK_SEMIC);
-          importQuery();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop122;
-        }
-
-      } while (true);
-    }
-    {
-      if ((LA(1) == TOK_SEMIC)) {
-        match(TOK_SEMIC);
-      } else if ((LA(1) == EOF)) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    match(Token.EOF_TYPE);
-    if (inputState.guessing == 0) {
-      loneImports_AST = (AST) currentAST.root;
-      loneImports_AST =
-          (AST) astFactory
-              .make((new ASTArray(2))
-                  .add((AST) astFactory.create(IMPORTS, "imports",
-                      "org.apache.geode.cache.query.internal.parse.GemFireAST"))
-                  .add(loneImports_AST));
-      currentAST.root = loneImports_AST;
-      currentAST.child = loneImports_AST != null && loneImports_AST.getFirstChild() != null
-          ? loneImports_AST.getFirstChild() : loneImports_AST;
-      currentAST.advanceChildToEnd();
-    }
-    loneImports_AST = (AST) currentAST.root;
-    returnAST = loneImports_AST;
-  }
-
-  public final void queryParam() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST queryParam_AST = null;
-
-    AST tmp35_AST = null;
-    tmp35_AST = astFactory.create(LT(1));
-    match(TOK_DOLLAR);
-    AST tmp36_AST = null;
-    tmp36_AST = astFactory.create(LT(1));
-    match(NUM_INT);
-    if (inputState.guessing == 0) {
-      queryParam_AST = (AST) currentAST.root;
-      queryParam_AST =
-          (AST) astFactory
-              .make(
-                  (new ASTArray(2))
-                      .add((AST) astFactory.create(QUERY_PARAM, "queryParam",
-                          "org.apache.geode.cache.query.internal.parse.ASTParameter"))
-                      .add(tmp36_AST));
-      currentAST.root = queryParam_AST;
-      currentAST.child = queryParam_AST != null && queryParam_AST.getFirstChild() != null
-          ? queryParam_AST.getFirstChild() : queryParam_AST;
-      currentAST.advanceChildToEnd();
-    }
-    returnAST = queryParam_AST;
-  }
-
-  public final void type() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST type_AST = null;
-    Token typ00 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ00_AST = null;
-    Token typ01 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ01_AST = null;
-    Token typ02 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ02_AST = null;
-    Token typ03 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ03_AST = null;
-    Token typ04 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ04_AST = null;
-    Token typ05 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ05_AST = null;
-    Token typ06 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ06_AST = null;
-    Token typ07 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ07_AST = null;
-    Token typ08 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ08_AST = null;
-    Token typ09 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ09_AST = null;
-    Token typ10 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ10_AST = null;
-    Token typ11 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ11_AST = null;
-    Token typ12 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ12_AST = null;
-    Token typ13 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ13_AST = null;
-    Token typ14 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ14_AST = null;
-    Token typ15 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ15_AST = null;
-    Token typ16 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ16_AST = null;
-    Token typ17 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ17_AST = null;
-    Token typ18 = null;
-    org.apache.geode.cache.query.internal.parse.ASTType typ18_AST = null;
-    AST id_AST = null;
-
-    {
-      switch (LA(1)) {
-        case LITERAL_short: {
-          typ00 = LT(1);
-          typ00_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ00,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ00_AST);
-          match(LITERAL_short);
-          if (inputState.guessing == 0) {
-            typ00_AST.setJavaType(TypeUtils.getObjectType(Short.class));
-          }
-          break;
-        }
-        case LITERAL_long: {
-          typ01 = LT(1);
-          typ01_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ01,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ01_AST);
-          match(LITERAL_long);
-          if (inputState.guessing == 0) {
-            typ01_AST.setJavaType(TypeUtils.getObjectType(Long.class));
-          }
-          break;
-        }
-        case LITERAL_int: {
-          typ02 = LT(1);
-          typ02_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ02,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ02_AST);
-          match(LITERAL_int);
-          if (inputState.guessing == 0) {
-            typ02_AST.setJavaType(TypeUtils.getObjectType(Integer.class));
-          }
-          break;
-        }
-        case LITERAL_float: {
-          typ03 = LT(1);
-          typ03_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ03,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ03_AST);
-          match(LITERAL_float);
-          if (inputState.guessing == 0) {
-            typ03_AST.setJavaType(TypeUtils.getObjectType(Float.class));
-          }
-          break;
-        }
-        case LITERAL_double: {
-          typ04 = LT(1);
-          typ04_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ04,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ04_AST);
-          match(LITERAL_double);
-          if (inputState.guessing == 0) {
-            typ04_AST.setJavaType(TypeUtils.getObjectType(Double.class));
-          }
-          break;
-        }
-        case LITERAL_char: {
-          typ05 = LT(1);
-          typ05_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ05,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ05_AST);
-          match(LITERAL_char);
-          if (inputState.guessing == 0) {
-            typ05_AST.setJavaType(TypeUtils.getObjectType(Character.class));
-          }
-          break;
-        }
-        case LITERAL_string: {
-          typ06 = LT(1);
-          typ06_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ06,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ06_AST);
-          match(LITERAL_string);
-          if (inputState.guessing == 0) {
-            typ06_AST.setJavaType(TypeUtils.getObjectType(String.class));
-          }
-          break;
-        }
-        case LITERAL_boolean: {
-          typ07 = LT(1);
-          typ07_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ07,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ07_AST);
-          match(LITERAL_boolean);
-          if (inputState.guessing == 0) {
-            typ07_AST.setJavaType(TypeUtils.getObjectType(Boolean.class));
-          }
-          break;
-        }
-        case LITERAL_byte: {
-          typ08 = LT(1);
-          typ08_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ08,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ08_AST);
-          match(LITERAL_byte);
-          if (inputState.guessing == 0) {
-            typ08_AST.setJavaType(TypeUtils.getObjectType(Byte.class));
-          }
-          break;
-        }
-        case LITERAL_octet: {
-          typ09 = LT(1);
-          typ09_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ09,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ09_AST);
-          match(LITERAL_octet);
-          if (inputState.guessing == 0) {
-            typ09_AST.setJavaType(TypeUtils.getObjectType(Byte.class));
-          }
-          break;
-        }
-        case LITERAL_enum: {
-          AST tmp37_AST = null;
-          tmp37_AST = astFactory.create(LT(1));
-          astFactory.makeASTRoot(currentAST, tmp37_AST);
-          match(LITERAL_enum);
-          {
-            if ((LA(1) == QuotedIdentifier || LA(1) == Identifier) && (LA(2) == TOK_DOT)) {
-              identifier();
-              astFactory.addASTChild(currentAST, returnAST);
-              AST tmp38_AST = null;
-              tmp38_AST = astFactory.create(LT(1));
-              astFactory.addASTChild(currentAST, tmp38_AST);
-              match(TOK_DOT);
-            } else if ((LA(1) == QuotedIdentifier || LA(1) == Identifier)
-                && (_tokenSet_8.member(LA(2)))) {
-            } else {
-              throw new NoViableAltException(LT(1), getFilename());
-            }
-
-          }
-          identifier();
-          astFactory.addASTChild(currentAST, returnAST);
-          break;
-        }
-        case LITERAL_date: {
-          typ10 = LT(1);
-          typ10_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ10,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ10_AST);
-          match(LITERAL_date);
-          if (inputState.guessing == 0) {
-            typ10_AST.setJavaType(TypeUtils.getObjectType(java.sql.Date.class));
-          }
-          break;
-        }
-        case LITERAL_time: {
-          typ11 = LT(1);
-          typ11_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ11,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ11_AST);
-          match(LITERAL_time);
-          if (inputState.guessing == 0) {
-            typ11_AST.setJavaType(TypeUtils.getObjectType(java.sql.Time.class));
-          }
-          break;
-        }
-        case LITERAL_interval: {
-          AST tmp39_AST = null;
-          tmp39_AST = astFactory.create(LT(1));
-          astFactory.addASTChild(currentAST, tmp39_AST);
-          match(LITERAL_interval);
-          break;
-        }
-        case LITERAL_timestamp: {
-          typ12 = LT(1);
-          typ12_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ12,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.addASTChild(currentAST, typ12_AST);
-          match(LITERAL_timestamp);
-          if (inputState.guessing == 0) {
-            typ12_AST.setJavaType(TypeUtils.getObjectType(java.sql.Timestamp.class));
-          }
-          break;
-        }
-        case LITERAL_set: {
-          typ13 = LT(1);
-          typ13_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ13,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.makeASTRoot(currentAST, typ13_AST);
-          match(LITERAL_set);
-          match(TOK_LT);
-          type();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_GT);
-          if (inputState.guessing == 0) {
-            typ13_AST.setJavaType(
-                new CollectionTypeImpl(Set.class, TypeUtils.OBJECT_TYPE /* resolved later */));
-          }
-          break;
-        }
-        case LITERAL_collection: {
-          typ14 = LT(1);
-          typ14_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ14,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.makeASTRoot(currentAST, typ14_AST);
-          match(LITERAL_collection);
-          match(TOK_LT);
-          type();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_GT);
-          if (inputState.guessing == 0) {
-            typ14_AST.setJavaType(new CollectionTypeImpl(Collection.class,
-                TypeUtils.OBJECT_TYPE /* resolved later */));
-          }
-          break;
-        }
-        case LITERAL_bag: {
-          AST tmp44_AST = null;
-          tmp44_AST = astFactory.create(LT(1));
-          astFactory.makeASTRoot(currentAST, tmp44_AST);
-          match(LITERAL_bag);
-          match(TOK_LT);
-          type();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_GT);
-          break;
-        }
-        case LITERAL_list: {
-          typ15 = LT(1);
-          typ15_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ15,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.makeASTRoot(currentAST, typ15_AST);
-          match(LITERAL_list);
-          match(TOK_LT);
-          type();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_GT);
-          if (inputState.guessing == 0) {
-            typ15_AST.setJavaType(
-                new CollectionTypeImpl(List.class, TypeUtils.OBJECT_TYPE /* resolved later */));
-          }
-          break;
-        }
-        case LITERAL_array: {
-          typ16 = LT(1);
-          typ16_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory.create(typ16,
-              "org.apache.geode.cache.query.internal.parse.ASTType");
-          astFactory.makeASTRoot(currentAST, typ16_AST);
-          match(LITERAL_array);
-          match(TOK_LT);
-          type();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_GT);
-          if (inputState.guessing == 0) {
-            typ16_AST.setJavaType(
-                new CollectionTypeImpl(Object[].class, TypeUtils.OBJECT_TYPE /* resolved later */));
-          }
-          break;
-        }
-        case LITERAL_dictionary:
-        case LITERAL_map: {
-          {
-            if ((LA(1) == LITERAL_dictionary)) {
-              typ17 = LT(1);
-              typ17_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory
-                  .create(typ17, "org.apache.geode.cache.query.internal.parse.ASTType");
-              astFactory.makeASTRoot(currentAST, typ17_AST);
-              match(LITERAL_dictionary);
-              if (inputState.guessing == 0) {
-                typ17_AST.setJavaType(new MapTypeImpl(Map.class, TypeUtils.OBJECT_TYPE,
-                    TypeUtils.OBJECT_TYPE /* resolved later */));
-              }
-            } else if ((LA(1) == LITERAL_map)) {
-              typ18 = LT(1);
-              typ18_AST = (org.apache.geode.cache.query.internal.parse.ASTType) astFactory
-                  .create(typ18, "org.apache.geode.cache.query.internal.parse.ASTType");
-              astFactory.makeASTRoot(currentAST, typ18_AST);
-              match(LITERAL_map);
-              if (inputState.guessing == 0) {
-                typ18_AST.setJavaType(new MapTypeImpl(Map.class, TypeUtils.OBJECT_TYPE,
-                    TypeUtils.OBJECT_TYPE /* resolved later */));
-              }
-            } else {
-              throw new NoViableAltException(LT(1), getFilename());
-            }
-
-          }
-          match(TOK_LT);
-          type();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_COMMA);
-          type();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_GT);
-          break;
-        }
-        case QuotedIdentifier:
-        case Identifier: {
-          identifier();
-          id_AST = (AST) returnAST;
-          if (inputState.guessing == 0) {
-            type_AST = (AST) currentAST.root;
-            String txt = id_AST.getText();
-            type_AST = (AST) astFactory.create(Identifier, txt,
-                "org.apache.geode.cache.query.internal.parse.ASTType");
-            ((ASTType) type_AST).setTypeName(txt);
-            currentAST.root = type_AST;
-            currentAST.child = type_AST != null && type_AST.getFirstChild() != null
-                ? type_AST.getFirstChild() : type_AST;
-            currentAST.advanceChildToEnd();
-          }
-          break;
-        }
-        default: {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-      }
-    }
-    type_AST = (AST) currentAST.root;
-    returnAST = type_AST;
-  }
-
-  public final void selectExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST selectExpr_AST = null;
-
-    {
-      if ((LA(1) == TOK_LT)) {
-        hintCommand();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((LA(1) == LITERAL_select)) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    org.apache.geode.cache.query.internal.parse.ASTSelect tmp54_AST = null;
-    tmp54_AST = (org.apache.geode.cache.query.internal.parse.ASTSelect) astFactory.create(LT(1),
-        "org.apache.geode.cache.query.internal.parse.ASTSelect");
-    astFactory.makeASTRoot(currentAST, tmp54_AST);
-    match(LITERAL_select);
-    {
-      if ((LA(1) == LITERAL_distinct) && (_tokenSet_9.member(LA(2)))) {
-        org.apache.geode.cache.query.internal.parse.ASTDummy tmp55_AST = null;
-        tmp55_AST = (org.apache.geode.cache.query.internal.parse.ASTDummy) astFactory.create(LT(1),
-            "org.apache.geode.cache.query.internal.parse.ASTDummy");
-        astFactory.addASTChild(currentAST, tmp55_AST);
-        match(LITERAL_distinct);
-      } else if ((LA(1) == LITERAL_all)) {
-        org.apache.geode.cache.query.internal.parse.ASTDummy tmp56_AST = null;
-        tmp56_AST = (org.apache.geode.cache.query.internal.parse.ASTDummy) astFactory.create(LT(1),
-            "org.apache.geode.cache.query.internal.parse.ASTDummy");
-        astFactory.addASTChild(currentAST, tmp56_AST);
-        match(LITERAL_all);
-      } else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2)))) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    {
-      projectionAttributes();
-      astFactory.addASTChild(currentAST, returnAST);
-    }
-    fromClause();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      if ((LA(1) == LITERAL_where)) {
-        whereClause();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((_tokenSet_11.member(LA(1)))) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    {
-      if ((LA(1) == LITERAL_group)) {
-        groupClause();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((_tokenSet_12.member(LA(1)))) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    {
-      if ((LA(1) == LITERAL_order)) {
-        orderClause();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((_tokenSet_13.member(LA(1)))) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    {
-      if ((LA(1) == LITERAL_limit)) {
-        limitClause();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((LA(1) == EOF || LA(1) == TOK_RPAREN || LA(1) == TOK_SEMIC)) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    selectExpr_AST = (AST) currentAST.root;
-    returnAST = selectExpr_AST;
-  }
-
-  public final void expr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST expr_AST = null;
-
-    castExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    expr_AST = (AST) currentAST.root;
-    returnAST = expr_AST;
-  }
-
-  public final void hintCommand() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST hintCommand_AST = null;
-
-    match(TOK_LT);
-    org.apache.geode.cache.query.internal.parse.ASTHint tmp58_AST = null;
-    tmp58_AST = (org.apache.geode.cache.query.internal.parse.ASTHint) astFactory.create(LT(1),
-        "org.apache.geode.cache.query.internal.parse.ASTHint");
-    astFactory.makeASTRoot(currentAST, tmp58_AST);
-    match(LITERAL_hint);
-    hintIdentifier();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop173: do {
-        if ((LA(1) == TOK_COMMA)) {
-          match(TOK_COMMA);
-          hintIdentifier();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop173;
-        }
-
-      } while (true);
-    }
-    match(TOK_GT);
-    hintCommand_AST = (AST) currentAST.root;
-    returnAST = hintCommand_AST;
-  }
-
-  public final void fromClause() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST fromClause_AST = null;
-
-    org.apache.geode.cache.query.internal.parse.ASTCombination tmp61_AST = null;
-    tmp61_AST = (org.apache.geode.cache.query.internal.parse.ASTCombination) astFactory
-        .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTCombination");
-    astFactory.makeASTRoot(currentAST, tmp61_AST);
-    match(LITERAL_from);
-    iteratorDef();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop150: do {
-        if ((LA(1) == TOK_COMMA)) {
-          match(TOK_COMMA);
-          iteratorDef();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop150;
-        }
-
-      } while (true);
-    }
-    fromClause_AST = (AST) currentAST.root;
-    returnAST = fromClause_AST;
-  }
-
-  public final void whereClause() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST whereClause_AST = null;
-
-    match(LITERAL_where);
-    expr();
-    astFactory.addASTChild(currentAST, returnAST);
-    whereClause_AST = (AST) currentAST.root;
-    returnAST = whereClause_AST;
-  }
-
-  public final void groupClause() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST groupClause_AST = null;
-
-    org.apache.geode.cache.query.internal.parse.ASTGroupBy tmp64_AST = null;
-    tmp64_AST = (org.apache.geode.cache.query.internal.parse.ASTGroupBy) astFactory.create(LT(1),
-        "org.apache.geode.cache.query.internal.parse.ASTGroupBy");
-    astFactory.makeASTRoot(currentAST, tmp64_AST);
-    match(LITERAL_group);
-    match(LITERAL_by);
-    groupByList();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      if ((LA(1) == LITERAL_having)) {
-        match(LITERAL_having);
-        expr();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((_tokenSet_12.member(LA(1)))) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    groupClause_AST = (AST) currentAST.root;
-    returnAST = groupClause_AST;
-  }
-
-  public final void orderClause() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST orderClause_AST = null;
-
-    org.apache.geode.cache.query.internal.parse.ASTOrderBy tmp67_AST = null;
-    tmp67_AST = (org.apache.geode.cache.query.internal.parse.ASTOrderBy) astFactory.create(LT(1),
-        "org.apache.geode.cache.query.internal.parse.ASTOrderBy");
-    astFactory.makeASTRoot(currentAST, tmp67_AST);
-    match(LITERAL_order);
-    match(LITERAL_by);
-    sortCriterion();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop177: do {
-        if ((LA(1) == TOK_COMMA)) {
-          match(TOK_COMMA);
-          sortCriterion();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop177;
-        }
-
-      } while (true);
-    }
-    orderClause_AST = (AST) currentAST.root;
-    returnAST = orderClause_AST;
-  }
-
-  public final void limitClause() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST limitClause_AST = null;
-    Token n = null;
-    AST n_AST = null;
-
-    match(LITERAL_limit);
-    {
-      if ((LA(1) == TOK_DOLLAR)) {
-        AST tmp71_AST = null;
-        tmp71_AST = astFactory.create(LT(1));
-        match(TOK_DOLLAR);
-        AST tmp72_AST = null;
-        tmp72_AST = astFactory.create(LT(1));
-        match(NUM_INT);
-        if (inputState.guessing == 0) {
-          limitClause_AST = (AST) currentAST.root;
-          limitClause_AST =
-              (AST) astFactory
-                  .make((new ASTArray(2))
-                      .add((AST) astFactory.create(LIMIT, "limitParam",
-                          "org.apache.geode.cache.query.internal.parse.ASTParameter"))
-                      .add(tmp72_AST));
-          currentAST.root = limitClause_AST;
-          currentAST.child = limitClause_AST != null && limitClause_AST.getFirstChild() != null
-              ? limitClause_AST.getFirstChild() : limitClause_AST;
-          currentAST.advanceChildToEnd();
-        }
-      } else if ((LA(1) == NUM_INT)) {
-        n = LT(1);
-        n_AST = astFactory.create(n);
-        match(NUM_INT);
-        if (inputState.guessing == 0) {
-          limitClause_AST = (AST) currentAST.root;
-          limitClause_AST = (AST) astFactory.create(LIMIT, n.getText(),
-              "org.apache.geode.cache.query.internal.parse.ASTLimit");
-          currentAST.root = limitClause_AST;
-          currentAST.child = limitClause_AST != null && limitClause_AST.getFirstChild() != null
-              ? limitClause_AST.getFirstChild() : limitClause_AST;
-          currentAST.advanceChildToEnd();
-        }
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    returnAST = limitClause_AST;
-  }
-
-  public final void projection() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST projection_AST = null;
-    AST lb1_AST = null;
-    AST tok1_AST = null;
-    AST tok2_AST = null;
-    AST tok3_AST = null;
-    AST tok4_AST = null;
-    AST lb2_AST = null;
-    AST node = null;
-
-    if ((LA(1) == QuotedIdentifier || LA(1) == Identifier) && (LA(2) == TOK_COLON)) {
-      identifier();
-      lb1_AST = (AST) returnAST;
-      match(TOK_COLON);
-      {
-        if (((LA(1) >= LITERAL_sum && LA(1) <= LITERAL_count)) && (LA(2) == TOK_LPAREN)) {
-          aggregateExpr();
-          tok1_AST = (AST) returnAST;
-          if (inputState.guessing == 0) {
-            node = tok1_AST;
-          }
-        } else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_14.member(LA(2)))) {
-          expr();
-          tok2_AST = (AST) returnAST;
-          if (inputState.guessing == 0) {
-            node = tok2_AST;
-          }
-        } else {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-
-      }
-      if (inputState.guessing == 0) {
-        projection_AST = (AST) currentAST.root;
-        projection_AST = (AST) astFactory.make((new ASTArray(3))
-            .add((AST) astFactory.create(PROJECTION, "projection",
-                "org.apache.geode.cache.query.internal.parse.ASTProjection"))
-            .add(node).add(lb1_AST));
-        currentAST.root = projection_AST;
-        currentAST.child = projection_AST != null && projection_AST.getFirstChild() != null
-            ? projection_AST.getFirstChild() : projection_AST;
-        currentAST.advanceChildToEnd();
-      }
-    } else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_15.member(LA(2)))) {
-      {
-        if (((LA(1) >= LITERAL_sum && LA(1) <= LITERAL_count)) && (LA(2) == TOK_LPAREN)) {
-          aggregateExpr();
-          tok3_AST = (AST) returnAST;
-          if (inputState.guessing == 0) {
-            node = tok3_AST;
-          }
-        } else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_15.member(LA(2)))) {
-          expr();
-          tok4_AST = (AST) returnAST;
-          if (inputState.guessing == 0) {
-            node = tok4_AST;
-          }
-        } else {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-
-      }
-      {
-        if ((LA(1) == LITERAL_as)) {
-          match(LITERAL_as);
-          identifier();
-          lb2_AST = (AST) returnAST;
-        } else if ((LA(1) == EOF || LA(1) == TOK_COMMA || LA(1) == LITERAL_from)) {
-        } else {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-
-      }
-      if (inputState.guessing == 0) {
-        projection_AST = (AST) currentAST.root;
-        projection_AST = (AST) astFactory.make((new ASTArray(3))
-            .add((AST) astFactory.create(PROJECTION, "projection",
-                "org.apache.geode.cache.query.internal.parse.ASTProjection"))
-            .add(node).add(lb2_AST));
-        currentAST.root = projection_AST;
-        currentAST.child = projection_AST != null && projection_AST.getFirstChild() != null
-            ? projection_AST.getFirstChild() : projection_AST;
-        currentAST.advanceChildToEnd();
-      }
-    } else {
-      throw new NoViableAltException(LT(1), getFilename());
-    }
-
-    returnAST = projection_AST;
-  }
-
-  public final void aggregateExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST aggregateExpr_AST = null;
-    AST tokExpr1_AST = null;
-    AST tokExpr2_AST = null;
-    int aggFunc = -1;
-    boolean distinctOnly = false;
-
-    switch (LA(1)) {
-      case LITERAL_sum:
-      case LITERAL_avg: {
-        {
-          if ((LA(1) == LITERAL_sum)) {
-            match(LITERAL_sum);
-            if (inputState.guessing == 0) {
-              aggFunc = SUM;
-            }
-          } else if ((LA(1) == LITERAL_avg)) {
-            match(LITERAL_avg);
-            if (inputState.guessing == 0) {
-              aggFunc = AVG;
-            }
-          } else {
-            throw new NoViableAltException(LT(1), getFilename());
-          }
-
-        }
-        AST tmp77_AST = null;
-        tmp77_AST = astFactory.create(LT(1));
-        match(TOK_LPAREN);
-        {
-          if ((LA(1) == LITERAL_distinct) && (_tokenSet_4.member(LA(2)))) {
-            match(LITERAL_distinct);
-            if (inputState.guessing == 0) {
-              distinctOnly = true;
-            }
-          } else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_16.member(LA(2)))) {
-          } else {
-            throw new NoViableAltException(LT(1), getFilename());
-          }
-
-        }
-        expr();
-        tokExpr1_AST = (AST) returnAST;
-        AST tmp79_AST = null;
-        tmp79_AST = astFactory.create(LT(1));
-        match(TOK_RPAREN);
-        if (inputState.guessing == 0) {
-          aggregateExpr_AST = (AST) currentAST.root;
-          aggregateExpr_AST = (AST) astFactory.make((new ASTArray(2))
-              .add((AST) astFactory.create(AGG_FUNC, "aggregate",
-                  "org.apache.geode.cache.query.internal.parse.ASTAggregateFunc"))
-              .add(tokExpr1_AST));
-          ((ASTAggregateFunc) aggregateExpr_AST).setAggregateFunctionType(aggFunc);
-          ((ASTAggregateFunc) aggregateExpr_AST).setDistinctOnly(distinctOnly);
-
-          currentAST.root = aggregateExpr_AST;
-          currentAST.child = aggregateExpr_AST != null && aggregateExpr_AST.getFirstChild() != null
-              ? aggregateExpr_AST.getFirstChild() : aggregateExpr_AST;
-          currentAST.advanceChildToEnd();
-        }
-        break;
-      }
-      case LITERAL_min:
-      case LITERAL_max: {
-        {
-          if ((LA(1) == LITERAL_min)) {
-            match(LITERAL_min);
-            if (inputState.guessing == 0) {
-              aggFunc = MIN;
-            }
-          } else if ((LA(1) == LITERAL_max)) {
-            match(LITERAL_max);
-            if (inputState.guessing == 0) {
-              aggFunc = MAX;
-            }
-          } else {
-            throw new NoViableAltException(LT(1), getFilename());
-          }
-
-        }
-        AST tmp82_AST = null;
-        tmp82_AST = astFactory.create(LT(1));
-        match(TOK_LPAREN);
-        expr();
-        tokExpr2_AST = (AST) returnAST;
-        AST tmp83_AST = null;
-        tmp83_AST = astFactory.create(LT(1));
-        match(TOK_RPAREN);
-        if (inputState.guessing == 0) {
-          aggregateExpr_AST = (AST) currentAST.root;
-          aggregateExpr_AST = (AST) astFactory.make((new ASTArray(2))
-              .add((AST) astFactory.create(AGG_FUNC, "aggregate",
-                  "org.apache.geode.cache.query.internal.parse.ASTAggregateFunc"))
-              .add(tokExpr2_AST));
-          ((ASTAggregateFunc) aggregateExpr_AST).setAggregateFunctionType(aggFunc);
-
-          currentAST.root = aggregateExpr_AST;
-          currentAST.child = aggregateExpr_AST != null && aggregateExpr_AST.getFirstChild() != null
-              ? aggregateExpr_AST.getFirstChild() : aggregateExpr_AST;
-          currentAST.advanceChildToEnd();
-        }
-        break;
-      }
-      case LITERAL_count: {
-        org.apache.geode.cache.query.internal.parse.ASTAggregateFunc tmp84_AST = null;
-        tmp84_AST = (org.apache.geode.cache.query.internal.parse.ASTAggregateFunc) astFactory
-            .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTAggregateFunc");
-        astFactory.makeASTRoot(currentAST, tmp84_AST);
-        match(LITERAL_count);
-        match(TOK_LPAREN);
-        {
-          if ((LA(1) == TOK_STAR)) {
-            org.apache.geode.cache.query.internal.parse.ASTDummy tmp86_AST = null;
-            tmp86_AST = (org.apache.geode.cache.query.internal.parse.ASTDummy) astFactory
-                .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTDummy");
-            astFactory.addASTChild(currentAST, tmp86_AST);
-            match(TOK_STAR);
-          } else if ((_tokenSet_4.member(LA(1)))) {
-            {
-              if ((LA(1) == LITERAL_distinct) && (_tokenSet_4.member(LA(2)))) {
-                match(LITERAL_distinct);
-                if (inputState.guessing == 0) {
-                  distinctOnly = true;
-                }
-              } else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_16.member(LA(2)))) {
-              } else {
-                throw new NoViableAltException(LT(1), getFilename());
-              }
-
-            }
-            expr();
-            astFactory.addASTChild(currentAST, returnAST);
-          } else {
-            throw new NoViableAltException(LT(1), getFilename());
-          }
-
-        }
-        match(TOK_RPAREN);
-        if (inputState.guessing == 0) {
-          aggregateExpr_AST = (AST) currentAST.root;
-
-          ((ASTAggregateFunc) aggregateExpr_AST).setAggregateFunctionType(COUNT);
-          aggregateExpr_AST.setText("aggregate");
-          ((ASTAggregateFunc) aggregateExpr_AST).setDistinctOnly(distinctOnly);
-
-        }
-        aggregateExpr_AST = (AST) currentAST.root;
-        break;
-      }
-      default: {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-    }
-    returnAST = aggregateExpr_AST;
-  }
-
-  public final void groupByList() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST groupByList_AST = null;
-
-    expr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop268: do {
-        if ((LA(1) == TOK_COMMA)) {
-          match(TOK_COMMA);
-          expr();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop268;
-        }
-
-      } while (true);
-    }
-    groupByList_AST = (AST) currentAST.root;
-    returnAST = groupByList_AST;
-  }
-
-  public final void hintIdentifier() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST hintIdentifier_AST = null;
-    Token n = null;
-    AST n_AST = null;
-
-    n = LT(1);
-    n_AST = astFactory.create(n);
-    astFactory.addASTChild(currentAST, n_AST);
-    match(StringLiteral);
-    if (inputState.guessing == 0) {
-      hintIdentifier_AST = (AST) currentAST.root;
-      hintIdentifier_AST = (AST) astFactory.create(HINT, n.getText(),
-          "org.apache.geode.cache.query.internal.parse.ASTHintIdentifier");
-      currentAST.root = hintIdentifier_AST;
-      currentAST.child = hintIdentifier_AST != null && hintIdentifier_AST.getFirstChild() != null
-          ? hintIdentifier_AST.getFirstChild() : hintIdentifier_AST;
-      currentAST.advanceChildToEnd();
-    }
-    hintIdentifier_AST = (AST) currentAST.root;
-    returnAST = hintIdentifier_AST;
-  }
-
-  public final void sortCriterion() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST sortCriterion_AST = null;
-    AST tok_AST = null;
-
-    expr();
-    tok_AST = (AST) returnAST;
-    astFactory.addASTChild(currentAST, returnAST);
-    if (inputState.guessing == 0) {
-      sortCriterion_AST = (AST) currentAST.root;
-      sortCriterion_AST =
-          (AST) astFactory
-              .make((new ASTArray(2))
-                  .add((AST) astFactory.create(SORT_CRITERION, "asc",
-                      "org.apache.geode.cache.query.internal.parse.ASTSortCriterion"))
-                  .add(tok_AST));
-      currentAST.root = sortCriterion_AST;
-      currentAST.child = sortCriterion_AST != null && sortCriterion_AST.getFirstChild() != null
-          ? sortCriterion_AST.getFirstChild() : sortCriterion_AST;
-      currentAST.advanceChildToEnd();
-    }
-    {
-      switch (LA(1)) {
-        case LITERAL_asc: {
-          match(LITERAL_asc);
-          if (inputState.guessing == 0) {
-            sortCriterion_AST = (AST) currentAST.root;
-            sortCriterion_AST.setText("asc");
-          }
-          break;
-        }
-        case LITERAL_desc: {
-          match(LITERAL_desc);
-          if (inputState.guessing == 0) {
-            sortCriterion_AST = (AST) currentAST.root;
-            sortCriterion_AST.setText("desc");
-          }
-          break;
-        }
-        case EOF:
-        case TOK_RPAREN:
-        case TOK_COMMA:
-        case TOK_SEMIC:
-        case LITERAL_limit: {
-          break;
-        }
-        default: {
-          throw new NoViableAltException(LT(1), getFilename());
-        }
-      }
-    }
-    sortCriterion_AST = (AST) currentAST.root;
-    returnAST = sortCriterion_AST;
-  }
-
-  public final void castExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST castExpr_AST = null;
-    Token lp = null;
-    org.apache.geode.cache.query.internal.parse.ASTTypeCast lp_AST = null;
-
-    boolean synPredMatched183 = false;
-    if (((LA(1) == TOK_LPAREN) && (_tokenSet_17.member(LA(2))))) {
-      int _m183 = mark();
-      synPredMatched183 = true;
-      inputState.guessing++;
-      try {
-        {
-          match(TOK_LPAREN);
-          type();
-          match(TOK_RPAREN);
-          castExpr();
-        }
-      } catch (RecognitionException pe) {
-        synPredMatched183 = false;
-      }
-      rewind(_m183);
-      inputState.guessing--;
-    }
-    if (synPredMatched183) {
-      lp = LT(1);
-      lp_AST = (org.apache.geode.cache.query.internal.parse.ASTTypeCast) astFactory.create(lp,
-          "org.apache.geode.cache.query.internal.parse.ASTTypeCast");
-      astFactory.makeASTRoot(currentAST, lp_AST);
-      match(TOK_LPAREN);
-      if (inputState.guessing == 0) {
-        lp_AST.setType(TYPECAST);
-        lp_AST.setText("typecast");
-      }
-      type();
-      astFactory.addASTChild(currentAST, returnAST);
-      match(TOK_RPAREN);
-      castExpr();
-      astFactory.addASTChild(currentAST, returnAST);
-      castExpr_AST = (AST) currentAST.root;
-    } else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_18.member(LA(2)))) {
-      orExpr();
-      astFactory.addASTChild(currentAST, returnAST);
-      castExpr_AST = (AST) currentAST.root;
-    } else {
-      throw new NoViableAltException(LT(1), getFilename());
-    }
-
-    returnAST = castExpr_AST;
-  }
-
-  public final void orExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST orExpr_AST = null;
-    boolean cmplx = false;
-
-    orelseExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop186: do {
-        if ((LA(1) == LITERAL_or)) {
-          match(LITERAL_or);
-          orelseExpr();
-          astFactory.addASTChild(currentAST, returnAST);
-          if (inputState.guessing == 0) {
-            cmplx = true;
-          }
-        } else {
-          break _loop186;
-        }
-
-      } while (true);
-    }
-    if (inputState.guessing == 0) {
-      orExpr_AST = (AST) currentAST.root;
-      if (cmplx) {
-        orExpr_AST = (AST) astFactory.make((new ASTArray(2)).add((AST) astFactory.create(LITERAL_or,
-            "or", "org.apache.geode.cache.query.internal.parse.ASTOr")).add(orExpr_AST));
-      }
-      currentAST.root = orExpr_AST;
-      currentAST.child = orExpr_AST != null && orExpr_AST.getFirstChild() != null
-          ? orExpr_AST.getFirstChild() : orExpr_AST;
-      currentAST.advanceChildToEnd();
-    }
-    orExpr_AST = (AST) currentAST.root;
-    returnAST = orExpr_AST;
-  }
-
-  public final void orelseExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST orelseExpr_AST = null;
-    boolean cmplx = false;
-
-    andExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop189: do {
-        if ((LA(1) == LITERAL_orelse)) {
-          match(LITERAL_orelse);
-          andExpr();
-          astFactory.addASTChild(currentAST, returnAST);
-          if (inputState.guessing == 0) {
-            cmplx = true;
-          }
-        } else {
-          break _loop189;
-        }
-
-      } while (true);
-    }
-    if (inputState.guessing == 0) {
-      orelseExpr_AST = (AST) currentAST.root;
-      if (cmplx) {
-        orelseExpr_AST = (AST) astFactory.make(
-            (new ASTArray(2)).add(astFactory.create(LITERAL_orelse, "or")).add(orelseExpr_AST));
-      }
-      currentAST.root = orelseExpr_AST;
-      currentAST.child = orelseExpr_AST != null && orelseExpr_AST.getFirstChild() != null
-          ? orelseExpr_AST.getFirstChild() : orelseExpr_AST;
-      currentAST.advanceChildToEnd();
-    }
-    orelseExpr_AST = (AST) currentAST.root;
-    returnAST = orelseExpr_AST;
-  }
-
-  public final void andExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST andExpr_AST = null;
-    boolean cmplx = false;
-
-    quantifierExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop192: do {
-        if ((LA(1) == LITERAL_and)) {
-          match(LITERAL_and);
-          quantifierExpr();
-          astFactory.addASTChild(currentAST, returnAST);
-          if (inputState.guessing == 0) {
-            cmplx = true;
-          }
-        } else {
-          break _loop192;
-        }
-
-      } while (true);
-    }
-    if (inputState.guessing == 0) {
-      andExpr_AST = (AST) currentAST.root;
-      if (cmplx) {
-        andExpr_AST =
-            (AST) astFactory
-                .make(
-                    (new ASTArray(2))
-                        .add((AST) astFactory.create(LITERAL_and, "and",
-                            "org.apache.geode.cache.query.internal.parse.ASTAnd"))
-                        .add(andExpr_AST));
-      }
-      currentAST.root = andExpr_AST;
-      currentAST.child = andExpr_AST != null && andExpr_AST.getFirstChild() != null
-          ? andExpr_AST.getFirstChild() : andExpr_AST;
-      currentAST.advanceChildToEnd();
-    }
-    andExpr_AST = (AST) currentAST.root;
-    returnAST = andExpr_AST;
-  }
-
-  public final void quantifierExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST quantifierExpr_AST = null;
-
-    if ((LA(1) == LITERAL_for)) {
-      AST tmp96_AST = null;
-      tmp96_AST = astFactory.create(LT(1));
-      astFactory.makeASTRoot(currentAST, tmp96_AST);
-      match(LITERAL_for);
-      match(LITERAL_all);
-      inClause();
-      astFactory.addASTChild(currentAST, returnAST);
-      match(TOK_COLON);
-      andthenExpr();
-      astFactory.addASTChild(currentAST, returnAST);
-      quantifierExpr_AST = (AST) currentAST.root;
-    } else {
-      boolean synPredMatched195 = false;
-      if (((LA(1) == LITERAL_exists) && (LA(2) == QuotedIdentifier || LA(2) == Identifier))) {
-        int _m195 = mark();
-        synPredMatched195 = true;
-        inputState.guessing++;
-        try {
-          {
-            match(LITERAL_exists);
-            identifier();
-            match(LITERAL_in);
-          }
-        } catch (RecognitionException pe) {
-          synPredMatched195 = false;
-        }
-        rewind(_m195);
-        inputState.guessing--;
-      }
-      if (synPredMatched195) {
-        AST tmp99_AST = null;
-        tmp99_AST = astFactory.create(LT(1));
-        astFactory.makeASTRoot(currentAST, tmp99_AST);
-        match(LITERAL_exists);
-        inClause();
-        astFactory.addASTChild(currentAST, returnAST);
-        match(TOK_COLON);
-        andthenExpr();
-        astFactory.addASTChild(currentAST, returnAST);
-        quantifierExpr_AST = (AST) currentAST.root;
-      } else if ((_tokenSet_19.member(LA(1))) && (_tokenSet_20.member(LA(2)))) {
-        andthenExpr();
-        astFactory.addASTChild(currentAST, returnAST);
-        quantifierExpr_AST = (AST) currentAST.root;
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-    }
-    returnAST = quantifierExpr_AST;
-  }
-
-  public final void inClause() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST inClause_AST = null;
-
-    identifier();
-    astFactory.addASTChild(currentAST, returnAST);
-    match(LITERAL_in);
-    expr();
-    astFactory.addASTChild(currentAST, returnAST);
-    inClause_AST = (AST) currentAST.root;
-    returnAST = inClause_AST;
-  }
-
-  public final void andthenExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST andthenExpr_AST = null;
-    boolean cmplx = false;
-
-    equalityExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop199: do {
-        if ((LA(1) == LITERAL_andthen)) {
-          match(LITERAL_andthen);
-          equalityExpr();
-          astFactory.addASTChild(currentAST, returnAST);
-          if (inputState.guessing == 0) {
-            cmplx = true;
-          }
-        } else {
-          break _loop199;
-        }
-
-      } while (true);
-    }
-    if (inputState.guessing == 0) {
-      andthenExpr_AST = (AST) currentAST.root;
-      if (cmplx) {
-        andthenExpr_AST = (AST) astFactory.make((new ASTArray(2))
-            .add(astFactory.create(LITERAL_andthen, "andthen")).add(andthenExpr_AST));
-      }
-      currentAST.root = andthenExpr_AST;
-      currentAST.child = andthenExpr_AST != null && andthenExpr_AST.getFirstChild() != null
-          ? andthenExpr_AST.getFirstChild() : andthenExpr_AST;
-      currentAST.advanceChildToEnd();
-    }
-    andthenExpr_AST = (AST) currentAST.root;
-    returnAST = andthenExpr_AST;
-  }
-
-  public final void equalityExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST equalityExpr_AST = null;
-
-    relationalExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      if ((LA(1) == TOK_EQ || LA(1) == TOK_NE)) {
-        {
-          int _cnt205 = 0;
-          _loop205: do {
-            if ((LA(1) == TOK_EQ || LA(1) == TOK_NE)) {
-              {
-                if ((LA(1) == TOK_EQ)) {
-                  org.apache.geode.cache.query.internal.parse.ASTCompareOp tmp103_AST = null;
-                  tmp103_AST = (org.apache.geode.cache.query.internal.parse.ASTCompareOp) astFactory
-                      .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTCompareOp");
-                  astFactory.makeASTRoot(currentAST, tmp103_AST);
-                  match(TOK_EQ);
-                } else if ((LA(1) == TOK_NE)) {
-                  org.apache.geode.cache.query.internal.parse.ASTCompareOp tmp104_AST = null;
-                  tmp104_AST = (org.apache.geode.cache.query.internal.parse.ASTCompareOp) astFactory
-                      .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTCompareOp");
-                  astFactory.makeASTRoot(currentAST, tmp104_AST);
-                  match(TOK_NE);
-                } else {
-                  throw new NoViableAltException(LT(1), getFilename());
-                }
-
-              }
-              {
-                switch (LA(1)) {
-                  case LITERAL_all: {
-                    AST tmp105_AST = null;
-                    tmp105_AST = astFactory.create(LT(1));
-                    astFactory.makeASTRoot(currentAST, tmp105_AST);
-                    match(LITERAL_all);
-                    break;
-                  }
-                  case LITERAL_any: {
-                    AST tmp106_AST = null;
-                    tmp106_AST = astFactory.create(LT(1));
-                    astFactory.makeASTRoot(currentAST, tmp106_AST);
-                    match(LITERAL_any);
-                    break;
-                  }
-                  case LITERAL_some: {
-                    AST tmp107_AST = null;
-                    tmp107_AST = astFactory.create(LT(1));
-                    astFactory.makeASTRoot(currentAST, tmp107_AST);
-                    match(LITERAL_some);
-                    break;
-                  }
-                  case TOK_LPAREN:
-                  case TOK_PLUS:
-                  case TOK_MINUS:
-                  case TOK_DOLLAR:
-                  case QuotedIdentifier:
-                  case Identifier:
-                  case RegionPath:
-                  case NUM_INT:
-                  case StringLiteral:
-                  case LITERAL_distinct:
-                  case LITERAL_exists:
-                  case LITERAL_abs:
-                  case LITERAL_not:
-                  case LITERAL_listtoset:
-                  case LITERAL_element:
-                  case LITERAL_flatten:
-                  case LITERAL_nvl:
-                  case LITERAL_to_date:
-                  case LITERAL_first:
-                  case LITERAL_last:
-                  case LITERAL_unique:
-                  case LITERAL_sum:
-                  case LITERAL_avg:
-                  case LITERAL_min:
-                  case LITERAL_max:
-                  case LITERAL_count:
-                  case LITERAL_is_undefined:
-                  case LITERAL_is_defined:
-                  case LITERAL_struct:
-                  case LITERAL_array:
-                  case LITERAL_set:
-                  case LITERAL_bag:
-                  case LITERAL_list:
-                  case LITERAL_char:
-                  case LITERAL_date:
-                  case LITERAL_time:
-                  case LITERAL_timestamp:
-                  case LITERAL_nil:
-                  case LITERAL_null:
-                  case LITERAL_undefined:
-                  case LITERAL_true:
-                  case LITERAL_false:
-                  case NUM_LONG:
-                  case NUM_FLOAT:
-                  case NUM_DOUBLE: {
-                    break;
-                  }
-                  default: {
-                    throw new NoViableAltException(LT(1), getFilename());
-                  }
-                }
-              }
-              relationalExpr();
-              astFactory.addASTChild(currentAST, returnAST);
-            } else {
-              if (_cnt205 >= 1) {
-                break _loop205;
-              } else {
-                throw new NoViableAltException(LT(1), getFilename());
-              }
-            }
-
-            _cnt205++;
-          } while (true);
-        }
-      } else if ((_tokenSet_21.member(LA(1)))) {
-        {
-          _loop207: do {
-            if ((LA(1) == LITERAL_like)) {
-              org.apache.geode.cache.query.internal.parse.ASTLike tmp108_AST = null;
-              tmp108_AST = (org.apache.geode.cache.query.internal.parse.ASTLike) astFactory
-                  .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTLike");
-              astFactory.makeASTRoot(currentAST, tmp108_AST);
-              match(LITERAL_like);
-              relationalExpr();
-              astFactory.addASTChild(currentAST, returnAST);
-            } else {
-              break _loop207;
-            }
-
-          } while (true);
-        }
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    equalityExpr_AST = (AST) currentAST.root;
-    returnAST = equalityExpr_AST;
-  }
-
-  public final void relationalExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST relationalExpr_AST = null;
-
-    additiveExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop213: do {
-        if ((_tokenSet_22.member(LA(1)))) {
-          {
-            switch (LA(1)) {
-              case TOK_LT: {
-                org.apache.geode.cache.query.internal.parse.ASTCompareOp tmp109_AST = null;
-                tmp109_AST = (org.apache.geode.cache.query.internal.parse.ASTCompareOp) astFactory
-                    .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTCompareOp");
-                astFactory.makeASTRoot(currentAST, tmp109_AST);
-                match(TOK_LT);
-                break;
-              }
-              case TOK_GT: {
-                org.apache.geode.cache.query.internal.parse.ASTCompareOp tmp110_AST = null;
-                tmp110_AST = (org.apache.geode.cache.query.internal.parse.ASTCompareOp) astFactory
-                    .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTCompareOp");
-                astFactory.makeASTRoot(currentAST, tmp110_AST);
-                match(TOK_GT);
-                break;
-              }
-              case TOK_LE: {
-                org.apache.geode.cache.query.internal.parse.ASTCompareOp tmp111_AST = null;
-                tmp111_AST = (org.apache.geode.cache.query.internal.parse.ASTCompareOp) astFactory
-                    .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTCompareOp");
-                astFactory.makeASTRoot(currentAST, tmp111_AST);
-                match(TOK_LE);
-                break;
-              }
-              case TOK_GE: {
-                org.apache.geode.cache.query.internal.parse.ASTCompareOp tmp112_AST = null;
-                tmp112_AST = (org.apache.geode.cache.query.internal.parse.ASTCompareOp) astFactory
-                    .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTCompareOp");
-                astFactory.makeASTRoot(currentAST, tmp112_AST);
-                match(TOK_GE);
-                break;
-              }
-              default: {
-                throw new NoViableAltException(LT(1), getFilename());
-              }
-            }
-          }
-          {
-            if ((_tokenSet_19.member(LA(1)))) {
-              additiveExpr();
-              astFactory.addASTChild(currentAST, returnAST);
-            } else if ((LA(1) == LITERAL_all || LA(1) == LITERAL_any || LA(1) == LITERAL_some)) {
-              {
-                switch (LA(1)) {
-                  case LITERAL_all: {
-                    AST tmp113_AST = null;
-                    tmp113_AST = astFactory.create(LT(1));
-                    astFactory.makeASTRoot(currentAST, tmp113_AST);
-                    match(LITERAL_all);
-                    break;
-                  }
-                  case LITERAL_any: {
-                    AST tmp114_AST = null;
-                    tmp114_AST = astFactory.create(LT(1));
-                    astFactory.makeASTRoot(currentAST, tmp114_AST);
-                    match(LITERAL_any);
-                    break;
-                  }
-                  case LITERAL_some: {
-                    AST tmp115_AST = null;
-                    tmp115_AST = astFactory.create(LT(1));
-                    astFactory.makeASTRoot(currentAST, tmp115_AST);
-                    match(LITERAL_some);
-                    break;
-                  }
-                  default: {
-                    throw new NoViableAltException(LT(1), getFilename());
-                  }
-                }
-              }
-              additiveExpr();
-              astFactory.addASTChild(currentAST, returnAST);
-            } else {
-              throw new NoViableAltException(LT(1), getFilename());
-            }
-
-          }
-        } else {
-          break _loop213;
-        }
-
-      } while (true);
-    }
-    relationalExpr_AST = (AST) currentAST.root;
-    returnAST = relationalExpr_AST;
-  }
-
-  public final void additiveExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST additiveExpr_AST = null;
-
-    multiplicativeExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop217: do {
-        if ((_tokenSet_23.member(LA(1)))) {
-          {
-            switch (LA(1)) {
-              case TOK_PLUS: {
-                AST tmp116_AST = null;
-                tmp116_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp116_AST);
-                match(TOK_PLUS);
-                break;
-              }
-              case TOK_MINUS: {
-                AST tmp117_AST = null;
-                tmp117_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp117_AST);
-                match(TOK_MINUS);
-                break;
-              }
-              case TOK_CONCAT: {
-                AST tmp118_AST = null;
-                tmp118_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp118_AST);
-                match(TOK_CONCAT);
-                break;
-              }
-              case LITERAL_union: {
-                AST tmp119_AST = null;
-                tmp119_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp119_AST);
-                match(LITERAL_union);
-                break;
-              }
-              case LITERAL_except: {
-                AST tmp120_AST = null;
-                tmp120_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp120_AST);
-                match(LITERAL_except);
-                break;
-              }
-              default: {
-                throw new NoViableAltException(LT(1), getFilename());
-              }
-            }
-          }
-          multiplicativeExpr();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop217;
-        }
-
-      } while (true);
-    }
-    additiveExpr_AST = (AST) currentAST.root;
-    returnAST = additiveExpr_AST;
-  }
-
-  public final void multiplicativeExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST multiplicativeExpr_AST = null;
-
-    inExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop221: do {
-        if ((_tokenSet_24.member(LA(1)))) {
-          {
-            switch (LA(1)) {
-              case TOK_STAR: {
-                AST tmp121_AST = null;
-                tmp121_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp121_AST);
-                match(TOK_STAR);
-                break;
-              }
-              case TOK_SLASH: {
-                AST tmp122_AST = null;
-                tmp122_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp122_AST);
-                match(TOK_SLASH);
-                break;
-              }
-              case LITERAL_mod: {
-                AST tmp123_AST = null;
-                tmp123_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp123_AST);
-                match(LITERAL_mod);
-                break;
-              }
-              case LITERAL_intersect: {
-                AST tmp124_AST = null;
-                tmp124_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp124_AST);
-                match(LITERAL_intersect);
-                break;
-              }
-              default: {
-                throw new NoViableAltException(LT(1), getFilename());
-              }
-            }
-          }
-          inExpr();
-          astFactory.addASTChild(currentAST, returnAST);
-        } else {
-          break _loop221;
-        }
-
-      } while (true);
-    }
-    multiplicativeExpr_AST = (AST) currentAST.root;
-    returnAST = multiplicativeExpr_AST;
-  }
-
-  public final void inExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST inExpr_AST = null;
-
-    unaryExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      if ((LA(1) == LITERAL_in)) {
-        org.apache.geode.cache.query.internal.parse.ASTIn tmp125_AST = null;
-        tmp125_AST = (org.apache.geode.cache.query.internal.parse.ASTIn) astFactory.create(LT(1),
-            "org.apache.geode.cache.query.internal.parse.ASTIn");
-        astFactory.makeASTRoot(currentAST, tmp125_AST);
-        match(LITERAL_in);
-        unaryExpr();
-        astFactory.addASTChild(currentAST, returnAST);
-      } else if ((_tokenSet_25.member(LA(1)))) {
-      } else {
-        throw new NoViableAltException(LT(1), getFilename());
-      }
-
-    }
-    inExpr_AST = (AST) currentAST.root;
-    returnAST = inExpr_AST;
-  }
-
-  public final void unaryExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST unaryExpr_AST = null;
-
-    {
-      _loop227: do {
-        if ((_tokenSet_26.member(LA(1)))) {
-          {
-            switch (LA(1)) {
-              case TOK_PLUS: {
-                match(TOK_PLUS);
-                break;
-              }
-              case TOK_MINUS: {
-                org.apache.geode.cache.query.internal.parse.ASTUnary tmp127_AST = null;
-                tmp127_AST = (org.apache.geode.cache.query.internal.parse.ASTUnary) astFactory
-                    .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTUnary");
-                astFactory.makeASTRoot(currentAST, tmp127_AST);
-                match(TOK_MINUS);
-                break;
-              }
-              case LITERAL_abs: {
-                AST tmp128_AST = null;
-                tmp128_AST = astFactory.create(LT(1));
-                astFactory.makeASTRoot(currentAST, tmp128_AST);
-                match(LITERAL_abs);
-                break;
-              }
-              case LITERAL_not: {
-                org.apache.geode.cache.query.internal.parse.ASTUnary tmp129_AST = null;
-                tmp129_AST = (org.apache.geode.cache.query.internal.parse.ASTUnary) astFactory
-                    .create(LT(1), "org.apache.geode.cache.query.internal.parse.ASTUnary");
-                astFactory.makeASTRoot(currentAST, tmp129_AST);
-                match(LITERAL_not);
-                break;
-              }
-              default: {
-                throw new NoViableAltException(LT(1), getFilename());
-              }
-            }
-          }
-        } else {
-          break _loop227;
-        }
-
-      } while (true);
-    }
-    postfixExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    unaryExpr_AST = (AST) currentAST.root;
-    returnAST = unaryExpr_AST;
-  }
-
-  public final void postfixExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST postfixExpr_AST = null;
-    boolean cmplx = false;
-
-    primaryExpr();
-    astFactory.addASTChild(currentAST, returnAST);
-    {
-      _loop232: do {
-        if ((LA(1) == TOK_LBRACK)) {
-          match(TOK_LBRACK);
-          index();
-          astFactory.addASTChild(currentAST, returnAST);
-          match(TOK_RBRACK);
-          if (inputState.guessing == 0) {
-            cmplx = true;
-          }
-        } else if ((LA(1) == TOK_DOT || LA(1) == TOK_INDIRECT)) {
-          {
-            if ((LA(1) == TOK_DOT)) {
-              match(TOK_DOT);
-            } else if ((LA(1) == TOK_INDIRECT)) {
-              match(TOK_INDIRECT);
-            } else {
-              throw new NoViableAltException(LT(1), getFilename());
-            }
-
-          }
-          {
-            if ((LA(1) == QuotedIdentifier || LA(1) == Identifier) && (LA(2) == TOK_LPAREN)) {
-              methodInvocation(false);
-              astFactory.addASTChild(currentAST, returnAST);
-            } else if ((LA(1) == QuotedIdentifier || LA(1) == Identifier)
-                && (_tokenSet_27.member(LA(2)))) {
-              identifier();
-              astFactory.addASTChild(currentAST, returnAST);
-            } else {
-              throw new NoViableAltException(LT(1), getFilename());
-            }
-
-          }
-          if (inputState.guessing == 0) {
-            cmplx = true;
-          }
-        } else {
-          break _loop232;
-        }
-
-      } while (true);
-    }
-    if (inputState.guessing == 0) {
-      postfixExpr_AST = (AST) currentAST.root;
-      if (cmplx) {
-        postfixExpr_AST =
-            (AST) astFactory.make((new ASTArray(2))
-                .add((AST) astFactory.create(POSTFIX, "postfix",
-                    "org.apache.geode.cache.query.internal.parse.ASTPostfix"))
-                .add(postfixExpr_AST));
-      }
-
-      currentAST.root = postfixExpr_AST;
-      currentAST.child = postfixExpr_AST != null && postfixExpr_AST.getFirstChild() != null
-          ? postfixExpr_AST.getFirstChild() : postfixExpr_AST;
-      currentAST.advanceChildToEnd();
-    }
-    postfixExpr_AST = (AST) currentAST.root;
-    returnAST = postfixExpr_AST;
-  }
-
-  public final void primaryExpr() throws RecognitionException, TokenStreamException {
-
-    returnAST = null;
-    ASTPair currentAST = new ASTPair();
-    AST primaryExpr_AST = null;
-
-    {
-      switch (LA(1)) {
-        case LITERAL_distinct:
-        case LITERAL_listtoset:
-        case LITERAL_element:
-        case LITERAL_

<TRUNCATED>

[09/25] geode git commit: GEODE-2216: Throwing an exception if index creation fails.

Posted by km...@apache.org.
GEODE-2216: Throwing an exception if index creation fails.

Making sure index creation always throws an exception and cleans up the
index if the index creation fails. Adding a test that causes index
creation failure by failing to deserialize entries.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/703c8885
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/703c8885
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/703c8885

Branch: refs/heads/feature/GEODE-2231
Commit: 703c8885b96e4b81576e53018bd30708c99316ae
Parents: b440f4d
Author: Dan Smith <up...@apache.org>
Authored: Wed Dec 14 16:59:51 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../geode/internal/cache/PartitionedRegion.java | 16 +++-
 .../cache/PartitionedRegionQueryDUnitTest.java  | 78 +++++++++++++++++++-
 2 files changed, 89 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/703c8885/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 7c3f19b..6a67b59 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -8738,7 +8738,7 @@ public class PartitionedRegion extends LocalRegion
 
     // First step is creating all the defined indexes.
     // Do not send the IndexCreationMsg to remote nodes now.
-    throwException =
+    throwException |=
         createEmptyIndexes(indexDefinitions, remotelyOriginated, indexes, exceptionsMap);
 
     // If same indexes are created locally and also being created by a remote index creation msg
@@ -8751,18 +8751,26 @@ public class PartitionedRegion extends LocalRegion
 
     // Second step is iterating over REs and populating all the created indexes
     if (unpopulatedIndexes != null && unpopulatedIndexes.size() > 0) {
-      throwException = populateEmptyIndexes(unpopulatedIndexes, exceptionsMap);
+      throwException |= populateEmptyIndexes(unpopulatedIndexes, exceptionsMap);
     }
 
     // Third step is to send the message to remote nodes
     // Locally originated create index request.
     // Send create request to other PR nodes.
-    throwException =
+    throwException |=
         sendCreateIndexesMessage(remotelyOriginated, indexDefinitions, indexes, exceptionsMap);
 
     // If exception is throw in any of the above steps
     if (throwException) {
-      throw new MultiIndexCreationException(exceptionsMap);
+      try {
+        for (String indexName : exceptionsMap.keySet()) {
+          Index index = indexManager.getIndex(indexName);
+          indexManager.removeIndex(index);
+          removeIndex(index, remotelyOriginated);
+        }
+      } finally {
+        throw new MultiIndexCreationException(exceptionsMap);
+      }
     }
 
     // set the populate flag for all the created PR indexes

http://git-wip-us.apache.org/repos/asf/geode/blob/703c8885/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
index 0196542..a14e9ee 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
@@ -14,6 +14,12 @@
  */
 package org.apache.geode.internal.cache;
 
+import java.io.IOException;
+
+import org.apache.geode.DataSerializable;
+import org.apache.geode.cache.query.Struct;
+import org.apache.geode.test.dunit.DUnitEnv;
+import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.junit.experimental.categories.Category;
 import org.junit.Test;
 
@@ -23,6 +29,9 @@ import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
 import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
 import java.io.Serializable;
 import java.sql.Date;
 import java.util.Arrays;
@@ -31,6 +40,7 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.concurrent.CancellationException;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.IntStream;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheException;
@@ -149,6 +159,46 @@ public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
     });
   }
 
+  @Test
+  public void testFailureToCreateIndexOnRemoteNodeThrowsException() {
+    Host host = Host.getHost(0);
+    VM vm0 = host.getVM(0);
+    VM vm1 = host.getVM(-1);
+
+    SerializableRunnableIF createPR = () -> {
+      Cache cache = getCache();
+      PartitionAttributesFactory paf = new PartitionAttributesFactory();
+      paf.setTotalNumBuckets(10);
+      cache.createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(paf.create())
+          .create("region");
+    };
+    vm0.invoke(createPR);
+    vm1.invoke(createPR);
+
+    vm0.invoke(() -> {
+      Cache cache = getCache();
+      Region region = cache.getRegion("region");
+      IntStream.range(1, 10).forEach(i -> region.put(i, new NotDeserializableAsset()));
+    });
+
+    vm0.invoke(() -> {
+      Cache cache = getCache();
+      try {
+        cache.getQueryService().createHashIndex("ContractDocumentIndex", "document", "/region");
+        fail("Should have thrown an exception");
+      } catch (Exception expected) {
+      }
+    });
+
+    vm1.invoke(() -> {
+      Cache cache = getCache();
+      Region region = cache.getRegion("region");
+      final Index index = cache.getQueryService().getIndex(region, "ContractDocumentIndex");
+      assertEquals(null, index);
+    });
+
+  }
+
   /**
    * Test of bug 43102. 1. Buckets are created on several nodes 2. A query is started 3. While the
    * query is executing, several buckets are moved.
@@ -1091,7 +1141,33 @@ public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
 
   }
 
-  private class NestedKeywordObject implements Serializable {
+  public static class NotDeserializableAsset implements DataSerializable {
+    private int allowedPid;
+
+    public NotDeserializableAsset() {
+
+    }
+
+    public NotDeserializableAsset(final int allowedPid) {
+      this.allowedPid = allowedPid;
+    }
+
+    @Override
+    public void toData(final DataOutput out) throws IOException {
+      out.writeInt(allowedPid);
+
+    }
+
+    @Override
+    public void fromData(final DataInput in) throws IOException, ClassNotFoundException {
+      allowedPid = in.readInt();
+      if (allowedPid != DUnitEnv.get().getPid()) {
+        throw new IOException("Cannot deserialize");
+      }
+    }
+  }
+
+  public class NestedKeywordObject implements Serializable {
 
     public Object date;
     public Object nonKeyword;


[10/25] geode git commit: GEODE-1272 Don't deserialize PDX objects when creating an index

Posted by km...@apache.org.
GEODE-1272 Don't deserialize PDX objects when creating an index

Setting the flag to prevent deserialization of PDX objects while
populating an index that is defined on a partitioned region. We were
setting this flag in the member that initially created the index, but
not in other members that receive the IndexCreationMessage.

This closes #318


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/84bd6119
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/84bd6119
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/84bd6119

Branch: refs/heads/feature/GEODE-2231
Commit: 84bd6119094a796c09dd362d87919da5c957e372
Parents: 703c888
Author: Dan Smith <up...@apache.org>
Authored: Wed Dec 14 17:08:36 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../query/internal/index/IndexManager.java      |   3 +
 .../cache/PartitionedRegionQueryDUnitTest.java  | 177 +++++++++++++++++--
 2 files changed, 163 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/84bd6119/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java
index 27f239e..6cf9a3f 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/IndexManager.java
@@ -891,6 +891,8 @@ public class IndexManager {
     }
     boolean throwException = false;
     HashMap<String, Exception> exceptionsMap = new HashMap<String, Exception>();
+    boolean oldReadSerialized = DefaultQuery.getPdxReadSerialized();
+    DefaultQuery.setPdxReadSerialized(true);
     try {
       Iterator entryIter = ((LocalRegion) region).getBestIterator(true);
       while (entryIter.hasNext()) {
@@ -931,6 +933,7 @@ public class IndexManager {
         throw new MultiIndexCreationException(exceptionsMap);
       }
     } finally {
+      DefaultQuery.setPdxReadSerialized(oldReadSerialized);
       notifyAfterUpdate();
     }
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/84bd6119/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
index a14e9ee..eb918bc 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionQueryDUnitTest.java
@@ -14,10 +14,11 @@
  */
 package org.apache.geode.internal.cache;
 
-import java.io.IOException;
-
 import org.apache.geode.DataSerializable;
 import org.apache.geode.cache.query.Struct;
+import org.apache.geode.pdx.PdxReader;
+import org.apache.geode.pdx.PdxSerializable;
+import org.apache.geode.pdx.PdxWriter;
 import org.apache.geode.test.dunit.DUnitEnv;
 import org.apache.geode.test.dunit.SerializableRunnableIF;
 import org.junit.experimental.categories.Category;
@@ -26,20 +27,22 @@ import org.junit.Test;
 import static org.junit.Assert.*;
 
 import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
 import org.apache.geode.test.junit.categories.DistributedTest;
 
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import java.io.Serializable;
-import java.sql.Date;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 import java.util.concurrent.CancellationException;
 import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Function;
 import java.util.stream.IntStream;
 
 import org.apache.geode.cache.Cache;
@@ -66,7 +69,6 @@ import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.DefaultQuery;
 import org.apache.geode.cache.query.internal.index.IndexManager;
 import org.apache.geode.cache.query.internal.index.PartitionedIndex;
-import org.apache.geode.cache30.CacheTestCase;
 import org.apache.geode.distributed.internal.DistributionManager;
 import org.apache.geode.distributed.internal.DistributionMessage;
 import org.apache.geode.distributed.internal.DistributionMessageObserver;
@@ -89,9 +91,6 @@ import org.apache.geode.test.dunit.VM;
 @Category(DistributedTest.class)
 public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
 
-  /**
-   * @param name
-   */
   public PartitionedRegionQueryDUnitTest() {
     super();
     // TODO Auto-generated constructor stub
@@ -160,10 +159,99 @@ public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
   }
 
   @Test
+  public void testHashIndexDoesNotDeserializePdxObjects() {
+    SerializableRunnableIF createIndex = () -> {
+      Cache cache = getCache();
+      cache.getQueryService().createHashIndex("ContractDocumentIndex", "document", "/region");
+    };
+    String queryString = "select assetId,document from /region where document='B' limit 1000";
+
+    PdxAssetFactory value = i -> new PdxNotDeserializableAsset(i, Integer.toString(i));
+    createIndexDoesNotDerializePdxObjects(createIndex, queryString, value);
+  }
+
+  @Test
+  public void tesRangeIndexDoesNotDeserializePdxObjects() {
+    SerializableRunnableIF createIndex = () -> {
+      Cache cache = getCache();
+      cache.getQueryService().createIndex("ContractDocumentIndex", "ref",
+          "/region r, r.references ref");
+    };
+    String queryString =
+        "select r.assetId,r.document from /region r, r.references ref where ref='B_2' limit 1000";
+    PdxAssetFactory value = i -> new PdxNotDeserializableAsset(i, Integer.toString(i));
+    createIndexDoesNotDerializePdxObjects(createIndex, queryString, value);
+  }
+
+  @Test
+  public void tesRangeIndexWithPdxObjects() {
+    SerializableRunnableIF createIndex = () -> {
+      Cache cache = getCache();
+      cache.getQueryService().createIndex("ContractDocumentIndex", "ref",
+          "/region r, r.references ref");
+    };
+    String queryString = "select r from /region r, r.references ref where ref='B_2' limit 1000";
+
+    PdxAssetFactory value = i -> new PdxAsset(i, Integer.toString(i));
+    createIndexDoesNotDerializePdxObjects(createIndex, queryString, value);
+  }
+
+  private void createIndexDoesNotDerializePdxObjects(final SerializableRunnableIF createIndex,
+      final String queryString, PdxAssetFactory valueSupplier) {
+    Host host = Host.getHost(0);
+    VM vm0 = host.getVM(0);
+    VM vm1 = host.getVM(1);
+
+    SerializableRunnableIF createPR = () -> {
+      Cache cache = getCache();
+      PartitionAttributesFactory paf = new PartitionAttributesFactory();
+      paf.setTotalNumBuckets(10);
+      cache.createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(paf.create())
+          .create("region");
+    };
+    vm0.invoke(createPR);
+    vm1.invoke(createPR);
+
+    // Do Puts. These objects can't be deserialized because they throw
+    // and exception from the constructor
+    vm0.invoke(() -> {
+      Cache cache = getCache();
+      Region region = cache.getRegion("region");
+      region.put(0, new PdxNotDeserializableAsset(0, "B"));
+      region.put(10, new PdxNotDeserializableAsset(1, "B"));
+      region.put(1, new PdxNotDeserializableAsset(1, "B"));
+      IntStream.range(11, 100).forEach(i -> region.put(i, valueSupplier.getAsset(i)));
+    });
+
+    // If this tries to deserialize the assets, it will fail
+    vm0.invoke(createIndex);
+
+    vm0.invoke(() -> {
+      QueryService qs = getCache().getQueryService();
+      SelectResults<Struct> results = (SelectResults) qs.newQuery(queryString).execute();
+
+      assertEquals(3, results.size());
+      final Index index = qs.getIndex(getCache().getRegion("region"), "ContractDocumentIndex");
+      assertEquals(1, index.getStatistics().getTotalUses());
+    });
+  }
+
+  @Test
+  public void testFailureToCreateIndexOnLocalNodeThrowsException() {
+    VM vmToFailCreationOn = Host.getHost(0).getVM(0);
+    failToCreateIndexOnNode(vmToFailCreationOn);
+  }
+
+  @Test
   public void testFailureToCreateIndexOnRemoteNodeThrowsException() {
+    VM vmToFailCreationOn = Host.getHost(0).getVM(1);
+    failToCreateIndexOnNode(vmToFailCreationOn);
+  }
+
+  private void failToCreateIndexOnNode(final VM vmToFailCreationOn) {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
-    VM vm1 = host.getVM(-1);
+    VM vm1 = host.getVM(1);
 
     SerializableRunnableIF createPR = () -> {
       Cache cache = getCache();
@@ -178,7 +266,8 @@ public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
     vm0.invoke(() -> {
       Cache cache = getCache();
       Region region = cache.getRegion("region");
-      IntStream.range(1, 10).forEach(i -> region.put(i, new NotDeserializableAsset()));
+      IntStream.range(1, 10)
+          .forEach(i -> region.put(i, new NotDeserializableAsset(vmToFailCreationOn.getPid())));
     });
 
     vm0.invoke(() -> {
@@ -196,7 +285,6 @@ public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
       final Index index = cache.getQueryService().getIndex(region, "ContractDocumentIndex");
       assertEquals(null, index);
     });
-
   }
 
   /**
@@ -1141,27 +1229,82 @@ public class PartitionedRegionQueryDUnitTest extends JUnit4CacheTestCase {
 
   }
 
+  public interface PdxAssetFactory extends Serializable {
+    PdxAsset getAsset(int i);
+  }
+
+  public static class PdxNotDeserializableAsset extends PdxAsset {
+    public int assetId;
+    public String document;
+    public Collection<String> references = new ArrayList<String>();
+
+    public PdxNotDeserializableAsset() {
+      throw new RuntimeException("Preventing Deserialization of Asset");
+    }
+
+    public PdxNotDeserializableAsset(final int assetId, final String document) {
+      super(assetId, document);
+    }
+
+    @Override
+    public void fromData(final PdxReader reader) {
+      throw new RuntimeException("Not allowing us to deserialize one of these");
+    }
+  }
+
+  public static class PdxAsset implements PdxSerializable {
+    public int assetId;
+    public String document;
+    public Collection<String> references = new ArrayList<String>();
+
+    public PdxAsset() {
+
+    }
+
+    public PdxAsset(final int assetId, final String document) {
+      this.assetId = assetId;
+      this.document = document;
+      references.add(document + "_1");
+      references.add(document + "_2");
+      references.add(document + "_3");
+    }
+
+    @Override
+    public void toData(final PdxWriter writer) {
+      writer.writeString("document", document);
+      writer.writeInt("assetId", assetId);
+      writer.writeObject("references", references);
+    }
+
+    @Override
+    public void fromData(final PdxReader reader) {
+      this.document = reader.readString("document");
+      this.assetId = reader.readInt("assetId");
+      this.references = (Collection<String>) reader.readObject("references");
+    }
+  }
+
   public static class NotDeserializableAsset implements DataSerializable {
-    private int allowedPid;
+    private int disallowedPid;
 
     public NotDeserializableAsset() {
 
     }
 
-    public NotDeserializableAsset(final int allowedPid) {
-      this.allowedPid = allowedPid;
+    public NotDeserializableAsset(final int disallowedPid) {
+      this.disallowedPid = disallowedPid;
     }
 
     @Override
     public void toData(final DataOutput out) throws IOException {
-      out.writeInt(allowedPid);
+      out.writeInt(disallowedPid);
 
     }
 
     @Override
     public void fromData(final DataInput in) throws IOException, ClassNotFoundException {
-      allowedPid = in.readInt();
-      if (allowedPid != DUnitEnv.get().getPid()) {
+      disallowedPid = in.readInt();
+      if (disallowedPid == DUnitEnv.get().getPid()) {
         throw new IOException("Cannot deserialize");
       }
     }


[25/25] geode git commit: GEODE-2242: Invalid VersionTags are no longer replicated across the WAN

Posted by km...@apache.org.
GEODE-2242: Invalid VersionTags are no longer replicated across the WAN


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/e8b03881
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/e8b03881
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/e8b03881

Branch: refs/heads/feature/GEODE-2231
Commit: e8b03881317aaa254af641ce1d4d554b239ab002
Parents: 32b8a00
Author: Barry Oglesby <bo...@pivotal.io>
Authored: Wed Dec 21 15:06:37 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../cache/wan/GatewaySenderEventImpl.java       |  2 +-
 .../internal/cache/UpdateVersionDUnitTest.java  | 12 ++++---
 .../geode/internal/cache/wan/WANTestBase.java   |  5 +++
 .../SerialGatewaySenderQueueDUnitTest.java      |  7 +---
 .../serial/SerialWANPropagationDUnitTest.java   | 36 ++++++++++++++++++++
 5 files changed, 51 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/e8b03881/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java
index d4d21de..f8de085 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventImpl.java
@@ -289,7 +289,7 @@ public class GatewaySenderEventImpl
     // Initialize the creation timestamp
     this.creationTime = System.currentTimeMillis();
 
-    if (event.getVersionTag() != null) {
+    if (event.getVersionTag() != null && event.getVersionTag().hasValidVersion()) {
       this.versionTimeStamp = event.getVersionTag().getVersionTimeStamp();
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/e8b03881/geode-wan/src/test/java/org/apache/geode/internal/cache/UpdateVersionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/UpdateVersionDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/UpdateVersionDUnitTest.java
index 78a759e..6481ad5 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/UpdateVersionDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/UpdateVersionDUnitTest.java
@@ -130,6 +130,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             assertTrue(region instanceof PartitionedRegion);
 
             region.put(key, "value-1");
+            region.put(key, "value-2");
             Entry entry = region.getEntry(key);
             assertTrue(entry instanceof EntrySnapshot);
             RegionEntry regionEntry = ((EntrySnapshot) entry).getRegionEntry();
@@ -152,7 +153,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             tag.setIsRemoteForTesting();
 
             EntryEventImpl event =
-                createNewEvent((PartitionedRegion) region, tag, entry.getKey(), "value-2");
+                createNewEvent((PartitionedRegion) region, tag, entry.getKey(), "value-3");
 
             ((LocalRegion) region).basicUpdate(event, false, true, 0L, false);
 
@@ -277,6 +278,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             assertTrue(region instanceof DistributedRegion);
 
             region.put(key, "value-1");
+            region.put(key, "value-2");
             Entry entry = region.getEntry(key);
             assertTrue(entry instanceof NonTXEntry);
             RegionEntry regionEntry = ((NonTXEntry) entry).getRegionEntry();
@@ -299,7 +301,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             tag.setIsRemoteForTesting();
 
             EntryEventImpl event =
-                createNewEvent((DistributedRegion) region, tag, entry.getKey(), "value-2");
+                createNewEvent((DistributedRegion) region, tag, entry.getKey(), "value-3");
 
             ((LocalRegion) region).basicUpdate(event, false, true, 0L, false);
 
@@ -412,6 +414,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             assertTrue(region instanceof PartitionedRegion);
 
             region.put(key, "value-1");
+            region.put(key, "value-2");
             Entry entry = region.getEntry(key);
             assertTrue(entry instanceof EntrySnapshot);
             RegionEntry regionEntry = ((EntrySnapshot) entry).getRegionEntry();
@@ -434,7 +437,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             tag.setIsRemoteForTesting();
 
             EntryEventImpl event =
-                createNewEvent((PartitionedRegion) region, tag, entry.getKey(), "value-2");
+                createNewEvent((PartitionedRegion) region, tag, entry.getKey(), "value-3");
 
             ((LocalRegion) region).basicUpdate(event, false, true, 0L, false);
 
@@ -560,6 +563,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             assertTrue(region instanceof PartitionedRegion);
 
             region.put(key, "value-1");
+            region.put(key, "value-2");
             Entry entry = region.getEntry(key);
             assertTrue(entry instanceof EntrySnapshot);
             RegionEntry regionEntry = ((EntrySnapshot) entry).getRegionEntry();
@@ -582,7 +586,7 @@ public class UpdateVersionDUnitTest extends JUnit4DistributedTestCase {
             tag.setIsRemoteForTesting();
 
             EntryEventImpl event =
-                createNewEvent((PartitionedRegion) region, tag, entry.getKey(), "value-2");
+                createNewEvent((PartitionedRegion) region, tag, entry.getKey(), "value-3");
 
             ((LocalRegion) region).basicUpdate(event, false, true, 0L, false);
 

http://git-wip-us.apache.org/repos/asf/geode/blob/e8b03881/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java
index b0cece0..3f7f4c2 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/WANTestBase.java
@@ -3447,6 +3447,11 @@ public class WANTestBase extends JUnit4DistributedTestCase {
     }
   }
 
+  protected static void verifyListenerEvents(final long expectedNumEvents) {
+    Awaitility.await().atMost(60, TimeUnit.SECONDS)
+        .until(() -> listener1.getNumEvents() == expectedNumEvents);
+  }
+
   protected Integer[] createLNAndNYLocators() {
     Integer lnPort = vm0.invoke(() -> createFirstLocatorWithDSId(1));
     Integer nyPort = vm1.invoke(() -> createFirstRemoteLocator(2, lnPort));

http://git-wip-us.apache.org/repos/asf/geode/blob/e8b03881/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
index 7417c80..64f94dd 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueueDUnitTest.java
@@ -357,12 +357,7 @@ public class SerialGatewaySenderQueueDUnitTest extends WANTestBase {
     vm4.invoke(() -> WANTestBase.doPuts(getTestMethodName() + "_RR", numPuts));
 
     // Verify receiver listener events
-    vm2.invoke(() -> SerialGatewaySenderQueueDUnitTest.verifyListenerEvents(maxSenders * numPuts));
-  }
-
-  private static void verifyListenerEvents(final long expectedNumEvents) {
-    Awaitility.await().atMost(60, TimeUnit.SECONDS)
-        .until(() -> listener1.getNumEvents() == expectedNumEvents);
+    vm2.invoke(() -> WANTestBase.verifyListenerEvents(maxSenders * numPuts));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/e8b03881/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
index 28f8f0c..a60614c 100644
--- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java
@@ -19,6 +19,8 @@ import static org.junit.Assert.*;
 import java.io.IOException;
 import java.util.Map;
 
+import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.Scope;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -1262,4 +1264,38 @@ public class SerialWANPropagationDUnitTest extends WANTestBase {
     vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000));
     vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 1000));
   }
+
+  @Test
+  public void testPreloadedSerialPropagation() throws Exception {
+    // Start locators
+    Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
+    Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
+
+    // Create receiver and preloaded region
+    String regionName = getTestMethodName() + "_preloaded";
+    vm2.invoke(() -> WANTestBase.createCache(nyPort));
+    vm2.invoke(() -> WANTestBase.createReplicatedRegion(regionName, null, Scope.DISTRIBUTED_ACK,
+        DataPolicy.PRELOADED, isOffHeap()));
+    vm2.invoke(() -> WANTestBase.createReceiver());
+    vm2.invoke(() -> WANTestBase.addListenerOnRegion(regionName));
+
+    // Create sender and preloaded region
+    vm4.invoke(() -> WANTestBase.createCache(lnPort));
+    vm4.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 10, false, false, null, false));
+    vm4.invoke(() -> WANTestBase.createReplicatedRegion(regionName, "ln", Scope.DISTRIBUTED_ACK,
+        DataPolicy.PRELOADED, isOffHeap()));
+
+    // Do puts
+    int numEvents = 10;
+    vm4.invoke(() -> WANTestBase.doPuts(regionName, numEvents));
+
+    // Verify receiver listener events
+    vm2.invoke(() -> WANTestBase.verifyListenerEvents(numEvents));
+
+    // Do destroys
+    vm4.invoke(() -> WANTestBase.doDestroys(regionName, numEvents));
+
+    // Verify receiver listener events
+    vm2.invoke(() -> WANTestBase.verifyListenerEvents(numEvents * 2));
+  }
 }


[16/25] geode git commit: GEODE-2239 CI failure: org.apache.geode.pdx.JSONFormatterJUnitTest.testJSONFormatterAPIs

Posted by km...@apache.org.
GEODE-2239 CI failure: org.apache.geode.pdx.JSONFormatterJUnitTest.testJSONFormatterAPIs

Marking test as Flaky


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a67e496f
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a67e496f
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a67e496f

Branch: refs/heads/feature/GEODE-2231
Commit: a67e496f851ec09d68e6dd5b606123e5d44fb99d
Parents: 2a7209d
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Wed Dec 21 08:56:48 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../test/java/org/apache/geode/pdx/JSONFormatterJUnitTest.java    | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/a67e496f/geode-core/src/test/java/org/apache/geode/pdx/JSONFormatterJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/pdx/JSONFormatterJUnitTest.java b/geode-core/src/test/java/org/apache/geode/pdx/JSONFormatterJUnitTest.java
index 704bca9..979da13 100755
--- a/geode-core/src/test/java/org/apache/geode/pdx/JSONFormatterJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/pdx/JSONFormatterJUnitTest.java
@@ -22,6 +22,7 @@ import java.text.SimpleDateFormat;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.geode.test.junit.categories.FlakyTest;
 import org.apache.geode.test.junit.categories.SerializationTest;
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -202,6 +203,8 @@ public class JSONFormatterJUnitTest {
   }
 
   @Test
+  @Category(value = FlakyTest.class) // GEODE-2239 this test uses fixed port 40405 & fails if it
+                                     // isn't available
   public void testJSONFormatterAPIs() {
     ValidatePdxInstanceToJsonConversion();
     verifyJsonToPdxInstanceConversion();


[06/25] geode git commit: GEODE-165: Removed OQL generated files and added the target into geode-core/build.gradle.

Posted by km...@apache.org.
http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexer.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexer.java
deleted file mode 100644
index 56d19d3..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexer.java
+++ /dev/null
@@ -1,3471 +0,0 @@
-// $ANTLR 2.7.4: "oql.g" -> "OQLLexer.java"$
-
-package org.apache.geode.cache.query.internal.parse;
-
-import java.util.*;
-import org.apache.geode.cache.query.internal.types.*;
-
-import java.io.InputStream;
-import antlr.TokenStreamException;
-import antlr.TokenStreamIOException;
-import antlr.TokenStreamRecognitionException;
-import antlr.CharStreamException;
-import antlr.CharStreamIOException;
-import antlr.ANTLRException;
-import java.io.Reader;
-import java.util.Hashtable;
-import antlr.CharScanner;
-import antlr.InputBuffer;
-import antlr.ByteBuffer;
-import antlr.CharBuffer;
-import antlr.Token;
-import antlr.CommonToken;
-import antlr.RecognitionException;
-import antlr.NoViableAltForCharException;
-import antlr.MismatchedCharException;
-import antlr.TokenStream;
-import antlr.ANTLRHashString;
-import antlr.LexerSharedInputState;
-import antlr.collections.impl.BitSet;
-import antlr.SemanticException;
-
-public class OQLLexer extends antlr.CharScanner implements OQLLexerTokenTypes, TokenStream {
-
-  static {
-    // Set up type names for verbose AST printing
-    antlr.BaseAST.setVerboseStringConversion(true, OQLParser._tokenNames);
-  }
-
-  protected Token makeToken(int t) {
-    Token tok = super.makeToken(t);
-    if (tok.getType() == EOF)
-      tok.setText("EOF");
-    if (tok.getText() == null) {
-      tok.setText("(no text)");
-    }
-    return tok;
-  }
-
-  public OQLLexer(InputStream in) {
-    this(new ByteBuffer(in));
-  }
-
-  public OQLLexer(Reader in) {
-    this(new CharBuffer(in));
-  }
-
-  public OQLLexer(InputBuffer ib) {
-    this(new LexerSharedInputState(ib));
-  }
-
-  public OQLLexer(LexerSharedInputState state) {
-    super(state);
-    caseSensitiveLiterals = false;
-    setCaseSensitive(false);
-    literals = new Hashtable();
-    literals.put(new ANTLRHashString("type", this), new Integer(78));
-    literals.put(new ANTLRHashString("byte", this), new Integer(131));
-    literals.put(new ANTLRHashString("list", this), new Integer(122));
-    literals.put(new ANTLRHashString("undefine", this), new Integer(72));
-    literals.put(new ANTLRHashString("time", this), new Integer(135));
-    literals.put(new ANTLRHashString("short", this), new Integer(123));
-    literals.put(new ANTLRHashString("dictionary", this), new Integer(139));
-    literals.put(new ANTLRHashString("listtoset", this), new Integer(103));
-    literals.put(new ANTLRHashString("abs", this), new Integer(101));
-    literals.put(new ANTLRHashString("timestamp", this), new Integer(137));
-    literals.put(new ANTLRHashString("limit", this), new Integer(80));
-    literals.put(new ANTLRHashString("distinct", this), new Integer(74));
-    literals.put(new ANTLRHashString("octet", this), new Integer(132));
-    literals.put(new ANTLRHashString("where", this), new Integer(79));
-    literals.put(new ANTLRHashString("orelse", this), new Integer(89));
-    literals.put(new ANTLRHashString("select", this), new Integer(73));
-    literals.put(new ANTLRHashString("and", this), new Integer(90));
-    literals.put(new ANTLRHashString("float", this), new Integer(126));
-    literals.put(new ANTLRHashString("not", this), new Integer(102));
-    literals.put(new ANTLRHashString("interval", this), new Integer(136));
-    literals.put(new ANTLRHashString("date", this), new Integer(134));
-    literals.put(new ANTLRHashString("from", this), new Integer(76));
-    literals.put(new ANTLRHashString("null", this), new Integer(142));
-    literals.put(new ANTLRHashString("flatten", this), new Integer(105));
-    literals.put(new ANTLRHashString("count", this), new Integer(115));
-    literals.put(new ANTLRHashString("last", this), new Integer(109));
-    literals.put(new ANTLRHashString("query", this), new Integer(71));
-    literals.put(new ANTLRHashString("mod", this), new Integer(99));
-    literals.put(new ANTLRHashString("trace", this), new Integer(66));
-    literals.put(new ANTLRHashString("nvl", this), new Integer(106));
-    literals.put(new ANTLRHashString("like", this), new Integer(96));
-    literals.put(new ANTLRHashString("except", this), new Integer(98));
-    literals.put(new ANTLRHashString("set", this), new Integer(120));
-    literals.put(new ANTLRHashString("to_date", this), new Integer(107));
-    literals.put(new ANTLRHashString("intersect", this), new Integer(100));
-    literals.put(new ANTLRHashString("map", this), new Integer(140));
-    literals.put(new ANTLRHashString("array", this), new Integer(119));
-    literals.put(new ANTLRHashString("or", this), new Integer(88));
-    literals.put(new ANTLRHashString("any", this), new Integer(94));
-    literals.put(new ANTLRHashString("double", this), new Integer(127));
-    literals.put(new ANTLRHashString("min", this), new Integer(113));
-    literals.put(new ANTLRHashString("as", this), new Integer(68));
-    literals.put(new ANTLRHashString("first", this), new Integer(108));
-    literals.put(new ANTLRHashString("by", this), new Integer(82));
-    literals.put(new ANTLRHashString("all", this), new Integer(75));
-    literals.put(new ANTLRHashString("union", this), new Integer(97));
-    literals.put(new ANTLRHashString("order", this), new Integer(85));
-    literals.put(new ANTLRHashString("is_defined", this), new Integer(117));
-    literals.put(new ANTLRHashString("collection", this), new Integer(138));
-    literals.put(new ANTLRHashString("some", this), new Integer(95));
-    literals.put(new ANTLRHashString("enum", this), new Integer(133));
-    literals.put(new ANTLRHashString("declare", this), new Integer(69));
-    literals.put(new ANTLRHashString("int", this), new Integer(125));
-    literals.put(new ANTLRHashString("for", this), new Integer(91));
-    literals.put(new ANTLRHashString("is_undefined", this), new Integer(116));
-    literals.put(new ANTLRHashString("boolean", this), new Integer(130));
-    literals.put(new ANTLRHashString("char", this), new Integer(128));
-    literals.put(new ANTLRHashString("define", this), new Integer(70));
-    literals.put(new ANTLRHashString("element", this), new Integer(104));
-    literals.put(new ANTLRHashString("string", this), new Integer(129));
-    literals.put(new ANTLRHashString("hint", this), new Integer(84));
-    literals.put(new ANTLRHashString("false", this), new Integer(145));
-    literals.put(new ANTLRHashString("exists", this), new Integer(92));
-    literals.put(new ANTLRHashString("asc", this), new Integer(86));
-    literals.put(new ANTLRHashString("undefined", this), new Integer(143));
-    literals.put(new ANTLRHashString("desc", this), new Integer(87));
-    literals.put(new ANTLRHashString("bag", this), new Integer(121));
-    literals.put(new ANTLRHashString("max", this), new Integer(114));
-    literals.put(new ANTLRHashString("sum", this), new Integer(111));
-    literals.put(new ANTLRHashString("struct", this), new Integer(118));
-    literals.put(new ANTLRHashString("import", this), new Integer(67));
-    literals.put(new ANTLRHashString("in", this), new Integer(77));
-    literals.put(new ANTLRHashString("avg", this), new Integer(112));
-    literals.put(new ANTLRHashString("true", this), new Integer(144));
-    literals.put(new ANTLRHashString("long", this), new Integer(124));
-    literals.put(new ANTLRHashString("nil", this), new Integer(141));
-    literals.put(new ANTLRHashString("group", this), new Integer(81));
-    literals.put(new ANTLRHashString("having", this), new Integer(83));
-    literals.put(new ANTLRHashString("unique", this), new Integer(110));
-    literals.put(new ANTLRHashString("andthen", this), new Integer(93));
-  }
-
-  public Token nextToken() throws TokenStreamException {
-    Token theRetToken = null;
-    tryAgain: for (;;) {
-      Token _token = null;
-      int _ttype = Token.INVALID_TYPE;
-      resetText();
-      try { // for char stream error handling
-        try { // for lexical error handling
-          switch (LA(1)) {
-            case ')': {
-              mTOK_RPAREN(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '(': {
-              mTOK_LPAREN(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case ',': {
-              mTOK_COMMA(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case ';': {
-              mTOK_SEMIC(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case ':': {
-              mTOK_COLON(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '|': {
-              mTOK_CONCAT(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '=': {
-              mTOK_EQ(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '+': {
-              mTOK_PLUS(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '*': {
-              mTOK_STAR(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '!': {
-              mTOK_NE_ALT(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '[': {
-              mTOK_LBRACK(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case ']': {
-              mTOK_RBRACK(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '$': {
-              mTOK_DOLLAR(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '"': {
-              mQuotedIdentifier(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '\'': {
-              mStringLiteral(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '0':
-            case '1':
-            case '2':
-            case '3':
-            case '4':
-            case '5':
-            case '6':
-            case '7':
-            case '8':
-            case '9': {
-              mNUM_INT(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            case '\t':
-            case '\n':
-            case '\u000c':
-            case '\r':
-            case ' ': {
-              mWS(true);
-              theRetToken = _returnToken;
-              break;
-            }
-            default:
-              if ((LA(1) == '.') && (LA(2) == '.')) {
-                mTOK_DOTDOT(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '-') && (LA(2) == '>')) {
-                mTOK_INDIRECT(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '<') && (LA(2) == '=')) {
-                mTOK_LE(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '>') && (LA(2) == '=')) {
-                mTOK_GE(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '<') && (LA(2) == '>')) {
-                mTOK_NE(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '/') && (_tokenSet_0.member(LA(2)))) {
-                mRegionPath(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '-') && (LA(2) == '-')) {
-                mSL_COMMENT(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '/') && (LA(2) == '*')) {
-                mML_COMMENT(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '.') && (true)) {
-                mTOK_DOT(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '-') && (true)) {
-                mTOK_MINUS(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '/') && (true)) {
-                mTOK_SLASH(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '<') && (true)) {
-                mTOK_LT(true);
-                theRetToken = _returnToken;
-              } else if ((LA(1) == '>') && (true)) {
-                mTOK_GT(true);
-                theRetToken = _returnToken;
-              } else if ((_tokenSet_1.member(LA(1)))) {
-                mIdentifier(true);
-                theRetToken = _returnToken;
-              } else {
-                if (LA(1) == EOF_CHAR) {
-                  uponEOF();
-                  _returnToken = makeToken(Token.EOF_TYPE);
-                } else {
-                  throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                      getColumn());
-                }
-              }
-          }
-          if (_returnToken == null)
-            continue tryAgain; // found SKIP token
-          _ttype = _returnToken.getType();
-          _returnToken.setType(_ttype);
-          return _returnToken;
-        } catch (RecognitionException e) {
-          throw new TokenStreamRecognitionException(e);
-        }
-      } catch (CharStreamException cse) {
-        if (cse instanceof CharStreamIOException) {
-          throw new TokenStreamIOException(((CharStreamIOException) cse).io);
-        } else {
-          throw new TokenStreamException(cse.getMessage());
-        }
-      }
-    }
-  }
-
-  public final void mTOK_RPAREN(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_RPAREN;
-    int _saveIndex;
-
-    match(')');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_LPAREN(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_LPAREN;
-    int _saveIndex;
-
-    match('(');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_COMMA(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_COMMA;
-    int _saveIndex;
-
-    match(',');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_SEMIC(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_SEMIC;
-    int _saveIndex;
-
-    match(';');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_DOTDOT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_DOTDOT;
-    int _saveIndex;
-
-    match("..");
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_COLON(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_COLON;
-    int _saveIndex;
-
-    match(':');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_DOT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_DOT;
-    int _saveIndex;
-
-    match('.');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_INDIRECT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_INDIRECT;
-    int _saveIndex;
-
-    match('-');
-    match('>');
-    if (inputState.guessing == 0) {
-      _ttype = TOK_DOT;
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_CONCAT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_CONCAT;
-    int _saveIndex;
-
-    match('|');
-    match('|');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_EQ(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_EQ;
-    int _saveIndex;
-
-    match('=');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_PLUS(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_PLUS;
-    int _saveIndex;
-
-    match('+');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_MINUS(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_MINUS;
-    int _saveIndex;
-
-    match('-');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_SLASH(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_SLASH;
-    int _saveIndex;
-
-    match('/');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_STAR(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_STAR;
-    int _saveIndex;
-
-    match('*');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_LE(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_LE;
-    int _saveIndex;
-
-    match('<');
-    match('=');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_GE(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_GE;
-    int _saveIndex;
-
-    match('>');
-    match('=');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_NE(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_NE;
-    int _saveIndex;
-
-    match('<');
-    match('>');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_NE_ALT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_NE_ALT;
-    int _saveIndex;
-
-    match('!');
-    match('=');
-    if (inputState.guessing == 0) {
-      _ttype = TOK_NE;
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_LT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_LT;
-    int _saveIndex;
-
-    match('<');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_GT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_GT;
-    int _saveIndex;
-
-    match('>');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_LBRACK(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_LBRACK;
-    int _saveIndex;
-
-    match('[');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_RBRACK(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_RBRACK;
-    int _saveIndex;
-
-    match(']');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mTOK_DOLLAR(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = TOK_DOLLAR;
-    int _saveIndex;
-
-    match('$');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mLETTER(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = LETTER;
-    int _saveIndex;
-
-    {
-      switch (LA(1)) {
-        case 'a':
-        case 'b':
-        case 'c':
-        case 'd':
-        case 'e':
-        case 'f':
-        case 'g':
-        case 'h':
-        case 'i':
-        case 'j':
-        case 'k':
-        case 'l':
-        case 'm':
-        case 'n':
-        case 'o':
-        case 'p':
-        case 'q':
-        case 'r':
-        case 's':
-        case 't':
-        case 'u':
-        case 'v':
-        case 'w':
-        case 'x':
-        case 'y':
-        case 'z': {
-          matchRange('\u0061', '\u007a');
-          break;
-        }
-        case '\u00c0':
-        case '\u00c1':
-        case '\u00c2':
-        case '\u00c3':
-        case '\u00c4':
-        case '\u00c5':
-        case '\u00c6':
-        case '\u00c7':
-        case '\u00c8':
-        case '\u00c9':
-        case '\u00ca':
-        case '\u00cb':
-        case '\u00cc':
-        case '\u00cd':
-        case '\u00ce':
-        case '\u00cf':
-        case '\u00d0':
-        case '\u00d1':
-        case '\u00d2':
-        case '\u00d3':
-        case '\u00d4':
-        case '\u00d5':
-        case '\u00d6': {
-          matchRange('\u00c0', '\u00d6');
-          break;
-        }
-        case '\u00a1':
-        case '\u00a2':
-        case '\u00a3':
-        case '\u00a4':
-        case '\u00a5':
-        case '\u00a6':
-        case '\u00a7':
-        case '\u00a8':
-        case '\u00a9':
-        case '\u00aa':
-        case '\u00ab':
-        case '\u00ac':
-        case '\u00ad':
-        case '\u00ae':
-        case '\u00af':
-        case '\u00b0':
-        case '\u00b1':
-        case '\u00b2':
-        case '\u00b3':
-        case '\u00b4':
-        case '\u00b5':
-        case '\u00b6':
-        case '\u00b7':
-        case '\u00b8':
-        case '\u00b9':
-        case '\u00ba':
-        case '\u00bb':
-        case '\u00bc':
-        case '\u00bd':
-        case '\u00be':
-        case '\u00bf': {
-          matchRange('\u00a1', '\u00bf');
-          break;
-        }
-        case '\u00d8':
-        case '\u00d9':
-        case '\u00da':
-        case '\u00db':
-        case '\u00dc':
-        case '\u00dd':
-        case '\u00de':
-        case '\u00df':
-        case '\u00e0':
-        case '\u00e1':
-        case '\u00e2':
-        case '\u00e3':
-        case '\u00e4':
-        case '\u00e5':
-        case '\u00e6':
-        case '\u00e7':
-        case '\u00e8':
-        case '\u00e9':
-        case '\u00ea':
-        case '\u00eb':
-        case '\u00ec':
-        case '\u00ed':
-        case '\u00ee':
-        case '\u00ef':
-        case '\u00f0':
-        case '\u00f1':
-        case '\u00f2':
-        case '\u00f3':
-        case '\u00f4':
-        case '\u00f5':
-        case '\u00f6': {
-          matchRange('\u00d8', '\u00f6');
-          break;
-        }
-        case '\u00f8':
-        case '\u00f9':
-        case '\u00fa':
-        case '\u00fb':
-        case '\u00fc':
-        case '\u00fd':
-        case '\u00fe':
-        case '\u00ff': {
-          matchRange('\u00f8', '\u00ff');
-          break;
-        }
-        case '\u0970':
-        case '\u0971':
-        case '\u0972':
-        case '\u0973':
-        case '\u0974':
-        case '\u0975':
-        case '\u0976':
-        case '\u0977':
-        case '\u0978':
-        case '\u0979':
-        case '\u097a':
-        case '\u097b':
-        case '\u097c':
-        case '\u097d':
-        case '\u097e':
-        case '\u097f':
-        case '\u0980':
-        case '\u0981':
-        case '\u0982':
-        case '\u0983':
-        case '\u0984':
-        case '\u0985':
-        case '\u0986':
-        case '\u0987':
-        case '\u0988':
-        case '\u0989':
-        case '\u098a':
-        case '\u098b':
-        case '\u098c':
-        case '\u098d':
-        case '\u098e':
-        case '\u098f':
-        case '\u0990':
-        case '\u0991':
-        case '\u0992':
-        case '\u0993':
-        case '\u0994':
-        case '\u0995':
-        case '\u0996':
-        case '\u0997':
-        case '\u0998':
-        case '\u0999':
-        case '\u099a':
-        case '\u099b':
-        case '\u099c':
-        case '\u099d':
-        case '\u099e':
-        case '\u099f':
-        case '\u09a0':
-        case '\u09a1':
-        case '\u09a2':
-        case '\u09a3':
-        case '\u09a4':
-        case '\u09a5':
-        case '\u09a6':
-        case '\u09a7':
-        case '\u09a8':
-        case '\u09a9':
-        case '\u09aa':
-        case '\u09ab':
-        case '\u09ac':
-        case '\u09ad':
-        case '\u09ae':
-        case '\u09af':
-        case '\u09b0':
-        case '\u09b1':
-        case '\u09b2':
-        case '\u09b3':
-        case '\u09b4':
-        case '\u09b5':
-        case '\u09b6':
-        case '\u09b7':
-        case '\u09b8':
-        case '\u09b9':
-        case '\u09ba':
-        case '\u09bb':
-        case '\u09bc':
-        case '\u09bd':
-        case '\u09be':
-        case '\u09bf':
-        case '\u09c0':
-        case '\u09c1':
-        case '\u09c2':
-        case '\u09c3':
-        case '\u09c4':
-        case '\u09c5':
-        case '\u09c6':
-        case '\u09c7':
-        case '\u09c8':
-        case '\u09c9':
-        case '\u09ca':
-        case '\u09cb':
-        case '\u09cc':
-        case '\u09cd':
-        case '\u09ce':
-        case '\u09cf':
-        case '\u09d0':
-        case '\u09d1':
-        case '\u09d2':
-        case '\u09d3':
-        case '\u09d4':
-        case '\u09d5':
-        case '\u09d6':
-        case '\u09d7':
-        case '\u09d8':
-        case '\u09d9':
-        case '\u09da':
-        case '\u09db':
-        case '\u09dc':
-        case '\u09dd':
-        case '\u09de':
-        case '\u09df':
-        case '\u09e0':
-        case '\u09e1':
-        case '\u09e2':
-        case '\u09e3':
-        case '\u09e4':
-        case '\u09e5': {
-          matchRange('\u0970', '\u09e5');
-          break;
-        }
-        case '\u09f0':
-        case '\u09f1':
-        case '\u09f2':
-        case '\u09f3':
-        case '\u09f4':
-        case '\u09f5':
-        case '\u09f6':
-        case '\u09f7':
-        case '\u09f8':
-        case '\u09f9':
-        case '\u09fa':
-        case '\u09fb':
-        case '\u09fc':
-        case '\u09fd':
-        case '\u09fe':
-        case '\u09ff':
-        case '\u0a00':
-        case '\u0a01':
-        case '\u0a02':
-        case '\u0a03':
-        case '\u0a04':
-        case '\u0a05':
-        case '\u0a06':
-        case '\u0a07':
-        case '\u0a08':
-        case '\u0a09':
-        case '\u0a0a':
-        case '\u0a0b':
-        case '\u0a0c':
-        case '\u0a0d':
-        case '\u0a0e':
-        case '\u0a0f':
-        case '\u0a10':
-        case '\u0a11':
-        case '\u0a12':
-        case '\u0a13':
-        case '\u0a14':
-        case '\u0a15':
-        case '\u0a16':
-        case '\u0a17':
-        case '\u0a18':
-        case '\u0a19':
-        case '\u0a1a':
-        case '\u0a1b':
-        case '\u0a1c':
-        case '\u0a1d':
-        case '\u0a1e':
-        case '\u0a1f':
-        case '\u0a20':
-        case '\u0a21':
-        case '\u0a22':
-        case '\u0a23':
-        case '\u0a24':
-        case '\u0a25':
-        case '\u0a26':
-        case '\u0a27':
-        case '\u0a28':
-        case '\u0a29':
-        case '\u0a2a':
-        case '\u0a2b':
-        case '\u0a2c':
-        case '\u0a2d':
-        case '\u0a2e':
-        case '\u0a2f':
-        case '\u0a30':
-        case '\u0a31':
-        case '\u0a32':
-        case '\u0a33':
-        case '\u0a34':
-        case '\u0a35':
-        case '\u0a36':
-        case '\u0a37':
-        case '\u0a38':
-        case '\u0a39':
-        case '\u0a3a':
-        case '\u0a3b':
-        case '\u0a3c':
-        case '\u0a3d':
-        case '\u0a3e':
-        case '\u0a3f':
-        case '\u0a40':
-        case '\u0a41':
-        case '\u0a42':
-        case '\u0a43':
-        case '\u0a44':
-        case '\u0a45':
-        case '\u0a46':
-        case '\u0a47':
-        case '\u0a48':
-        case '\u0a49':
-        case '\u0a4a':
-        case '\u0a4b':
-        case '\u0a4c':
-        case '\u0a4d':
-        case '\u0a4e':
-        case '\u0a4f':
-        case '\u0a50':
-        case '\u0a51':
-        case '\u0a52':
-        case '\u0a53':
-        case '\u0a54':
-        case '\u0a55':
-        case '\u0a56':
-        case '\u0a57':
-        case '\u0a58':
-        case '\u0a59':
-        case '\u0a5a':
-        case '\u0a5b':
-        case '\u0a5c':
-        case '\u0a5d':
-        case '\u0a5e':
-        case '\u0a5f':
-        case '\u0a60':
-        case '\u0a61':
-        case '\u0a62':
-        case '\u0a63':
-        case '\u0a64':
-        case '\u0a65': {
-          matchRange('\u09f0', '\u0a65');
-          break;
-        }
-        case '\u0a70':
-        case '\u0a71':
-        case '\u0a72':
-        case '\u0a73':
-        case '\u0a74':
-        case '\u0a75':
-        case '\u0a76':
-        case '\u0a77':
-        case '\u0a78':
-        case '\u0a79':
-        case '\u0a7a':
-        case '\u0a7b':
-        case '\u0a7c':
-        case '\u0a7d':
-        case '\u0a7e':
-        case '\u0a7f':
-        case '\u0a80':
-        case '\u0a81':
-        case '\u0a82':
-        case '\u0a83':
-        case '\u0a84':
-        case '\u0a85':
-        case '\u0a86':
-        case '\u0a87':
-        case '\u0a88':
-        case '\u0a89':
-        case '\u0a8a':
-        case '\u0a8b':
-        case '\u0a8c':
-        case '\u0a8d':
-        case '\u0a8e':
-        case '\u0a8f':
-        case '\u0a90':
-        case '\u0a91':
-        case '\u0a92':
-        case '\u0a93':
-        case '\u0a94':
-        case '\u0a95':
-        case '\u0a96':
-        case '\u0a97':
-        case '\u0a98':
-        case '\u0a99':
-        case '\u0a9a':
-        case '\u0a9b':
-        case '\u0a9c':
-        case '\u0a9d':
-        case '\u0a9e':
-        case '\u0a9f':
-        case '\u0aa0':
-        case '\u0aa1':
-        case '\u0aa2':
-        case '\u0aa3':
-        case '\u0aa4':
-        case '\u0aa5':
-        case '\u0aa6':
-        case '\u0aa7':
-        case '\u0aa8':
-        case '\u0aa9':
-        case '\u0aaa':
-        case '\u0aab':
-        case '\u0aac':
-        case '\u0aad':
-        case '\u0aae':
-        case '\u0aaf':
-        case '\u0ab0':
-        case '\u0ab1':
-        case '\u0ab2':
-        case '\u0ab3':
-        case '\u0ab4':
-        case '\u0ab5':
-        case '\u0ab6':
-        case '\u0ab7':
-        case '\u0ab8':
-        case '\u0ab9':
-        case '\u0aba':
-        case '\u0abb':
-        case '\u0abc':
-        case '\u0abd':
-        case '\u0abe':
-        case '\u0abf':
-        case '\u0ac0':
-        case '\u0ac1':
-        case '\u0ac2':
-        case '\u0ac3':
-        case '\u0ac4':
-        case '\u0ac5':
-        case '\u0ac6':
-        case '\u0ac7':
-        case '\u0ac8':
-        case '\u0ac9':
-        case '\u0aca':
-        case '\u0acb':
-        case '\u0acc':
-        case '\u0acd':
-        case '\u0ace':
-        case '\u0acf':
-        case '\u0ad0':
-        case '\u0ad1':
-        case '\u0ad2':
-        case '\u0ad3':
-        case '\u0ad4':
-        case '\u0ad5':
-        case '\u0ad6':
-        case '\u0ad7':
-        case '\u0ad8':
-        case '\u0ad9':
-        case '\u0ada':
-        case '\u0adb':
-        case '\u0adc':
-        case '\u0add':
-        case '\u0ade':
-        case '\u0adf':
-        case '\u0ae0':
-        case '\u0ae1':
-        case '\u0ae2':
-        case '\u0ae3':
-        case '\u0ae4':
-        case '\u0ae5': {
-          matchRange('\u0a70', '\u0ae5');
-          break;
-        }
-        case '\u0af0':
-        case '\u0af1':
-        case '\u0af2':
-        case '\u0af3':
-        case '\u0af4':
-        case '\u0af5':
-        case '\u0af6':
-        case '\u0af7':
-        case '\u0af8':
-        case '\u0af9':
-        case '\u0afa':
-        case '\u0afb':
-        case '\u0afc':
-        case '\u0afd':
-        case '\u0afe':
-        case '\u0aff':
-        case '\u0b00':
-        case '\u0b01':
-        case '\u0b02':
-        case '\u0b03':
-        case '\u0b04':
-        case '\u0b05':
-        case '\u0b06':
-        case '\u0b07':
-        case '\u0b08':
-        case '\u0b09':
-        case '\u0b0a':
-        case '\u0b0b':
-        case '\u0b0c':
-        case '\u0b0d':
-        case '\u0b0e':
-        case '\u0b0f':
-        case '\u0b10':
-        case '\u0b11':
-        case '\u0b12':
-        case '\u0b13':
-        case '\u0b14':
-        case '\u0b15':
-        case '\u0b16':
-        case '\u0b17':
-        case '\u0b18':
-        case '\u0b19':
-        case '\u0b1a':
-        case '\u0b1b':
-        case '\u0b1c':
-        case '\u0b1d':
-        case '\u0b1e':
-        case '\u0b1f':
-        case '\u0b20':
-        case '\u0b21':
-        case '\u0b22':
-        case '\u0b23':
-        case '\u0b24':
-        case '\u0b25':
-        case '\u0b26':
-        case '\u0b27':
-        case '\u0b28':
-        case '\u0b29':
-        case '\u0b2a':
-        case '\u0b2b':
-        case '\u0b2c':
-        case '\u0b2d':
-        case '\u0b2e':
-        case '\u0b2f':
-        case '\u0b30':
-        case '\u0b31':
-        case '\u0b32':
-        case '\u0b33':
-        case '\u0b34':
-        case '\u0b35':
-        case '\u0b36':
-        case '\u0b37':
-        case '\u0b38':
-        case '\u0b39':
-        case '\u0b3a':
-        case '\u0b3b':
-        case '\u0b3c':
-        case '\u0b3d':
-        case '\u0b3e':
-        case '\u0b3f':
-        case '\u0b40':
-        case '\u0b41':
-        case '\u0b42':
-        case '\u0b43':
-        case '\u0b44':
-        case '\u0b45':
-        case '\u0b46':
-        case '\u0b47':
-        case '\u0b48':
-        case '\u0b49':
-        case '\u0b4a':
-        case '\u0b4b':
-        case '\u0b4c':
-        case '\u0b4d':
-        case '\u0b4e':
-        case '\u0b4f':
-        case '\u0b50':
-        case '\u0b51':
-        case '\u0b52':
-        case '\u0b53':
-        case '\u0b54':
-        case '\u0b55':
-        case '\u0b56':
-        case '\u0b57':
-        case '\u0b58':
-        case '\u0b59':
-        case '\u0b5a':
-        case '\u0b5b':
-        case '\u0b5c':
-        case '\u0b5d':
-        case '\u0b5e':
-        case '\u0b5f':
-        case '\u0b60':
-        case '\u0b61':
-        case '\u0b62':
-        case '\u0b63':
-        case '\u0b64':
-        case '\u0b65': {
-          matchRange('\u0af0', '\u0b65');
-          break;
-        }
-        case '\u0b70':
-        case '\u0b71':
-        case '\u0b72':
-        case '\u0b73':
-        case '\u0b74':
-        case '\u0b75':
-        case '\u0b76':
-        case '\u0b77':
-        case '\u0b78':
-        case '\u0b79':
-        case '\u0b7a':
-        case '\u0b7b':
-        case '\u0b7c':
-        case '\u0b7d':
-        case '\u0b7e':
-        case '\u0b7f':
-        case '\u0b80':
-        case '\u0b81':
-        case '\u0b82':
-        case '\u0b83':
-        case '\u0b84':
-        case '\u0b85':
-        case '\u0b86':
-        case '\u0b87':
-        case '\u0b88':
-        case '\u0b89':
-        case '\u0b8a':
-        case '\u0b8b':
-        case '\u0b8c':
-        case '\u0b8d':
-        case '\u0b8e':
-        case '\u0b8f':
-        case '\u0b90':
-        case '\u0b91':
-        case '\u0b92':
-        case '\u0b93':
-        case '\u0b94':
-        case '\u0b95':
-        case '\u0b96':
-        case '\u0b97':
-        case '\u0b98':
-        case '\u0b99':
-        case '\u0b9a':
-        case '\u0b9b':
-        case '\u0b9c':
-        case '\u0b9d':
-        case '\u0b9e':
-        case '\u0b9f':
-        case '\u0ba0':
-        case '\u0ba1':
-        case '\u0ba2':
-        case '\u0ba3':
-        case '\u0ba4':
-        case '\u0ba5':
-        case '\u0ba6':
-        case '\u0ba7':
-        case '\u0ba8':
-        case '\u0ba9':
-        case '\u0baa':
-        case '\u0bab':
-        case '\u0bac':
-        case '\u0bad':
-        case '\u0bae':
-        case '\u0baf':
-        case '\u0bb0':
-        case '\u0bb1':
-        case '\u0bb2':
-        case '\u0bb3':
-        case '\u0bb4':
-        case '\u0bb5':
-        case '\u0bb6':
-        case '\u0bb7':
-        case '\u0bb8':
-        case '\u0bb9':
-        case '\u0bba':
-        case '\u0bbb':
-        case '\u0bbc':
-        case '\u0bbd':
-        case '\u0bbe':
-        case '\u0bbf':
-        case '\u0bc0':
-        case '\u0bc1':
-        case '\u0bc2':
-        case '\u0bc3':
-        case '\u0bc4':
-        case '\u0bc5':
-        case '\u0bc6':
-        case '\u0bc7':
-        case '\u0bc8':
-        case '\u0bc9':
-        case '\u0bca':
-        case '\u0bcb':
-        case '\u0bcc':
-        case '\u0bcd':
-        case '\u0bce':
-        case '\u0bcf':
-        case '\u0bd0':
-        case '\u0bd1':
-        case '\u0bd2':
-        case '\u0bd3':
-        case '\u0bd4':
-        case '\u0bd5':
-        case '\u0bd6':
-        case '\u0bd7':
-        case '\u0bd8':
-        case '\u0bd9':
-        case '\u0bda':
-        case '\u0bdb':
-        case '\u0bdc':
-        case '\u0bdd':
-        case '\u0bde':
-        case '\u0bdf':
-        case '\u0be0':
-        case '\u0be1':
-        case '\u0be2':
-        case '\u0be3':
-        case '\u0be4':
-        case '\u0be5':
-        case '\u0be6': {
-          matchRange('\u0b70', '\u0be6');
-          break;
-        }
-        case '\u0bf0':
-        case '\u0bf1':
-        case '\u0bf2':
-        case '\u0bf3':
-        case '\u0bf4':
-        case '\u0bf5':
-        case '\u0bf6':
-        case '\u0bf7':
-        case '\u0bf8':
-        case '\u0bf9':
-        case '\u0bfa':
-        case '\u0bfb':
-        case '\u0bfc':
-        case '\u0bfd':
-        case '\u0bfe':
-        case '\u0bff':
-        case '\u0c00':
-        case '\u0c01':
-        case '\u0c02':
-        case '\u0c03':
-        case '\u0c04':
-        case '\u0c05':
-        case '\u0c06':
-        case '\u0c07':
-        case '\u0c08':
-        case '\u0c09':
-        case '\u0c0a':
-        case '\u0c0b':
-        case '\u0c0c':
-        case '\u0c0d':
-        case '\u0c0e':
-        case '\u0c0f':
-        case '\u0c10':
-        case '\u0c11':
-        case '\u0c12':
-        case '\u0c13':
-        case '\u0c14':
-        case '\u0c15':
-        case '\u0c16':
-        case '\u0c17':
-        case '\u0c18':
-        case '\u0c19':
-        case '\u0c1a':
-        case '\u0c1b':
-        case '\u0c1c':
-        case '\u0c1d':
-        case '\u0c1e':
-        case '\u0c1f':
-        case '\u0c20':
-        case '\u0c21':
-        case '\u0c22':
-        case '\u0c23':
-        case '\u0c24':
-        case '\u0c25':
-        case '\u0c26':
-        case '\u0c27':
-        case '\u0c28':
-        case '\u0c29':
-        case '\u0c2a':
-        case '\u0c2b':
-        case '\u0c2c':
-        case '\u0c2d':
-        case '\u0c2e':
-        case '\u0c2f':
-        case '\u0c30':
-        case '\u0c31':
-        case '\u0c32':
-        case '\u0c33':
-        case '\u0c34':
-        case '\u0c35':
-        case '\u0c36':
-        case '\u0c37':
-        case '\u0c38':
-        case '\u0c39':
-        case '\u0c3a':
-        case '\u0c3b':
-        case '\u0c3c':
-        case '\u0c3d':
-        case '\u0c3e':
-        case '\u0c3f':
-        case '\u0c40':
-        case '\u0c41':
-        case '\u0c42':
-        case '\u0c43':
-        case '\u0c44':
-        case '\u0c45':
-        case '\u0c46':
-        case '\u0c47':
-        case '\u0c48':
-        case '\u0c49':
-        case '\u0c4a':
-        case '\u0c4b':
-        case '\u0c4c':
-        case '\u0c4d':
-        case '\u0c4e':
-        case '\u0c4f':
-        case '\u0c50':
-        case '\u0c51':
-        case '\u0c52':
-        case '\u0c53':
-        case '\u0c54':
-        case '\u0c55':
-        case '\u0c56':
-        case '\u0c57':
-        case '\u0c58':
-        case '\u0c59':
-        case '\u0c5a':
-        case '\u0c5b':
-        case '\u0c5c':
-        case '\u0c5d':
-        case '\u0c5e':
-        case '\u0c5f':
-        case '\u0c60':
-        case '\u0c61':
-        case '\u0c62':
-        case '\u0c63':
-        case '\u0c64':
-        case '\u0c65': {
-          matchRange('\u0bf0', '\u0c65');
-          break;
-        }
-        case '\u0c70':
-        case '\u0c71':
-        case '\u0c72':
-        case '\u0c73':
-        case '\u0c74':
-        case '\u0c75':
-        case '\u0c76':
-        case '\u0c77':
-        case '\u0c78':
-        case '\u0c79':
-        case '\u0c7a':
-        case '\u0c7b':
-        case '\u0c7c':
-        case '\u0c7d':
-        case '\u0c7e':
-        case '\u0c7f':
-        case '\u0c80':
-        case '\u0c81':
-        case '\u0c82':
-        case '\u0c83':
-        case '\u0c84':
-        case '\u0c85':
-        case '\u0c86':
-        case '\u0c87':
-        case '\u0c88':
-        case '\u0c89':
-        case '\u0c8a':
-        case '\u0c8b':
-        case '\u0c8c':
-        case '\u0c8d':
-        case '\u0c8e':
-        case '\u0c8f':
-        case '\u0c90':
-        case '\u0c91':
-        case '\u0c92':
-        case '\u0c93':
-        case '\u0c94':
-        case '\u0c95':
-        case '\u0c96':
-        case '\u0c97':
-        case '\u0c98':
-        case '\u0c99':
-        case '\u0c9a':
-        case '\u0c9b':
-        case '\u0c9c':
-        case '\u0c9d':
-        case '\u0c9e':
-        case '\u0c9f':
-        case '\u0ca0':
-        case '\u0ca1':
-        case '\u0ca2':
-        case '\u0ca3':
-        case '\u0ca4':
-        case '\u0ca5':
-        case '\u0ca6':
-        case '\u0ca7':
-        case '\u0ca8':
-        case '\u0ca9':
-        case '\u0caa':
-        case '\u0cab':
-        case '\u0cac':
-        case '\u0cad':
-        case '\u0cae':
-        case '\u0caf':
-        case '\u0cb0':
-        case '\u0cb1':
-        case '\u0cb2':
-        case '\u0cb3':
-        case '\u0cb4':
-        case '\u0cb5':
-        case '\u0cb6':
-        case '\u0cb7':
-        case '\u0cb8':
-        case '\u0cb9':
-        case '\u0cba':
-        case '\u0cbb':
-        case '\u0cbc':
-        case '\u0cbd':
-        case '\u0cbe':
-        case '\u0cbf':
-        case '\u0cc0':
-        case '\u0cc1':
-        case '\u0cc2':
-        case '\u0cc3':
-        case '\u0cc4':
-        case '\u0cc5':
-        case '\u0cc6':
-        case '\u0cc7':
-        case '\u0cc8':
-        case '\u0cc9':
-        case '\u0cca':
-        case '\u0ccb':
-        case '\u0ccc':
-        case '\u0ccd':
-        case '\u0cce':
-        case '\u0ccf':
-        case '\u0cd0':
-        case '\u0cd1':
-        case '\u0cd2':
-        case '\u0cd3':
-        case '\u0cd4':
-        case '\u0cd5':
-        case '\u0cd6':
-        case '\u0cd7':
-        case '\u0cd8':
-        case '\u0cd9':
-        case '\u0cda':
-        case '\u0cdb':
-        case '\u0cdc':
-        case '\u0cdd':
-        case '\u0cde':
-        case '\u0cdf':
-        case '\u0ce0':
-        case '\u0ce1':
-        case '\u0ce2':
-        case '\u0ce3':
-        case '\u0ce4':
-        case '\u0ce5': {
-          matchRange('\u0c70', '\u0ce5');
-          break;
-        }
-        case '\u0cf0':
-        case '\u0cf1':
-        case '\u0cf2':
-        case '\u0cf3':
-        case '\u0cf4':
-        case '\u0cf5':
-        case '\u0cf6':
-        case '\u0cf7':
-        case '\u0cf8':
-        case '\u0cf9':
-        case '\u0cfa':
-        case '\u0cfb':
-        case '\u0cfc':
-        case '\u0cfd':
-        case '\u0cfe':
-        case '\u0cff':
-        case '\u0d00':
-        case '\u0d01':
-        case '\u0d02':
-        case '\u0d03':
-        case '\u0d04':
-        case '\u0d05':
-        case '\u0d06':
-        case '\u0d07':
-        case '\u0d08':
-        case '\u0d09':
-        case '\u0d0a':
-        case '\u0d0b':
-        case '\u0d0c':
-        case '\u0d0d':
-        case '\u0d0e':
-        case '\u0d0f':
-        case '\u0d10':
-        case '\u0d11':
-        case '\u0d12':
-        case '\u0d13':
-        case '\u0d14':
-        case '\u0d15':
-        case '\u0d16':
-        case '\u0d17':
-        case '\u0d18':
-        case '\u0d19':
-        case '\u0d1a':
-        case '\u0d1b':
-        case '\u0d1c':
-        case '\u0d1d':
-        case '\u0d1e':
-        case '\u0d1f':
-        case '\u0d20':
-        case '\u0d21':
-        case '\u0d22':
-        case '\u0d23':
-        case '\u0d24':
-        case '\u0d25':
-        case '\u0d26':
-        case '\u0d27':
-        case '\u0d28':
-        case '\u0d29':
-        case '\u0d2a':
-        case '\u0d2b':
-        case '\u0d2c':
-        case '\u0d2d':
-        case '\u0d2e':
-        case '\u0d2f':
-        case '\u0d30':
-        case '\u0d31':
-        case '\u0d32':
-        case '\u0d33':
-        case '\u0d34':
-        case '\u0d35':
-        case '\u0d36':
-        case '\u0d37':
-        case '\u0d38':
-        case '\u0d39':
-        case '\u0d3a':
-        case '\u0d3b':
-        case '\u0d3c':
-        case '\u0d3d':
-        case '\u0d3e':
-        case '\u0d3f':
-        case '\u0d40':
-        case '\u0d41':
-        case '\u0d42':
-        case '\u0d43':
-        case '\u0d44':
-        case '\u0d45':
-        case '\u0d46':
-        case '\u0d47':
-        case '\u0d48':
-        case '\u0d49':
-        case '\u0d4a':
-        case '\u0d4b':
-        case '\u0d4c':
-        case '\u0d4d':
-        case '\u0d4e':
-        case '\u0d4f':
-        case '\u0d50':
-        case '\u0d51':
-        case '\u0d52':
-        case '\u0d53':
-        case '\u0d54':
-        case '\u0d55':
-        case '\u0d56':
-        case '\u0d57':
-        case '\u0d58':
-        case '\u0d59':
-        case '\u0d5a':
-        case '\u0d5b':
-        case '\u0d5c':
-        case '\u0d5d':
-        case '\u0d5e':
-        case '\u0d5f':
-        case '\u0d60':
-        case '\u0d61':
-        case '\u0d62':
-        case '\u0d63':
-        case '\u0d64':
-        case '\u0d65': {
-          matchRange('\u0cf0', '\u0d65');
-          break;
-        }
-        case '\u0e5a':
-        case '\u0e5b':
-        case '\u0e5c':
-        case '\u0e5d':
-        case '\u0e5e':
-        case '\u0e5f':
-        case '\u0e60':
-        case '\u0e61':
-        case '\u0e62':
-        case '\u0e63':
-        case '\u0e64':
-        case '\u0e65':
-        case '\u0e66':
-        case '\u0e67':
-        case '\u0e68':
-        case '\u0e69':
-        case '\u0e6a':
-        case '\u0e6b':
-        case '\u0e6c':
-        case '\u0e6d':
-        case '\u0e6e':
-        case '\u0e6f':
-        case '\u0e70':
-        case '\u0e71':
-        case '\u0e72':
-        case '\u0e73':
-        case '\u0e74':
-        case '\u0e75':
-        case '\u0e76':
-        case '\u0e77':
-        case '\u0e78':
-        case '\u0e79':
-        case '\u0e7a':
-        case '\u0e7b':
-        case '\u0e7c':
-        case '\u0e7d':
-        case '\u0e7e':
-        case '\u0e7f':
-        case '\u0e80':
-        case '\u0e81':
-        case '\u0e82':
-        case '\u0e83':
-        case '\u0e84':
-        case '\u0e85':
-        case '\u0e86':
-        case '\u0e87':
-        case '\u0e88':
-        case '\u0e89':
-        case '\u0e8a':
-        case '\u0e8b':
-        case '\u0e8c':
-        case '\u0e8d':
-        case '\u0e8e':
-        case '\u0e8f':
-        case '\u0e90':
-        case '\u0e91':
-        case '\u0e92':
-        case '\u0e93':
-        case '\u0e94':
-        case '\u0e95':
-        case '\u0e96':
-        case '\u0e97':
-        case '\u0e98':
-        case '\u0e99':
-        case '\u0e9a':
-        case '\u0e9b':
-        case '\u0e9c':
-        case '\u0e9d':
-        case '\u0e9e':
-        case '\u0e9f':
-        case '\u0ea0':
-        case '\u0ea1':
-        case '\u0ea2':
-        case '\u0ea3':
-        case '\u0ea4':
-        case '\u0ea5':
-        case '\u0ea6':
-        case '\u0ea7':
-        case '\u0ea8':
-        case '\u0ea9':
-        case '\u0eaa':
-        case '\u0eab':
-        case '\u0eac':
-        case '\u0ead':
-        case '\u0eae':
-        case '\u0eaf':
-        case '\u0eb0':
-        case '\u0eb1':
-        case '\u0eb2':
-        case '\u0eb3':
-        case '\u0eb4':
-        case '\u0eb5':
-        case '\u0eb6':
-        case '\u0eb7':
-        case '\u0eb8':
-        case '\u0eb9':
-        case '\u0eba':
-        case '\u0ebb':
-        case '\u0ebc':
-        case '\u0ebd':
-        case '\u0ebe':
-        case '\u0ebf':
-        case '\u0ec0':
-        case '\u0ec1':
-        case '\u0ec2':
-        case '\u0ec3':
-        case '\u0ec4':
-        case '\u0ec5':
-        case '\u0ec6':
-        case '\u0ec7':
-        case '\u0ec8':
-        case '\u0ec9':
-        case '\u0eca':
-        case '\u0ecb':
-        case '\u0ecc':
-        case '\u0ecd':
-        case '\u0ece':
-        case '\u0ecf': {
-          matchRange('\u0e5a', '\u0ecf');
-          break;
-        }
-        case '\u2000':
-        case '\u2001':
-        case '\u2002':
-        case '\u2003':
-        case '\u2004':
-        case '\u2005':
-        case '\u2006':
-        case '\u2007':
-        case '\u2008':
-        case '\u2009':
-        case '\u200a':
-        case '\u200b':
-        case '\u200c':
-        case '\u200d':
-        case '\u200e':
-        case '\u200f':
-        case '\u2010':
-        case '\u2011':
-        case '\u2012':
-        case '\u2013':
-        case '\u2014':
-        case '\u2015':
-        case '\u2016':
-        case '\u2017':
-        case '\u2018':
-        case '\u2019':
-        case '\u201a':
-        case '\u201b':
-        case '\u201c':
-        case '\u201d':
-        case '\u201e':
-        case '\u201f':
-        case '\u2020':
-        case '\u2021':
-        case '\u2022':
-        case '\u2023':
-        case '\u2024':
-        case '\u2025':
-        case '\u2026':
-        case '\u2027':
-        case '\u2028':
-        case '\u2029':
-        case '\u202a':
-        case '\u202b':
-        case '\u202c':
-        case '\u202d':
-        case '\u202e':
-        case '\u202f':
-        case '\u2030':
-        case '\u2031':
-        case '\u2032':
-        case '\u2033':
-        case '\u2034':
-        case '\u2035':
-        case '\u2036':
-        case '\u2037':
-        case '\u2038':
-        case '\u2039':
-        case '\u203a':
-        case '\u203b':
-        case '\u203c':
-        case '\u203d':
-        case '\u203e':
-        case '\u203f':
-        case '\u2040':
-        case '\u2041':
-        case '\u2042':
-        case '\u2043':
-        case '\u2044':
-        case '\u2045':
-        case '\u2046':
-        case '\u2047':
-        case '\u2048':
-        case '\u2049':
-        case '\u204a':
-        case '\u204b':
-        case '\u204c':
-        case '\u204d':
-        case '\u204e':
-        case '\u204f':
-        case '\u2050':
-        case '\u2051':
-        case '\u2052':
-        case '\u2053':
-        case '\u2054':
-        case '\u2055':
-        case '\u2056':
-        case '\u2057':
-        case '\u2058':
-        case '\u2059':
-        case '\u205a':
-        case '\u205b':
-        case '\u205c':
-        case '\u205d':
-        case '\u205e':
-        case '\u205f':
-        case '\u2060':
-        case '\u2061':
-        case '\u2062':
-        case '\u2063':
-        case '\u2064':
-        case '\u2065':
-        case '\u2066':
-        case '\u2067':
-        case '\u2068':
-        case '\u2069':
-        case '\u206a':
-        case '\u206b':
-        case '\u206c':
-        case '\u206d':
-        case '\u206e':
-        case '\u206f': {
-          matchRange('\u2000', '\u206f');
-          break;
-        }
-        default:
-          if (((LA(1) >= '\u0100' && LA(1) <= '\u065f'))) {
-            matchRange('\u0100', '\u065f');
-          } else if (((LA(1) >= '\u066a' && LA(1) <= '\u06ef'))) {
-            matchRange('\u066a', '\u06ef');
-          } else if (((LA(1) >= '\u06fa' && LA(1) <= '\u0965'))) {
-            matchRange('\u06fa', '\u0965');
-          } else if (((LA(1) >= '\u0d70' && LA(1) <= '\u0e4f'))) {
-            matchRange('\u0d70', '\u0e4f');
-          } else if (((LA(1) >= '\u0eda' && LA(1) <= '\u103f'))) {
-            matchRange('\u0eda', '\u103f');
-          } else if (((LA(1) >= '\u104a' && LA(1) <= '\u1fff'))) {
-            matchRange('\u104a', '\u1fff');
-          } else if (((LA(1) >= '\u3040' && LA(1) <= '\u318f'))) {
-            matchRange('\u3040', '\u318f');
-          } else if (((LA(1) >= '\u3300' && LA(1) <= '\u337f'))) {
-            matchRange('\u3300', '\u337f');
-          } else if (((LA(1) >= '\u3400' && LA(1) <= '\u3d2d'))) {
-            matchRange('\u3400', '\u3d2d');
-          } else if (((LA(1) >= '\u4e00' && LA(1) <= '\u9fff'))) {
-            matchRange('\u4e00', '\u9fff');
-          } else if (((LA(1) >= '\uf900' && LA(1) <= '\ufaff'))) {
-            matchRange('\uf900', '\ufaff');
-          } else {
-            throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                getColumn());
-          }
-      }
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mDIGIT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = DIGIT;
-    int _saveIndex;
-
-    {
-      switch (LA(1)) {
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9': {
-          matchRange('\u0030', '\u0039');
-          break;
-        }
-        case '\u0660':
-        case '\u0661':
-        case '\u0662':
-        case '\u0663':
-        case '\u0664':
-        case '\u0665':
-        case '\u0666':
-        case '\u0667':
-        case '\u0668':
-        case '\u0669': {
-          matchRange('\u0660', '\u0669');
-          break;
-        }
-        case '\u06f0':
-        case '\u06f1':
-        case '\u06f2':
-        case '\u06f3':
-        case '\u06f4':
-        case '\u06f5':
-        case '\u06f6':
-        case '\u06f7':
-        case '\u06f8':
-        case '\u06f9': {
-          matchRange('\u06f0', '\u06f9');
-          break;
-        }
-        case '\u0966':
-        case '\u0967':
-        case '\u0968':
-        case '\u0969':
-        case '\u096a':
-        case '\u096b':
-        case '\u096c':
-        case '\u096d':
-        case '\u096e':
-        case '\u096f': {
-          matchRange('\u0966', '\u096f');
-          break;
-        }
-        case '\u09e6':
-        case '\u09e7':
-        case '\u09e8':
-        case '\u09e9':
-        case '\u09ea':
-        case '\u09eb':
-        case '\u09ec':
-        case '\u09ed':
-        case '\u09ee':
-        case '\u09ef': {
-          matchRange('\u09e6', '\u09ef');
-          break;
-        }
-        case '\u0a66':
-        case '\u0a67':
-        case '\u0a68':
-        case '\u0a69':
-        case '\u0a6a':
-        case '\u0a6b':
-        case '\u0a6c':
-        case '\u0a6d':
-        case '\u0a6e':
-        case '\u0a6f': {
-          matchRange('\u0a66', '\u0a6f');
-          break;
-        }
-        case '\u0ae6':
-        case '\u0ae7':
-        case '\u0ae8':
-        case '\u0ae9':
-        case '\u0aea':
-        case '\u0aeb':
-        case '\u0aec':
-        case '\u0aed':
-        case '\u0aee':
-        case '\u0aef': {
-          matchRange('\u0ae6', '\u0aef');
-          break;
-        }
-        case '\u0b66':
-        case '\u0b67':
-        case '\u0b68':
-        case '\u0b69':
-        case '\u0b6a':
-        case '\u0b6b':
-        case '\u0b6c':
-        case '\u0b6d':
-        case '\u0b6e':
-        case '\u0b6f': {
-          matchRange('\u0b66', '\u0b6f');
-          break;
-        }
-        case '\u0be7':
-        case '\u0be8':
-        case '\u0be9':
-        case '\u0bea':
-        case '\u0beb':
-        case '\u0bec':
-        case '\u0bed':
-        case '\u0bee':
-        case '\u0bef': {
-          matchRange('\u0be7', '\u0bef');
-          break;
-        }
-        case '\u0c66':
-        case '\u0c67':
-        case '\u0c68':
-        case '\u0c69':
-        case '\u0c6a':
-        case '\u0c6b':
-        case '\u0c6c':
-        case '\u0c6d':
-        case '\u0c6e':
-        case '\u0c6f': {
-          matchRange('\u0c66', '\u0c6f');
-          break;
-        }
-        case '\u0ce6':
-        case '\u0ce7':
-        case '\u0ce8':
-        case '\u0ce9':
-        case '\u0cea':
-        case '\u0ceb':
-        case '\u0cec':
-        case '\u0ced':
-        case '\u0cee':
-        case '\u0cef': {
-          matchRange('\u0ce6', '\u0cef');
-          break;
-        }
-        case '\u0d66':
-        case '\u0d67':
-        case '\u0d68':
-        case '\u0d69':
-        case '\u0d6a':
-        case '\u0d6b':
-        case '\u0d6c':
-        case '\u0d6d':
-        case '\u0d6e':
-        case '\u0d6f': {
-          matchRange('\u0d66', '\u0d6f');
-          break;
-        }
-        case '\u0e50':
-        case '\u0e51':
-        case '\u0e52':
-        case '\u0e53':
-        case '\u0e54':
-        case '\u0e55':
-        case '\u0e56':
-        case '\u0e57':
-        case '\u0e58':
-        case '\u0e59': {
-          matchRange('\u0e50', '\u0e59');
-          break;
-        }
-        case '\u0ed0':
-        case '\u0ed1':
-        case '\u0ed2':
-        case '\u0ed3':
-        case '\u0ed4':
-        case '\u0ed5':
-        case '\u0ed6':
-        case '\u0ed7':
-        case '\u0ed8':
-        case '\u0ed9': {
-          matchRange('\u0ed0', '\u0ed9');
-          break;
-        }
-        case '\u1040':
-        case '\u1041':
-        case '\u1042':
-        case '\u1043':
-        case '\u1044':
-        case '\u1045':
-        case '\u1046':
-        case '\u1047':
-        case '\u1048':
-        case '\u1049': {
-          matchRange('\u1040', '\u1049');
-          break;
-        }
-        default: {
-          throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-              getColumn());
-        }
-      }
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mALL_UNICODE(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = ALL_UNICODE;
-    int _saveIndex;
-
-    {
-      matchRange('\u0061', '\ufffd');
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mNameFirstCharacter(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = NameFirstCharacter;
-    int _saveIndex;
-
-    {
-      if ((_tokenSet_2.member(LA(1)))) {
-        mLETTER(false);
-      } else if ((LA(1) == '_')) {
-        match('_');
-      } else {
-        throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
-      }
-
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mNameCharacter(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = NameCharacter;
-    int _saveIndex;
-
-    {
-      switch (LA(1)) {
-        case '_': {
-          match('_');
-          break;
-        }
-        case '$': {
-          match('$');
-          break;
-        }
-        default:
-          if ((_tokenSet_2.member(LA(1)))) {
-            mLETTER(false);
-          } else if ((_tokenSet_3.member(LA(1)))) {
-            mDIGIT(false);
-          } else {
-            throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                getColumn());
-          }
-      }
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mRegionNameCharacter(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = RegionNameCharacter;
-    int _saveIndex;
-
-    {
-      switch (LA(1)) {
-        case '_': {
-          match('_');
-          break;
-        }
-        case '+': {
-          match('+');
-          break;
-        }
-        case '-': {
-          match('-');
-          break;
-        }
-        case ':': {
-          match(':');
-          break;
-        }
-        case '#': {
-          match('#');
-          break;
-        }
-        case '@': {
-          match('@');
-          break;
-        }
-        case '$': {
-          match('$');
-          break;
-        }
-        default:
-          if (((LA(1) >= 'a' && LA(1) <= '\ufffd')) && (true)) {
-            mALL_UNICODE(false);
-          } else if ((_tokenSet_3.member(LA(1))) && (true)) {
-            mDIGIT(false);
-          } else {
-            throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                getColumn());
-          }
-      }
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mQuotedIdentifier(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = QuotedIdentifier;
-    int _saveIndex;
-
-    _saveIndex = text.length();
-    match('"');
-    text.setLength(_saveIndex);
-    mNameFirstCharacter(false);
-    {
-      _loop38: do {
-        if ((_tokenSet_4.member(LA(1)))) {
-          mNameCharacter(false);
-        } else {
-          break _loop38;
-        }
-
-      } while (true);
-    }
-    _saveIndex = text.length();
-    match('"');
-    text.setLength(_saveIndex);
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mIdentifier(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = Identifier;
-    int _saveIndex;
-
-    mNameFirstCharacter(false);
-    {
-      _loop41: do {
-        if ((_tokenSet_4.member(LA(1)))) {
-          mNameCharacter(false);
-        } else {
-          break _loop41;
-        }
-
-      } while (true);
-    }
-    _ttype = testLiteralsTable(_ttype);
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mRegionPath(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = RegionPath;
-    int _saveIndex;
-
-    {
-      if ((LA(1) == '/') && (_tokenSet_5.member(LA(2)))) {
-        {
-          {
-            int _cnt48 = 0;
-            _loop48: do {
-              if ((LA(1) == '/')) {
-                mTOK_SLASH(false);
-                {
-                  int _cnt47 = 0;
-                  _loop47: do {
-                    if ((_tokenSet_5.member(LA(1)))) {
-                      mRegionNameCharacter(false);
-                    } else {
-                      if (_cnt47 >= 1) {
-                        break _loop47;
-                      } else {
-                        throw new NoViableAltForCharException((char) LA(1), getFilename(),
-                            getLine(), getColumn());
-                      }
-                    }
-
-                    _cnt47++;
-                  } while (true);
-                }
-              } else {
-                if (_cnt48 >= 1) {
-                  break _loop48;
-                } else {
-                  throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                      getColumn());
-                }
-              }
-
-              _cnt48++;
-            } while (true);
-          }
-        }
-      } else if ((LA(1) == '/') && (LA(2) == '\'')) {
-        {
-          {
-            int _cnt51 = 0;
-            _loop51: do {
-              if ((LA(1) == '/')) {
-                mTOK_SLASH(false);
-                mStringLiteral(false);
-              } else {
-                if (_cnt51 >= 1) {
-                  break _loop51;
-                } else {
-                  throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                      getColumn());
-                }
-              }
-
-              _cnt51++;
-            } while (true);
-          }
-        }
-      } else {
-        throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
-      }
-
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mStringLiteral(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = StringLiteral;
-    int _saveIndex;
-
-    _saveIndex = text.length();
-    mQUOTE(false);
-    text.setLength(_saveIndex);
-    {
-      _loop87: do {
-        if ((LA(1) == '\'') && (LA(2) == '\'')) {
-          mQUOTE(false);
-          _saveIndex = text.length();
-          mQUOTE(false);
-          text.setLength(_saveIndex);
-        } else if ((LA(1) == '\n')) {
-          match('\n');
-          if (inputState.guessing == 0) {
-            newline();
-          }
-        } else if ((_tokenSet_6.member(LA(1)))) {
-          {
-            match(_tokenSet_6);
-          }
-        } else {
-          break _loop87;
-        }
-
-      } while (true);
-    }
-    _saveIndex = text.length();
-    mQUOTE(false);
-    text.setLength(_saveIndex);
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mNUM_INT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = NUM_INT;
-    int _saveIndex;
-    Token f2 = null;
-    Token f3 = null;
-    Token f4 = null;
-    boolean isDecimal = false;
-    Token t = null;
-
-    {
-      switch (LA(1)) {
-        case '0': {
-          match('0');
-          if (inputState.guessing == 0) {
-            isDecimal = true;
-          }
-          {
-            if ((LA(1) == 'x')) {
-              match('x');
-              {
-                int _cnt56 = 0;
-                _loop56: do {
-                  if ((_tokenSet_7.member(LA(1))) && (true)) {
-                    mHEX_DIGIT(false);
-                  } else {
-                    if (_cnt56 >= 1) {
-                      break _loop56;
-                    } else {
-                      throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                          getColumn());
-                    }
-                  }
-
-                  _cnt56++;
-                } while (true);
-              }
-            } else {
-              boolean synPredMatched61 = false;
-              if ((((LA(1) >= '0' && LA(1) <= '9')) && (true))) {
-                int _m61 = mark();
-                synPredMatched61 = true;
-                inputState.guessing++;
-                try {
-                  {
-                    {
-                      int _cnt59 = 0;
-                      _loop59: do {
-                        if (((LA(1) >= '0' && LA(1) <= '9'))) {
-                          matchRange('0', '9');
-                        } else {
-                          if (_cnt59 >= 1) {
-                            break _loop59;
-                          } else {
-                            throw new NoViableAltForCharException((char) LA(1), getFilename(),
-                                getLine(), getColumn());
-                          }
-                        }
-
-                        _cnt59++;
-                      } while (true);
-                    }
-                    {
-                      switch (LA(1)) {
-                        case '.': {
-                          match('.');
-                          break;
-                        }
-                        case 'e': {
-                          mEXPONENT(false);
-                          break;
-                        }
-                        case 'd':
-                        case 'f': {
-                          mFLOAT_SUFFIX(false);
-                          break;
-                        }
-                        default: {
-                          throw new NoViableAltForCharException((char) LA(1), getFilename(),
-                              getLine(), getColumn());
-                        }
-                      }
-                    }
-                  }
-                } catch (RecognitionException pe) {
-                  synPredMatched61 = false;
-                }
-                rewind(_m61);
-                inputState.guessing--;
-              }
-              if (synPredMatched61) {
-                {
-                  int _cnt63 = 0;
-                  _loop63: do {
-                    if (((LA(1) >= '0' && LA(1) <= '9'))) {
-                      matchRange('0', '9');
-                    } else {
-                      if (_cnt63 >= 1) {
-                        break _loop63;
-                      } else {
-                        throw new NoViableAltForCharException((char) LA(1), getFilename(),
-                            getLine(), getColumn());
-                      }
-                    }
-
-                    _cnt63++;
-                  } while (true);
-                }
-              } else if (((LA(1) >= '0' && LA(1) <= '7')) && (true)) {
-                {
-                  int _cnt65 = 0;
-                  _loop65: do {
-                    if (((LA(1) >= '0' && LA(1) <= '7'))) {
-                      matchRange('0', '7');
-                    } else {
-                      if (_cnt65 >= 1) {
-                        break _loop65;
-                      } else {
-                        throw new NoViableAltForCharException((char) LA(1), getFilename(),
-                            getLine(), getColumn());
-                      }
-                    }
-
-                    _cnt65++;
-                  } while (true);
-                }
-              } else {
-              }
-            }
-          }
-          break;
-        }
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9': {
-          {
-            matchRange('1', '9');
-          }
-          {
-            _loop68: do {
-              if (((LA(1) >= '0' && LA(1) <= '9'))) {
-                matchRange('0', '9');
-              } else {
-                break _loop68;
-              }
-
-            } while (true);
-          }
-          if (inputState.guessing == 0) {
-            isDecimal = true;
-          }
-          break;
-        }
-        default: {
-          throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-              getColumn());
-        }
-      }
-    }
-    {
-      if ((LA(1) == 'l')) {
-        match('l');
-        if (inputState.guessing == 0) {
-          _ttype = NUM_LONG;
-        }
-      } else if (((_tokenSet_8.member(LA(1)))) && (isDecimal)) {
-        {
-          switch (LA(1)) {
-            case '.': {
-              match('.');
-              {
-                _loop72: do {
-                  if (((LA(1) >= '0' && LA(1) <= '9'))) {
-                    matchRange('0', '9');
-                  } else {
-                    break _loop72;
-                  }
-
-                } while (true);
-              }
-              {
-                if ((LA(1) == 'e')) {
-                  mEXPONENT(false);
-                } else {
-                }
-
-              }
-              {
-                if ((LA(1) == 'd' || LA(1) == 'f')) {
-                  mFLOAT_SUFFIX(true);
-                  f2 = _returnToken;
-                  if (inputState.guessing == 0) {
-                    t = f2;
-                  }
-                } else {
-                }
-
-              }
-              break;
-            }
-            case 'e': {
-              mEXPONENT(false);
-              {
-                if ((LA(1) == 'd' || LA(1) == 'f')) {
-                  mFLOAT_SUFFIX(true);
-                  f3 = _returnToken;
-                  if (inputState.guessing == 0) {
-                    t = f3;
-                  }
-                } else {
-                }
-
-              }
-              break;
-            }
-            case 'd':
-            case 'f': {
-              mFLOAT_SUFFIX(true);
-              f4 = _returnToken;
-              if (inputState.guessing == 0) {
-                t = f4;
-              }
-              break;
-            }
-            default: {
-              throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                  getColumn());
-            }
-          }
-        }
-        if (inputState.guessing == 0) {
-
-          if (t != null && t.getText().toUpperCase().indexOf('F') >= 0) {
-            _ttype = NUM_FLOAT;
-          } else {
-            _ttype = NUM_DOUBLE; // assume double
-          }
-
-        }
-      } else {
-      }
-
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mHEX_DIGIT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = HEX_DIGIT;
-    int _saveIndex;
-
-    {
-      switch (LA(1)) {
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9': {
-          matchRange('0', '9');
-          break;
-        }
-        case 'a':
-        case 'b':
-        case 'c':
-        case 'd':
-        case 'e':
-        case 'f': {
-          matchRange('a', 'f');
-          break;
-        }
-        default: {
-          throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-              getColumn());
-        }
-      }
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mEXPONENT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = EXPONENT;
-    int _saveIndex;
-
-    match('e');
-    {
-      switch (LA(1)) {
-        case '+': {
-          match('+');
-          break;
-        }
-        case '-': {
-          match('-');
-          break;
-        }
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9': {
-          break;
-        }
-        default: {
-          throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-              getColumn());
-        }
-      }
-    }
-    {
-      int _cnt79 = 0;
-      _loop79: do {
-        if (((LA(1) >= '0' && LA(1) <= '9'))) {
-          matchRange('0', '9');
-        } else {
-          if (_cnt79 >= 1) {
-            break _loop79;
-          } else {
-            throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                getColumn());
-          }
-        }
-
-        _cnt79++;
-      } while (true);
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mFLOAT_SUFFIX(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = FLOAT_SUFFIX;
-    int _saveIndex;
-
-    switch (LA(1)) {
-      case 'f': {
-        match('f');
-        break;
-      }
-      case 'd': {
-        match('d');
-        break;
-      }
-      default: {
-        throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(), getColumn());
-      }
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  protected final void mQUOTE(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = QUOTE;
-    int _saveIndex;
-
-    match('\'');
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mWS(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = WS;
-    int _saveIndex;
-
-    {
-      int _cnt91 = 0;
-      _loop91: do {
-        switch (LA(1)) {
-          case ' ': {
-            match(' ');
-            break;
-          }
-          case '\t': {
-            match('\t');
-            break;
-          }
-          case '\u000c': {
-            match('\f');
-            break;
-          }
-          case '\n':
-          case '\r': {
-            {
-              if ((LA(1) == '\r') && (LA(2) == '\n')) {
-                match("\r\n");
-              } else if ((LA(1) == '\r') && (true)) {
-                match('\r');
-              } else if ((LA(1) == '\n')) {
-                match('\n');
-              } else {
-                throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                    getColumn());
-              }
-
-            }
-            if (inputState.guessing == 0) {
-              newline();
-            }
-            break;
-          }
-          default: {
-            if (_cnt91 >= 1) {
-              break _loop91;
-            } else {
-              throw new NoViableAltForCharException((char) LA(1), getFilename(), getLine(),
-                  getColumn());
-            }
-          }
-        }
-        _cnt91++;
-      } while (true);
-    }
-    if (inputState.guessing == 0) {
-      _ttype = Token.SKIP;
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mSL_COMMENT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = SL_COMMENT;
-    int _saveIndex;
-
-    match("--");
-    {
-      _loop95: do {
-        if ((_tokenSet_9.member(LA(1)))) {
-          {
-            match(_tokenSet_9);
-          }
-        } else {
-          break _loop95;
-        }
-
-      } while (true);
-    }
-    {
-      switch (LA(1)) {
-        case '\n': {
-          match('\n');
-          break;
-        }
-        case '\r': {
-          match('\r');
-          {
-            if ((LA(1) == '\n')) {
-              match('\n');
-            } else {
-            }
-
-          }
-          break;
-        }
-        default: {
-        }
-      }
-    }
-    if (inputState.guessing == 0) {
-      _ttype = Token.SKIP;
-      newline();
-    }
-    if (_createToken && _token == null && _ttype != Token.SKIP) {
-      _token = makeToken(_ttype);
-      _token.setText(new String(text.getBuffer(), _begin, text.length() - _begin));
-    }
-    _returnToken = _token;
-  }
-
-  public final void mML_COMMENT(boolean _createToken)
-      throws RecognitionException, CharStreamException, TokenStreamException {
-    int _ttype;
-    Token _token = null;
-    int _begin = text.length();
-    _ttype = ML_COMMENT;
-    int _saveIndex;
-
-    match("/*");
-    {
-      _loop101: do {
-        if (((LA(1) == '*') && ((LA(2) >= '\u0000' && LA(2) <= '\ufffe'))) && (LA(2) != '/')) {
-          match('*');
-        } else if ((LA(1) == '\r') && (LA(2) =

<TRUNCATED>

[20/25] geode git commit: GEODE-2243: Adjust path of spotless formatter

Posted by km...@apache.org.
GEODE-2243: Adjust path of spotless formatter

- This allows projects which depend on Geode to use Geode's formatter

Signed-off-by: Scott Jewell <sj...@pivotal.io>


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/f1846b1c
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/f1846b1c
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/f1846b1c

Branch: refs/heads/feature/GEODE-2231
Commit: f1846b1cd30624809a95c8ae7d7c053c15818564
Parents: bb3d20f
Author: Jens Deppe <jd...@pivotal.io>
Authored: Wed Dec 21 14:52:11 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 build.gradle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/f1846b1c/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 360310f..d788250 100755
--- a/build.gradle
+++ b/build.gradle
@@ -91,7 +91,7 @@ subprojects {
   spotless {
     lineEndings = 'unix';
     java {
-      eclipseFormatFile "${rootProject.projectDir}/etc/eclipse-java-google-style.xml"
+      eclipseFormatFile "${rootProject.projectDir}/../open/etc/eclipse-java-google-style.xml"
     }
   }
 }


[19/25] geode git commit: GEODE-2109: Replacing ExecutorService.submit calls with ExecutorService.execute call.

Posted by km...@apache.org.
GEODE-2109: Replacing ExecutorService.submit calls with ExecutorService.execute call.

This will allow exceptions from those threads to be logged.

Refactored DiskStore task for delayed writes, we cannot replace
expensive writes tasks submit call with execute as later we check if
write call is completed or not.  Replaced submit call by execute in case
of DiskStore tasks like compactions, creating KRF's.

Replaced submit call for GIITask and RemoveMember tasks. GIITask is used
when adding member or starting managing activity when node becomes
managing node. While adding member we can make the
ExecutorService.execute call. Did not change the call for GIITask when
invoked from managing activity as possible exception is handled.

Added LoggingThreadGroup for SingleHopClientExecutor

This closes #296


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/bb3d20f4
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/bb3d20f4
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/bb3d20f4

Branch: refs/heads/feature/GEODE-2231
Commit: bb3d20f41d8b9f4e663d6ae7ddbd83ad8de01e77
Parents: 0b01117
Author: Deepak Dixit <de...@ampool.io>
Authored: Wed Nov 23 21:33:14 2016 +0530
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../internal/SingleHopClientExecutor.java       |  8 ++-
 .../FunctionExecutionPooledExecutor.java        |  2 +-
 .../distributed/internal/InternalLocator.java   |  4 +-
 .../geode/internal/cache/DiskStoreImpl.java     | 40 ++++++++++++-
 .../internal/cache/PRHARedundancyProvider.java  |  2 +-
 .../geode/internal/cache/lru/HeapEvictor.java   |  2 +-
 .../CustomEntryConcurrentHashMap.java           |  2 +-
 .../management/internal/FederatingManager.java  | 26 ++++++---
 ...ientExecutorSubmitTaskWithExceptionTest.java | 61 ++++++++++++++++++++
 .../management/MemoryThresholdsDUnitTest.java   |  6 ++
 .../internal/cache/EvictionStatsDUnitTest.java  | 25 ++++++++
 .../PartitionedRegionEvictionDUnitTest.java     |  7 +++
 12 files changed, 169 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/cache/client/internal/SingleHopClientExecutor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/SingleHopClientExecutor.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/SingleHopClientExecutor.java
index 88a86cf..4d40acd 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/SingleHopClientExecutor.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/SingleHopClientExecutor.java
@@ -27,6 +27,8 @@ import java.util.concurrent.Future;
 import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.geode.internal.logging.LoggingThreadGroup;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.GemFireException;
@@ -57,7 +59,9 @@ public class SingleHopClientExecutor {
     AtomicInteger threadNum = new AtomicInteger();
 
     public Thread newThread(final Runnable r) {
-      Thread result = new Thread(r, "Function Execution Thread-" + threadNum.incrementAndGet());
+      Thread result =
+          new Thread(LoggingThreadGroup.createThreadGroup("FunctionExecutionThreadGroup", logger),
+              r, "Function Execution Thread-" + threadNum.incrementAndGet());
       result.setDaemon(true);
       return result;
     }
@@ -384,7 +388,7 @@ public class SingleHopClientExecutor {
   }
 
   static void submitTask(Runnable task) {
-    execService.submit(task);
+    execService.execute(task);
   }
 
   // Find out what exception to throw?

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/distributed/internal/FunctionExecutionPooledExecutor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/FunctionExecutionPooledExecutor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/FunctionExecutionPooledExecutor.java
index 34f1296..a519c0e 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/FunctionExecutionPooledExecutor.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/FunctionExecutionPooledExecutor.java
@@ -131,7 +131,7 @@ public class FunctionExecutionPooledExecutor extends ThreadPoolExecutor {
               Runnable task = takeQueue.take();
               if (forFnExec) {
                 if (!putQueue.offer(task, retryFor, TimeUnit.MILLISECONDS)) {
-                  submit(task);
+                  execute(task);
                 }
               } else {
                 putQueue.put(task);

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
index 6bae8ba..59488ad 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
@@ -1158,7 +1158,7 @@ public class InternalLocator extends Locator implements ConnectListener {
       this.isSharedConfigurationStarted = true;
       if (isSharedConfigurationEnabled()) {
         ExecutorService es = newCache.getDistributionManager().getThreadPool();
-        es.submit(new SharedConfigurationRunnable());
+        es.execute(new SharedConfigurationRunnable());
       }
       if (!this.server.isAlive()) {
         logger.info("Locator restart: starting TcpServer");
@@ -1435,7 +1435,7 @@ public class InternalLocator extends Locator implements ConnectListener {
       this.isSharedConfigurationStarted = true;
       installSharedConfigStatus();
       ExecutorService es = gfc.getDistributionManager().getThreadPool();
-      es.submit(new SharedConfigurationRunnable());
+      es.execute(new SharedConfigurationRunnable());
     } else {
       logger.info("Cluster configuration service is disabled");
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
index f73e3f9..5affdb5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DiskStoreImpl.java
@@ -4559,7 +4559,7 @@ public class DiskStoreImpl implements DiskStore {
    * tasks may take a while.
    */
   public boolean executeDiskStoreTask(final Runnable runnable) {
-    return executeDiskStoreTask(runnable, this.diskStoreTaskPool) != null;
+    return executeDiskStoreAsyncTask(runnable, this.diskStoreTaskPool);
   }
 
   /**
@@ -4617,6 +4617,32 @@ public class DiskStoreImpl implements DiskStore {
     return result;
   }
 
+  private boolean executeDiskStoreAsyncTask(final Runnable runnable, ThreadPoolExecutor executor) {
+    // schedule another thread to do it
+    incBackgroundTasks();
+    boolean isTaskAccepted = executeDiskStoreAsyncTask(new DiskStoreTask() {
+      public void run() {
+        try {
+          markBackgroundTaskThread(); // for bug 42775
+          // getCache().getCachePerfStats().decDiskTasksWaiting();
+          runnable.run();
+        } finally {
+          decBackgroundTasks();
+        }
+      }
+
+      public void taskCancelled() {
+        decBackgroundTasks();
+      }
+    }, executor);
+
+    if (!isTaskAccepted) {
+      decBackgroundTasks();
+    }
+
+    return isTaskAccepted;
+  }
+
   private Future<?> executeDiskStoreTask(DiskStoreTask r, ThreadPoolExecutor executor) {
     try {
       return executor.submit(r);
@@ -4628,6 +4654,18 @@ public class DiskStoreImpl implements DiskStore {
     return null;
   }
 
+  private boolean executeDiskStoreAsyncTask(DiskStoreTask r, ThreadPoolExecutor executor) {
+    try {
+      executor.execute(r);
+      return true;
+    } catch (RejectedExecutionException ex) {
+      if (logger.isDebugEnabled()) {
+        logger.debug("Ignored compact schedule during shutdown", ex);
+      }
+    }
+    return false;
+  }
+
   private void stopDiskStoreTaskPool() {
     if (logger.isDebugEnabled()) {
       logger.debug("Stopping DiskStoreTaskPool");

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
index ba1f166..258a82e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java
@@ -1801,7 +1801,7 @@ public class PRHARedundancyProvider {
       Runnable task = new CreateMissingBucketsTask(this);
       final InternalResourceManager resourceManager =
           this.prRegion.getGemFireCache().getResourceManager();
-      resourceManager.getExecutor().submit(task);
+      resourceManager.getExecutor().execute(task);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
index a8ad959..b22bb0e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
@@ -423,7 +423,7 @@ public class HeapEvictor implements ResourceListener<MemoryEvent> {
         };
 
         // Submit the first pass at eviction into the pool
-        this.evictorThreadPool.submit(evictionManagerTask);
+        this.evictorThreadPool.execute(evictionManagerTask);
 
       } else {
         this.mustEvict.set(false);

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/internal/util/concurrent/CustomEntryConcurrentHashMap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/util/concurrent/CustomEntryConcurrentHashMap.java b/geode-core/src/main/java/org/apache/geode/internal/util/concurrent/CustomEntryConcurrentHashMap.java
index 1e9d63e..94e55b0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/util/concurrent/CustomEntryConcurrentHashMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/util/concurrent/CustomEntryConcurrentHashMap.java
@@ -1814,7 +1814,7 @@ public class CustomEntryConcurrentHashMap<K, V> extends AbstractMap<K, V>
         InternalDistributedSystem ids = InternalDistributedSystem.getConnectedInstance();
         if (ids != null) {
           try {
-            ids.getDistributionManager().getWaitingThreadPool().submit(runnable);
+            ids.getDistributionManager().getWaitingThreadPool().execute(runnable);
             submitted = true;
           } catch (RejectedExecutionException e) {
             // fall through with submitted false

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
index ab1c56a..da92f69 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/FederatingManager.java
@@ -26,7 +26,6 @@ import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 
-import javax.management.InstanceNotFoundException;
 import javax.management.Notification;
 import javax.management.ObjectName;
 
@@ -196,7 +195,12 @@ public class FederatingManager extends Manager {
    */
   public void addMember(DistributedMember member) {
     GIITask giiTask = new GIITask(member);
-    submitTask(giiTask);
+    executeTask(new Runnable() {
+      @Override
+      public void run() {
+        giiTask.call();
+      }
+    });
   }
 
 
@@ -211,7 +215,7 @@ public class FederatingManager extends Manager {
    */
   public void removeMember(DistributedMember member, boolean crashed) {
     RemoveMemberTask removeTask = new RemoveMemberTask(member, crashed);
-    submitTask(removeTask);
+    executeTask(removeTask);
   }
 
   private void submitTask(Callable<DistributedMember> task) {
@@ -222,7 +226,15 @@ public class FederatingManager extends Manager {
     }
   }
 
-  private class RemoveMemberTask implements Callable<DistributedMember> {
+  private void executeTask(Runnable task) {
+    try {
+      pooledMembershipExecutor.execute(task);
+    } catch (java.util.concurrent.RejectedExecutionException ex) {
+      // Ignore, we are getting shutdown
+    }
+  }
+
+  private class RemoveMemberTask implements Runnable {
 
     private DistributedMember member;
 
@@ -233,8 +245,8 @@ public class FederatingManager extends Manager {
       this.crashed = crashed;
     }
 
-    public DistributedMember call() {
-      return removeMemberArtifacts(member, crashed);
+    public void run() {
+      removeMemberArtifacts(member, crashed);
     }
   }
 
@@ -293,7 +305,7 @@ public class FederatingManager extends Manager {
     DistributedMember member;
 
 
-    List<GIITask> giiTaskList = new ArrayList<GIITask>();
+    final List<Callable<DistributedMember>> giiTaskList = new ArrayList<>();
 
     List<Future<DistributedMember>> futureTaskList;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/test/java/org/apache/geode/cache/client/internal/SingleHopClientExecutorSubmitTaskWithExceptionTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/SingleHopClientExecutorSubmitTaskWithExceptionTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/SingleHopClientExecutorSubmitTaskWithExceptionTest.java
new file mode 100644
index 0000000..3a9ece9
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/SingleHopClientExecutorSubmitTaskWithExceptionTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.cache.client.internal;
+
+import java.util.concurrent.TimeUnit;
+
+import com.jayway.awaitility.Awaitility;
+
+import org.apache.geode.test.junit.categories.UnitTest;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.contrib.java.lang.system.SystemErrRule;
+import org.junit.experimental.categories.Category;
+
+/**
+ * Test if exceptions are logged when thread is submitted using
+ * {@code SingleHopClientExecutor#submitTask} method.
+ */
+@Category(UnitTest.class)
+public class SingleHopClientExecutorSubmitTaskWithExceptionTest {
+
+  @Rule
+  public SystemErrRule systemErrRule = new SystemErrRule().enableLog();
+
+  /**
+   * Refer: GEODE-2109 This test verifies that any exception thrown from forked thread is logged
+   * into log.
+   */
+  @Test
+  public void submittedTaskShouldLogFailure() {
+    String erroMsg = "I am expecting this to be logged";
+
+    SingleHopClientExecutor.submitTask(new Runnable() {
+      @Override
+      public void run() {
+        // test piece throwing exception
+        throw new RuntimeException(erroMsg);
+      }
+    });
+
+    /**
+     * Sometimes need to wait for more than sec as thread execution takes time.
+     */
+    Awaitility.await("Waiting for exception").atMost(60l, TimeUnit.SECONDS).until(() -> {
+      systemErrRule.getLog().contains(erroMsg);
+    });
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/test/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java
index 91b3140..ed32be8 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java
@@ -580,6 +580,9 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
 
   @Test
   public void testPR_RemotePutRejectionCacheClose() throws Exception {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     prRemotePutRejection(true, false, false);
   }
 
@@ -595,6 +598,9 @@ public class MemoryThresholdsDUnitTest extends ClientServerTestCase {
 
   @Test
   public void testPR_RemotePutRejectionCacheCloseWithTx() throws Exception {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     prRemotePutRejection(true, false, true);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/test/java/org/apache/geode/internal/cache/EvictionStatsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/EvictionStatsDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/EvictionStatsDUnitTest.java
index 187b0bb..11efd53 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/EvictionStatsDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/EvictionStatsDUnitTest.java
@@ -14,6 +14,7 @@
  */
 package org.apache.geode.internal.cache;
 
+import org.apache.geode.test.dunit.IgnoredException;
 import org.junit.experimental.categories.Category;
 import org.junit.Test;
 
@@ -84,6 +85,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testEntryLruLimitNDestroyLimit() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     prepareScenario(EvictionAlgorithm.LRU_ENTRY);
     putData("PR1", 100);
     putData("PR2", 60);
@@ -123,6 +127,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testMemLruLimitNDestroyLimit() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     prepareScenario(EvictionAlgorithm.LRU_MEMORY);
     putData("PR1", 100);
     putData("PR2", 60);
@@ -164,6 +171,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testEntryLruCounter() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     prepareScenario(EvictionAlgorithm.LRU_ENTRY);
     putData("PR1", 10);
     putData("PR2", 16);
@@ -179,6 +189,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testMemLruCounter() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     prepareScenario(EvictionAlgorithm.LRU_MEMORY);
     putData("PR1", 10);
     putData("PR2", 16);
@@ -194,6 +207,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testHeapLruCounter() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     prepareScenario(EvictionAlgorithm.LRU_HEAP);
     System.setProperty(HeapLRUCapacityController.TOP_UP_HEAP_EVICTION_PERCENTAGE_PROPERTY,
         Float.toString(0));
@@ -208,6 +224,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testEntryLruAllCounterMethods() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     final long ONE_MEG = 1024L * 1024L;
     createCache();
     createPartitionedRegion(true, EvictionAlgorithm.LRU_ENTRY, "PR1", 2, 1, 10000);
@@ -277,6 +296,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testEntryLRUEvictionNDestroyNNumOverflowOnDiskCount() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     final int extraEnteries = 24;
     prepareScenario(EvictionAlgorithm.LRU_ENTRY);
     putData("PR1", maxEnteries + extraEnteries);
@@ -324,6 +346,9 @@ public class EvictionStatsDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testMemLRUEvictionNDestroyNNumOverflowOnDiskCount() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     int localMaxMem = 50;
     final int extraEntries = 6;
     prepareScenario(EvictionAlgorithm.LRU_MEMORY);

http://git-wip-us.apache.org/repos/asf/geode/blob/bb3d20f4/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionEvictionDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionEvictionDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionEvictionDUnitTest.java
index b43c0b0..cc6616a 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionEvictionDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/PartitionedRegionEvictionDUnitTest.java
@@ -22,6 +22,7 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.geode.test.dunit.IgnoredException;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
@@ -64,6 +65,9 @@ public class PartitionedRegionEvictionDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testHeapLRUWithOverflowToDisk() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
     final VM vm3 = host.getVM(3);
@@ -206,6 +210,9 @@ public class PartitionedRegionEvictionDUnitTest extends JUnit4CacheTestCase {
 
   @Test
   public void testHeapLRUWithLocalDestroy() {
+    // Ignore this excetion as this can happen if pool is shutting down
+    IgnoredException
+        .addIgnoredException(java.util.concurrent.RejectedExecutionException.class.getName());
     final Host host = Host.getHost(0);
     final VM vm2 = host.getVM(2);
     final VM vm3 = host.getVM(3);


[11/25] geode git commit: GEODE-2207 GEODE-1662: fix and rename SecurityManager callback test

Posted by km...@apache.org.
GEODE-2207 GEODE-1662: fix and rename SecurityManager callback test


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/3f655c0b
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/3f655c0b
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/3f655c0b

Branch: refs/heads/feature/GEODE-2231
Commit: 3f655c0b137eeb740a6637168b5520641a0c5cf6
Parents: 84bd611
Author: Kirk Lund <kl...@apache.org>
Authored: Thu Dec 15 17:02:58 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 ...edSecurityCacheLifecycleDistributedTest.java | 131 ------------------
 ...SecurityManagerCallbacksDistributedTest.java | 132 +++++++++++++++++++
 .../geode/security/SpySecurityManager.java      |   6 +-
 3 files changed, 135 insertions(+), 134 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/3f655c0b/geode-core/src/test/java/org/apache/geode/security/IntegratedSecurityCacheLifecycleDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/IntegratedSecurityCacheLifecycleDistributedTest.java b/geode-core/src/test/java/org/apache/geode/security/IntegratedSecurityCacheLifecycleDistributedTest.java
deleted file mode 100644
index 00a9276..0000000
--- a/geode-core/src/test/java/org/apache/geode/security/IntegratedSecurityCacheLifecycleDistributedTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.security;
-
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.assertj.core.api.Assertions.*;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import org.apache.geode.cache.server.CacheServer;
-import org.apache.geode.internal.AvailablePortHelper;
-import org.apache.geode.internal.security.IntegratedSecurityService;
-import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.management.ManagementService;
-import org.apache.geode.test.dunit.DistributedTestUtils;
-import org.apache.geode.test.dunit.Host;
-import org.apache.geode.test.dunit.NetworkUtils;
-import org.apache.geode.test.dunit.VM;
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
-import org.apache.geode.test.junit.categories.FlakyTest;
-import org.apache.geode.test.junit.categories.SecurityTest;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-@Ignore("This is broken but fixed on feature/GEODE-1673")
-@Category({DistributedTest.class, SecurityTest.class})
-public class IntegratedSecurityCacheLifecycleDistributedTest extends JUnit4CacheTestCase {
-
-  private String locators;
-  private VM locator;
-  private SecurityService securityService;
-
-  @Override
-  public final void postSetUp() throws Exception {
-    Host host = Host.getHost(0);
-    locator = host.getVM(0);
-
-    securityService = IntegratedSecurityService.getSecurityService();
-
-    int[] ports = AvailablePortHelper.getRandomAvailableTCPPorts(2);
-    int locatorPort = ports[0];
-    int managerPort = ports[1];
-
-    locators = NetworkUtils.getServerHostName(host) + "[" + locatorPort + "]";
-
-    locator.invoke(() -> {
-      DistributedTestUtils.deleteLocatorStateFile(locatorPort);
-
-      final Properties properties = new Properties();
-      properties.setProperty(TestSecurityManager.SECURITY_JSON,
-          "org/apache/geode/management/internal/security/clientServer.json");
-      properties.setProperty(LOCATORS, locators);
-      properties.setProperty(MCAST_PORT, "0");
-      properties.setProperty(SECURITY_MANAGER, SpySecurityManager.class.getName());
-      properties.setProperty(START_LOCATOR, locators);
-      properties.setProperty(JMX_MANAGER, "true");
-      properties.setProperty(JMX_MANAGER_START, "true");
-      properties.setProperty(JMX_MANAGER_PORT, String.valueOf(managerPort));
-      properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
-      getSystem(properties);
-      getCache();
-    });
-  }
-
-  @Category(FlakyTest.class) // GEODE-1662
-  @Test
-  public void initAndCloseTest() throws Exception {
-    connect();
-
-    {
-      ManagementService ms = ManagementService.getExistingManagementService(getCache());
-      assertThat(ms).isNotNull();
-      assertThat(ms.isManager()).isFalse();
-
-      verifyInitCloseInvoked();
-    }
-
-    locator.invoke(() -> {
-      ManagementService ms = ManagementService.getExistingManagementService(getCache());
-      assertThat(ms).isNotNull();
-      assertThat(ms.isManager()).isTrue();
-
-      verifyInitCloseInvoked();
-    });
-  }
-
-  private void connect() throws IOException {
-    final Properties properties = new Properties();
-    properties.setProperty(TestSecurityManager.SECURITY_JSON,
-        "org/apache/geode/management/internal/security/clientServer.json");
-    properties.setProperty(LOCATORS, locators);
-    properties.setProperty(MCAST_PORT, "0");
-    properties.setProperty(SECURITY_MANAGER, SpySecurityManager.class.getName());
-    properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
-
-    getSystem(properties);
-
-    CacheServer server1 = getCache().addCacheServer();
-    server1.setPort(0);
-    server1.start();
-
-    getCache();
-  }
-
-  @Override
-  public void postTearDownCacheTestCase() throws Exception {
-    closeAllCache();
-  }
-
-  private void verifyInitCloseInvoked() {
-    SpySecurityManager ssm = (SpySecurityManager) this.securityService.getSecurityManager();
-    assertThat(ssm.initInvoked).isEqualTo(1);
-    getCache().close();
-    assertThat(ssm.closeInvoked).isEqualTo(1);
-  }
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/3f655c0b/geode-core/src/test/java/org/apache/geode/security/SecurityManagerCallbacksDistributedTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/SecurityManagerCallbacksDistributedTest.java b/geode-core/src/test/java/org/apache/geode/security/SecurityManagerCallbacksDistributedTest.java
new file mode 100644
index 0000000..09c30f5
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/security/SecurityManagerCallbacksDistributedTest.java
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.geode.security;
+
+import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.internal.AvailablePortHelper.getRandomAvailableTCPPorts;
+import static org.apache.geode.internal.security.IntegratedSecurityService.getSecurityService;
+import static org.apache.geode.management.ManagementService.getExistingManagementService;
+import static org.apache.geode.test.dunit.DistributedTestUtils.deleteLocatorStateFile;
+import static org.apache.geode.test.dunit.Host.getHost;
+import static org.apache.geode.test.dunit.NetworkUtils.getServerHostName;
+import static org.assertj.core.api.Assertions.*;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.geode.cache.server.CacheServer;
+import org.apache.geode.cache30.CacheTestCase;
+import org.apache.geode.management.ManagementService;
+import org.apache.geode.test.dunit.Host;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.categories.SecurityTest;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+@Category({DistributedTest.class, SecurityTest.class})
+public class SecurityManagerCallbacksDistributedTest extends CacheTestCase {
+
+  private String locators;
+  private VM locatorVM;
+
+  @Before
+  public void before() throws Exception {
+    Host host = getHost(0);
+    this.locatorVM = host.getVM(0);
+
+    int[] ports = getRandomAvailableTCPPorts(2);
+    int locatorPort = ports[0];
+    int managerPort = ports[1];
+
+    this.locators = getServerHostName(host) + "[" + locatorPort + "]";
+
+    this.locatorVM.invoke(() -> {
+      deleteLocatorStateFile(locatorPort);
+
+      Properties properties = new Properties();
+      properties.setProperty(LOCATORS, locators);
+      properties.setProperty(MCAST_PORT, "0");
+      properties.setProperty(START_LOCATOR, locators);
+      properties.setProperty(JMX_MANAGER, "true");
+      properties.setProperty(JMX_MANAGER_PORT, String.valueOf(managerPort));
+      properties.setProperty(JMX_MANAGER_START, "true");
+      properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+      properties.setProperty(SECURITY_MANAGER, SpySecurityManager.class.getName());
+      properties.setProperty("security-username", "secure");
+      properties.setProperty("security-password", "secure");
+
+      getSystem(properties);
+      getCache();
+    });
+  }
+
+  @After
+  public void after() throws Exception {
+    closeAllCache();
+  }
+
+  @Test
+  public void callbacksShouldBeInvoked() throws Exception {
+    connectServer();
+
+    verifyCallbacksRegardlessOfManager(false);
+
+    this.locatorVM.invoke(() -> {
+      verifyCallbacksRegardlessOfManager(true);
+    });
+  }
+
+  private void connectServer() throws IOException {
+    Properties properties = new Properties();
+    properties.setProperty(LOCATORS, locators);
+    properties.setProperty(MCAST_PORT, "0");
+    properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(SECURITY_MANAGER, SpySecurityManager.class.getName());
+    properties.setProperty("security-username", "secure");
+    properties.setProperty("security-password", "secure");
+
+    getSystem(properties);
+
+    CacheServer server1 = getCache().addCacheServer();
+    server1.setPort(0);
+    server1.start();
+
+    getCache();
+  }
+
+  private void verifyCallbacksRegardlessOfManager(final boolean isManager) {
+    ManagementService ms = getExistingManagementService(getCache());
+    assertThat(ms).isNotNull();
+    assertThat(ms.isManager()).isEqualTo(isManager);
+
+    verifyInitAndCloseInvoked();
+  }
+
+  private void verifyInitAndCloseInvoked() {
+    SpySecurityManager ssm = (SpySecurityManager) getSecurityService().getSecurityManager();
+
+    assertThat(ssm.initInvoked).isEqualTo(1);
+    assertThat(ssm.closeInvoked).isEqualTo(0);
+
+    getCache().close();
+
+    assertThat(ssm.initInvoked).isEqualTo(1);
+    assertThat(ssm.closeInvoked).isEqualTo(1);
+  }
+}

http://git-wip-us.apache.org/repos/asf/geode/blob/3f655c0b/geode-core/src/test/java/org/apache/geode/security/SpySecurityManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/security/SpySecurityManager.java b/geode-core/src/test/java/org/apache/geode/security/SpySecurityManager.java
index 8704e93..1109489 100644
--- a/geode-core/src/test/java/org/apache/geode/security/SpySecurityManager.java
+++ b/geode-core/src/test/java/org/apache/geode/security/SpySecurityManager.java
@@ -18,7 +18,7 @@ import java.util.Properties;
 
 import org.apache.geode.security.SecurityManager;
 
-public class SpySecurityManager implements SecurityManager {
+public class SpySecurityManager extends SimpleTestSecurityManager {
 
   public int initInvoked = 0;
   public int closeInvoked = 0;
@@ -29,8 +29,8 @@ public class SpySecurityManager implements SecurityManager {
   }
 
   @Override
-  public Object authenticate(final Properties props) throws AuthenticationFailedException {
-    return null;
+  public boolean authorize(final Object principal, final ResourcePermission permission) {
+    return true;
   }
 
   @Override


[08/25] geode git commit: GEODE-1893 remove ability to create a locator without all location services

Posted by km...@apache.org.
GEODE-1893 remove ability to create a locator without all location services

Deprecated API options for creating a locator without peerLocation or
serverLocation handlers.  There will be documentation work to do since
the docs mention this in at least one place.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/5fa388cd
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/5fa388cd
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/5fa388cd

Branch: refs/heads/feature/GEODE-2231
Commit: 5fa388cd0da472bf1c9b80361c1cd8f83b351b80
Parents: 03f7532
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Tue Dec 20 14:40:01 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../distributed/ConfigurationProperties.java    | 17 ++---
 .../org/apache/geode/distributed/Locator.java   | 15 ++--
 .../geode/distributed/LocatorLauncher.java      | 15 +---
 .../internal/InternalDistributedSystem.java     | 24 ++----
 .../distributed/internal/InternalLocator.java   | 50 +++++--------
 .../geode/internal/DistributionLocator.java     |  3 +-
 .../admin/remote/DistributionLocatorId.java     | 30 +++-----
 .../internal/beans/LocatorMBeanBridge.java      |  4 +-
 .../geode/distributed/LocatorJUnitTest.java     | 28 -------
 .../InternalDistributedSystemJUnitTest.java     |  3 -
 .../locator/GMSLocatorRecoveryJUnitTest.java    |  2 +-
 .../management/LocatorManagementDUnitTest.java  | 79 +++++++++++---------
 .../codeAnalysis/sanctionedSerializables.txt    |  0
 .../internal/locator/wan/LocatorHelper.java     |  3 -
 14 files changed, 94 insertions(+), 179 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java b/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
index 536e4b6..63f6505 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/ConfigurationProperties.java
@@ -1114,8 +1114,7 @@ public interface ConfigurationProperties {
    * name="ssl-locator-alias"/a>
    * </p>
    * <U>Description</U>: This property is to be used if a specific key is to be used for the SSL
-   * communications for the locator. These Communications would be either locator-client or
-   * locator-server
+   * communications for locators and for communicating with locators.
    * </p>
    * <U><i>Optional</i></U> <U>Default</U>: ""
    * </p>
@@ -1725,16 +1724,12 @@ public interface ConfigurationProperties {
   /**
    * The static String definition of the <i>"start-locator"</i> property <a name="start-locator"/a>
    * </p>
-   * <U>Description</U>: A host name or bind-address and port
-   * ("host[port],peer=<true|false>,server=<true|false>") that are used to start a locator in the
-   * same process as the DistributedSystem. The locator is started when the DistributedSystem
-   * connects, and is stopped when the DistributedSystem disconnects. To start a locator that is not
-   * tied to the DistributedSystem's lifecycle, see the {@link Locator} class in this same package.
+   * <U>Description</U>: A host name or bind-address and port ("host[port]") that are used to start
+   * a locator in the same process as the DistributedSystem. The locator is started when the
+   * DistributedSystem connects, and is stopped when the DistributedSystem disconnects. To start a
+   * locator that is not tied to the DistributedSystem's lifecycle, see the {@link Locator} class in
+   * this same package.
    * <p>
-   * <p>
-   * The peer and server parameters are optional. They specify whether the locator can be used for
-   * peers to discover each other, or for clients to discover peers. By default both are true.
-   * </p>
    * <U>Default</U>: "" (doesn't start a locator)
    */
   String START_LOCATOR = "start-locator";

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/distributed/Locator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/Locator.java b/geode-core/src/main/java/org/apache/geode/distributed/Locator.java
index 049ead4..2c7c251 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/Locator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/Locator.java
@@ -74,8 +74,6 @@ public abstract class Locator {
    */
   protected String hostnameForClients;
 
-  protected static boolean loadSharedConfig = false;
-
   ////////////////////// Static Methods //////////////////////
 
   /**
@@ -104,7 +102,7 @@ public abstract class Locator {
    */
   public static Locator startLocator(int port, File logFile) throws IOException {
 
-    return startLocator(port, logFile, false, (InetAddress) null, (Properties) null, true, false,
+    return startLocator(port, logFile, false, (InetAddress) null, (Properties) null, true, true,
         null);
   }
 
@@ -169,7 +167,7 @@ public abstract class Locator {
   public static Locator startLocator(int port, File logFile, InetAddress bindAddress)
       throws IOException {
 
-    return startLocator(port, logFile, false, bindAddress, (Properties) null, true, false, null);
+    return startLocator(port, logFile, false, bindAddress, (Properties) null, true, true, null);
   }
 
 
@@ -211,6 +209,7 @@ public abstract class Locator {
    * system with a long-running process that can be relied on for stable membership information. The
    * locator will provide provide peer and cache server location services.
    *
+   * @deprecated use a different startup method peerLocator and serverLocator parameters are ignored
    * @since GemFire 5.7
    *
    * @param port The port on which the locator will listen for membership information requests from
@@ -241,8 +240,7 @@ public abstract class Locator {
   public static Locator startLocatorAndDS(int port, File logFile, InetAddress bindAddress,
       java.util.Properties dsProperties, boolean peerLocator, boolean serverLocator,
       String hostnameForClients) throws IOException {
-    return startLocator(port, logFile, bindAddress, dsProperties, peerLocator, serverLocator,
-        hostnameForClients);
+    return startLocator(port, logFile, bindAddress, dsProperties, true, true, hostnameForClients);
   }
 
   /**
@@ -253,7 +251,7 @@ public abstract class Locator {
       java.util.Properties dsProperties, boolean peerLocator, boolean serverLocator,
       String hostnameForClients) throws IOException {
     return InternalLocator.startLocator(port, logFile, null, null, null, bindAddress, dsProperties,
-        peerLocator, serverLocator, hostnameForClients, loadSharedConfig);
+        hostnameForClients);
   }
 
   /**
@@ -264,8 +262,7 @@ public abstract class Locator {
       InetAddress bindAddress, java.util.Properties dsProperties, boolean peerLocator,
       boolean serverLocator, String hostnameForClients) throws IOException {
     return InternalLocator.startLocator(port, logFile, null, null, null, bindAddress,
-        startDistributedSystem, dsProperties, peerLocator, serverLocator, hostnameForClients,
-        loadSharedConfig);
+        startDistributedSystem, dsProperties, hostnameForClients);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
index d704804..3a3ee82 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/LocatorLauncher.java
@@ -120,18 +120,6 @@ public final class LocatorLauncher extends AbstractLauncher<String> {
    * @deprecated This is specific to the internal implementation and may go away in a future
    *             release.
    */
-  public static final boolean DEFAULT_ENABLE_PEER_LOCATION = true;
-
-  /**
-   * @deprecated This is specific to the internal implementation and may go away in a future
-   *             release.
-   */
-  public static final boolean DEFAULT_ENABLE_SERVER_LOCATION = true;
-
-  /**
-   * @deprecated This is specific to the internal implementation and may go away in a future
-   *             release.
-   */
   public static final String DEFAULT_LOCATOR_PID_FILE = "vf.gf.locator.pid";
 
   private static final String DEFAULT_LOCATOR_LOG_EXT = ".log";
@@ -640,8 +628,7 @@ public final class LocatorLauncher extends AbstractLauncher<String> {
         // TODO : remove the extra param for loadFromSharedConfigDir
         try {
           this.locator = InternalLocator.startLocator(getPort(), getLogFile(), null, null, null,
-              getBindAddress(), getDistributedSystemProperties(), DEFAULT_ENABLE_PEER_LOCATION,
-              DEFAULT_ENABLE_SERVER_LOCATION, getHostnameForClients(), false);
+              getBindAddress(), getDistributedSystemProperties(), getHostnameForClients());
         } finally {
           ProcessLauncherContext.remove();
         }

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index 95aa7df..3d51fb9 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -795,15 +795,13 @@ public class InternalDistributedSystem extends DistributedSystem
       // if locator is started this way, cluster config is not enabled, set the flag correctly
       this.startedLocator.getConfig().setEnableClusterConfiguration(false);
 
-      if (locId.isPeerLocator()) {
-        boolean startedPeerLocation = false;
-        try {
-          this.startedLocator.startPeerLocation(true);
-          startedPeerLocation = true;
-        } finally {
-          if (!startedPeerLocation) {
-            this.startedLocator.stop();
-          }
+      boolean startedPeerLocation = false;
+      try {
+        this.startedLocator.startPeerLocation(true);
+        startedPeerLocation = true;
+      } finally {
+        if (!startedPeerLocation) {
+          this.startedLocator.stop();
         }
       }
     } catch (IOException e) {
@@ -820,17 +818,9 @@ public class InternalDistributedSystem extends DistributedSystem
   private void endInitLocator() throws IOException {
     InternalLocator loc = this.startedLocator;
     if (loc != null) {
-      String locatorString = this.originalConfig.getStartLocator();
-      // DistributionLocatorId locId = new DistributionLocatorId(locatorString);
       boolean finished = false;
       try {
-        // during the period when the product is using only paper licenses we always
-        // start server location services in order to be able to log information
-        // about the use of cache servers
-        // if(locId.isServerLocator()) {
         loc.startServerLocation(this);
-        // }
-
         loc.endStartLocator(this);
         finished = true;
       } finally {

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
index 18eee70..6bae8ba 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
@@ -306,22 +306,15 @@ public class InternalLocator extends Locator implements ConnectListener {
    * @param securityLogger the logger to be used for security related log messages
    * @param dsProperties optional properties to configure the distributed system (e.g., mcast
    *        addr/port, other locators)
-   * @param peerLocator enable peer location services
-   * @param enableServerLocator enable server location services
    * @param hostnameForClients the name to give to clients for connecting to this locator
-   * @param loadSharedConfigFromDir load the shared configuration from the shared configuration
-   *        directory
-   *
    * @throws IOException
    * @since GemFire 7.0
    */
   public static InternalLocator startLocator(int port, File logFile, File stateFile,
       InternalLogWriter logger, InternalLogWriter securityLogger, InetAddress bindAddress,
-      java.util.Properties dsProperties, boolean peerLocator, boolean enableServerLocator,
-      String hostnameForClients, boolean loadSharedConfigFromDir) throws IOException {
+      Properties dsProperties, String hostnameForClients) throws IOException {
     return startLocator(port, logFile, stateFile, logger, securityLogger, bindAddress, true,
-        dsProperties, peerLocator, enableServerLocator, hostnameForClients,
-        loadSharedConfigFromDir);
+        dsProperties, hostnameForClients);
   }
 
 
@@ -337,25 +330,15 @@ public class InternalLocator extends Locator implements ConnectListener {
    * @param startDistributedSystem if true, a distributed system is started
    * @param dsProperties optional properties to configure the distributed system (e.g., mcast
    *        addr/port, other locators)
-   * @param peerLocator enable peer location services
-   * @param enableServerLocator enable server location services
    * @param hostnameForClients the name to give to clients for connecting to this locator
-   * @param loadSharedConfigFromDir TODO:CONFIG
    *
    * @throws IOException
    */
   public static InternalLocator startLocator(int port, File logFile, File stateFile,
       InternalLogWriter logger, InternalLogWriter securityLogger, InetAddress bindAddress,
-      boolean startDistributedSystem, java.util.Properties dsProperties, boolean peerLocator,
-      boolean enableServerLocator, String hostnameForClients, boolean loadSharedConfigFromDir)
+      boolean startDistributedSystem, Properties dsProperties, String hostnameForClients)
       throws IOException {
 
-    if (!peerLocator && !enableServerLocator) {
-      throw new IllegalArgumentException(
-          LocalizedStrings.InternalLocator_EITHER_PEER_LOCATOR_OR_SERVER_LOCATOR_MUST_BE_ENABLED
-              .toLocalizedString());
-    }
-
     System.setProperty(FORCE_LOCATOR_DM_TYPE, "true");
     InternalLocator slocator = null;
 
@@ -368,13 +351,9 @@ public class InternalLocator extends Locator implements ConnectListener {
       // TODO:GEODE-1243: this.server is now a TcpServer and it should store or return its non-zero
       // port in a variable to use here
 
-      if (enableServerLocator) {
-        slocator.handler.willHaveServerLocator = true;
-      }
+      slocator.handler.willHaveServerLocator = true;
       try {
-        if (peerLocator) {
-          slocator.startPeerLocation(startDistributedSystem);
-        }
+        slocator.startPeerLocation(startDistributedSystem);
         if (startDistributedSystem) {
           try {
             slocator.startDistributedSystem(); // TODO:GEODE-1243: throws Exception if TcpServer
@@ -395,12 +374,6 @@ public class InternalLocator extends Locator implements ConnectListener {
       }
 
 
-      // during the period when the product is using only paper licenses we always
-      // start server location services in order to be able to log information
-      // about the use of cache servers
-      // if(enableServerLocator) {
-      // slocator.startServerLocation(InternalDistributedSystem.getConnectedInstance());
-      // }
       InternalDistributedSystem sys = InternalDistributedSystem.getConnectedInstance();
       if (sys != null) {
         try {
@@ -647,6 +620,19 @@ public class InternalLocator extends Locator implements ConnectListener {
     return this.locatorImpl;
   }
 
+  /**
+   * For backward-compatibility we retain this method
+   * 
+   * @deprecated use a form of the method that does not have peerLocator/serverLocator parameters
+   */
+  public static InternalLocator startLocator(int locatorPort, File logFile, File stateFile,
+      InternalLogWriter logger, InternalLogWriter logger1, InetAddress addr,
+      Properties dsProperties, boolean peerLocator, boolean serverLocator, String s, boolean b1)
+      throws IOException {
+    return startLocator(locatorPort, logFile, stateFile, logger, logger1, addr, dsProperties, s);
+
+  }
+
   class SharedConfigurationRunnable implements Runnable {
 
     private final InternalLocator locator = InternalLocator.this;

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java b/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java
index e0de2bd..f861515 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/DistributionLocator.java
@@ -167,8 +167,7 @@ public class DistributionLocator {
       try {
 
         InternalLocator locator = InternalLocator.startLocator(port, new File(DEFAULT_LOG_FILE),
-            null, null, null, address, (Properties) null, peerLocator, serverLocator,
-            hostnameForClients, LOAD_SHARED_CONFIGURATION);
+            null, null, null, address, (Properties) null, hostnameForClients);
 
         ManagerInfo.setLocatorStarted(directory, port, address);
         locator.waitToStop();

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
index f724292..5ab1bed 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/DistributionLocatorId.java
@@ -42,6 +42,8 @@ public class DistributionLocatorId implements java.io.Serializable {
   private final int port;
   private final String bindAddress;
   transient private SSLConfig sslConfig;
+  // the following two fields are not used but are retained for backward compatibility
+  // as this class is Serializable and is used in WAN locator information exchange
   private boolean peerLocator = true;
   private boolean serverLocator = true;
   private String hostnameForClients;
@@ -78,13 +80,11 @@ public class DistributionLocatorId implements java.io.Serializable {
   }
 
   public DistributionLocatorId(InetAddress host, int port, String bindAddress, SSLConfig sslConfig,
-      boolean peerLocator, boolean serverLocator, String hostnameForClients) {
+      String hostnameForClients) {
     this.host = host;
     this.port = port;
     this.bindAddress = validateBindAddress(bindAddress);
     this.sslConfig = validateSSLConfig(sslConfig);
-    this.peerLocator = peerLocator;
-    this.serverLocator = serverLocator;
     this.hostnameForClients = hostnameForClients;
   }
 
@@ -155,14 +155,16 @@ public class DistributionLocatorId implements java.io.Serializable {
         String[] optionFields = options[i].split("=");
         if (optionFields.length == 2) {
           if (optionFields[0].equalsIgnoreCase("peer")) {
-            this.peerLocator = Boolean.valueOf(optionFields[1]).booleanValue();
+            // this setting is deprecated
+            // this.peerLocator = Boolean.valueOf(optionFields[1]).booleanValue();
           } else if (optionFields[0].equalsIgnoreCase("server")) {
-            this.serverLocator = Boolean.valueOf(optionFields[1]).booleanValue();
+            // this setting is deprecated
+            // this.serverLocator = Boolean.valueOf(optionFields[1]).booleanValue();
           } else if (optionFields[0].equalsIgnoreCase("hostname-for-clients")) {
             this.hostnameForClients = optionFields[1];
           } else {
             throw new IllegalArgumentException(marshalled + " invalid option " + optionFields[0]
-                + ". valid options are \"peer\" or \"server\"");
+                + ". valid options are \"peer\", \"server\" and \"hostname-for-clients\"");
           }
         }
       }
@@ -172,7 +174,7 @@ public class DistributionLocatorId implements java.io.Serializable {
   public DistributionLocatorId(InetAddress address, Locator locator) {
     this(address, locator.getPort(),
         locator.getBindAddress() == null ? null : locator.getBindAddress().getHostAddress(), null,
-        locator.isPeerLocator(), locator.isServerLocator(), locator.getHostnameForClients());
+        locator.getHostnameForClients());
   }
 
   /**
@@ -233,20 +235,6 @@ public class DistributionLocatorId implements java.io.Serializable {
   /**
    * @since GemFire 5.7
    */
-  public boolean isPeerLocator() {
-    return this.peerLocator;
-  }
-
-  /**
-   * @since GemFire 5.7
-   */
-  public boolean isServerLocator() {
-    return this.serverLocator;
-  }
-
-  /**
-   * @since GemFire 5.7
-   */
   public String getHostnameForClients() {
     return this.hostnameForClients;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java b/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
index 9544a96..33b3175 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/beans/LocatorMBeanBridge.java
@@ -71,12 +71,12 @@ public class LocatorMBeanBridge {
 
 
   public boolean isPeerLocator() {
-    return loc.isPeerLocator();
+    return true;
   }
 
 
   public boolean isServerLocator() {
-    return loc.isServerLocator();
+    return true;
   }
 
   public String[] listManagers() {

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/test/java/org/apache/geode/distributed/LocatorJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/LocatorJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/LocatorJUnitTest.java
index 8be0e7a..65f0947 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/LocatorJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/LocatorJUnitTest.java
@@ -126,8 +126,6 @@ public class LocatorJUnitTest {
   @Test
   public void testBasicInfo() throws Exception {
     locator = Locator.startLocator(port, tmpFile);
-    assertTrue(locator.isPeerLocator());
-    assertFalse(locator.isServerLocator());
     int boundPort = (port == 0) ? locator.getPort() : port;
     TcpClient client = new TcpClient();
     String[] info = client.getInfo(InetAddress.getLocalHost(), boundPort);
@@ -165,32 +163,6 @@ public class LocatorJUnitTest {
     }
   }
 
-  @Test
-  public void testServerOnly() throws Exception {
-    Properties props = new Properties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION, "false");
-    locator = Locator.startLocatorAndDS(port, tmpFile, null, props, false, true, null);
-    assertFalse(locator.isPeerLocator());
-    assertTrue(locator.isServerLocator());
-    Thread.sleep(1000);
-    doServerLocation(locator.getPort());
-  }
-
-  @Test
-  public void testBothPeerAndServer() throws Exception {
-    Properties props = new Properties();
-    props.setProperty(MCAST_PORT, "0");
-    props.setProperty(ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION, "false");
-
-    locator = Locator.startLocatorAndDS(port, new File(""), null, props);
-    assertTrue(locator.isPeerLocator());
-    assertTrue(locator.isServerLocator());
-    Thread.sleep(1000);
-    doServerLocation(locator.getPort());
-    locator.stop();
-  }
-
   /**
    * Make sure two ServerLocation objects on different hosts but with the same port are not equal
    * <p/>

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
index 07c6f38..5a191bb 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalDistributedSystemJUnitTest.java
@@ -602,9 +602,6 @@ public class InternalDistributedSystemJUnitTest {
     Collection locators = Locator.getLocators();
     Assert.assertEquals(1, locators.size());
     Locator locator = (Locator) locators.iterator().next();
-    Assert.assertTrue(locator.isPeerLocator());
-    // Assert.assertFalse(locator.isServerLocator()); server location is forced on while licensing
-    // is disabled in GemFire
     // Assert.assertIndexDetailsEquals("127.0.0.1", locator.getBindAddress().getHostAddress());
     // removed this check for ipv6 testing
     Assert.assertEquals(unusedPort, locator.getPort().intValue());

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryJUnitTest.java
index 489d4b8..423d7e1 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryJUnitTest.java
@@ -136,7 +136,7 @@ public class GMSLocatorRecoveryJUnitTest {
       // to be created
       // l = Locator.startLocator(port, new File(""), localHost);
       l = InternalLocator.startLocator(port, new File(""), null, null, null, localHost, false,
-          new Properties(), true, false, null, false);
+          new Properties(), null);
 
       // create configuration objects
       Properties nonDefault = new Properties();

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java
index 336a6b1..205ada5 100644
--- a/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/LocatorManagementDUnitTest.java
@@ -14,17 +14,17 @@
  */
 package org.apache.geode.management;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Properties;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_HTTP_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_PORT;
+import static org.apache.geode.distributed.ConfigurationProperties.JMX_MANAGER_START;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.Locator;
@@ -41,6 +41,14 @@ import org.apache.geode.test.dunit.VM;
 import org.apache.geode.test.dunit.Wait;
 import org.apache.geode.test.dunit.WaitCriterion;
 import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Properties;
 
 /**
  * Test cases
@@ -70,8 +78,8 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
   @Test
   public void testPeerLocation() throws Exception {
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
-    startLocator(locator, true, locPort);
-    locatorMBeanExist(locator, locPort, true);
+    startLocator(locator, locPort);
+    locatorMBeanExist(locator, locPort);
 
     Host host = Host.getHost(0);
     String host0 = getServerHostName(host);
@@ -92,8 +100,8 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
   @Test
   public void testPeerLocationWithPortZero() throws Exception {
     // Start the locator with port=0
-    int locPort = startLocator(locator, true, 0);
-    locatorMBeanExist(locator, locPort, true);
+    int locPort = startLocator(locator, 0);
+    locatorMBeanExist(locator, locPort);
 
     Host host = Host.getHost(0);
     String host0 = getServerHostName(host);
@@ -118,16 +126,16 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
   public void testColocatedLocator() throws Exception {
     initManagement(false);
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
-    startLocator(locator, false, locPort);
-    locatorMBeanExist(locator, locPort, false);
+    startLocator(locator, locPort);
+    locatorMBeanExist(locator, locPort);
 
   }
 
   @Test
   public void testColocatedLocatorWithPortZero() throws Exception {
     initManagement(false);
-    int locPort = startLocator(locator, false, 0);
-    locatorMBeanExist(locator, locPort, false);
+    int locPort = startLocator(locator, 0);
+    locatorMBeanExist(locator, locPort);
 
   }
 
@@ -135,21 +143,21 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
   public void testListManagers() throws Exception {
     initManagement(false);
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
-    startLocator(locator, false, locPort);
-    listManagers(locator, locPort, false);
+    startLocator(locator, locPort);
+    listManagers(locator, locPort);
   }
 
   @Test
   public void testListManagersWithPortZero() throws Exception {
     initManagement(false);
-    int locPort = startLocator(locator, false, 0);
-    listManagers(locator, locPort, false);
+    int locPort = startLocator(locator, 0);
+    listManagers(locator, locPort);
   }
 
   @Test
   public void testWillingManagers() throws Exception {
     int locPort = AvailablePortHelper.getRandomAvailableTCPPort();
-    startLocator(locator, true, locPort);
+    startLocator(locator, locPort);
 
     Host host = Host.getHost(0);
     String host0 = getServerHostName(host);
@@ -162,12 +170,12 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
     createCache(managedNode2, props);
     createCache(managedNode3, props);
 
-    listWillingManagers(locator, locPort, false);
+    listWillingManagers(locator);
   }
 
   @Test
   public void testWillingManagersWithPortZero() throws Exception {
-    int locPort = startLocator(locator, true, 0);
+    int locPort = startLocator(locator, 0);
 
     Host host = Host.getHost(0);
     String host0 = getServerHostName(host);
@@ -180,7 +188,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
     createCache(managedNode2, props);
     createCache(managedNode3, props);
 
-    listWillingManagers(locator, locPort, false);
+    listWillingManagers(locator);
   }
 
   /**
@@ -188,7 +196,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
    * 
    * @param vm reference to VM
    */
-  protected Integer startLocator(final VM vm, final boolean isPeer, final int port) {
+  protected Integer startLocator(final VM vm, final int port) {
 
     return (Integer) vm.invoke(new SerializableCallable("Start Locator In VM") {
 
@@ -212,7 +220,7 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
         Locator locator = null;
         try {
           File logFile = new File(getTestMethodName() + "-locator" + port + ".log");
-          locator = Locator.startLocatorAndDS(port, logFile, bindAddr, props, isPeer, true, null);
+          locator = Locator.startLocatorAndDS(port, logFile, bindAddr, props);
         } catch (IOException ex) {
           Assert.fail("While starting locator on port " + port, ex);
         }
@@ -243,10 +251,10 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   /**
    * Creates a persistent region
-   * 
+   *
    * @param vm reference to VM
    */
-  protected void locatorMBeanExist(VM vm, final int locPort, final boolean isPeer) {
+  protected void locatorMBeanExist(VM vm, final int locPort) {
 
     vm.invoke(new SerializableCallable("Locator MBean created") {
 
@@ -260,7 +268,6 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
         assertEquals(locPort, bean.getPort());
         LogWriterUtils.getLogWriter().info("Log of Locator" + bean.viewLog());
         LogWriterUtils.getLogWriter().info("BindAddress" + bean.getBindAddress());
-        assertEquals(isPeer, bean.isPeerLocator());
         return null;
       }
     });
@@ -292,10 +299,10 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   /**
    * Creates a persistent region
-   * 
+   *
    * @param vm reference to VM
    */
-  protected void listManagers(VM vm, final int locPort, final boolean isPeer) {
+  protected void listManagers(VM vm, final int locPort) {
 
     vm.invoke(new SerializableCallable("List Managers") {
 
@@ -328,10 +335,10 @@ public class LocatorManagementDUnitTest extends ManagementTestBase {
 
   /**
    * Creates a persistent region
-   * 
+   *
    * @param vm reference to VM
    */
-  protected void listWillingManagers(VM vm, final int locPort, final boolean isPeer) {
+  protected void listWillingManagers(VM vm) {
 
     vm.invoke(new SerializableCallable("List Willing Managers") {
 

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/sanctionedSerializables.txt
old mode 100644
new mode 100755

http://git-wip-us.apache.org/repos/asf/geode/blob/5fa388cd/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
index 9038bb8..5b91a4c 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/LocatorHelper.java
@@ -79,9 +79,6 @@ public class LocatorHelper {
    */
   private static void addServerLocator(Integer distributedSystemId,
       LocatorMembershipListener locatorListener, DistributionLocatorId locator) {
-    if (!locator.isServerLocator()) {
-      return;
-    }
     ConcurrentHashMap<Integer, Set<String>> allServerLocatorsInfo =
         (ConcurrentHashMap<Integer, Set<String>>) locatorListener.getAllServerLocatorsInfo();
 


[07/25] geode git commit: GEODE-165: Removed OQL generated files and added the target into geode-core/build.gradle.

Posted by km...@apache.org.
GEODE-165: Removed OQL generated files and added the target into geode-core/build.gradle.

GEODE-165 : Updating spotless configuration to exclude 'generated-src' directory.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/16e2cfcd
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/16e2cfcd
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/16e2cfcd

Branch: refs/heads/feature/GEODE-2231
Commit: 16e2cfcdd9fc0fb9c7e5213cf68c68257cba7780
Parents: 24097a8
Author: adongre <ad...@apache.org>
Authored: Fri Dec 16 14:17:10 2016 +0530
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 build.gradle                                    |    4 +
 geode-core/build.gradle                         |    3 +
 .../geode/cache/query/internal/parse/oql.g      | 1195 ++++++
 .../query/internal/AbstractCompiledValue.java   |    2 +-
 .../geode/cache/query/internal/CompiledIn.java  |    2 +-
 .../cache/query/internal/CompiledLike.java      |    2 -
 .../query/internal/CompiledSortCriterion.java   |    6 -
 .../query/internal/CompositeGroupJunction.java  |    1 -
 .../geode/cache/query/internal/DerivedInfo.java |    5 -
 .../geode/cache/query/internal/IndexInfo.java   |    2 -
 .../geode/cache/query/internal/PathUtils.java   |    2 +-
 .../geode/cache/query/internal/QCompiler.java   |   11 +-
 .../geode/cache/query/internal/QueryUtils.java  |    2 +-
 .../cache/query/internal/RangeJunction.java     |    2 +-
 .../query/internal/index/AbstractIndex.java     |    4 +-
 .../index/FunctionalIndexCreationHelper.java    |    3 -
 .../cache/query/internal/index/HashIndex.java   |    3 +-
 .../query/internal/index/MapIndexStore.java     |    4 -
 .../cache/query/internal/index/RangeIndex.java  |    1 -
 .../cache/query/internal/parse/OQLLexer.java    | 3471 -----------------
 .../internal/parse/OQLLexerTokenTypes.java      |  156 -
 .../query/internal/parse/OQLLexerTokenTypes.txt |  147 -
 .../cache/query/internal/parse/OQLParser.java   | 3650 ------------------
 .../geode/cache/query/internal/parse/oql.g      | 1195 ------
 .../query/functional/FunctionJUnitTest.java     |    2 +-
 .../CompiledAggregateFunctionJUnitTest.java     |    2 +-
 .../CompiledJunctionInternalsJUnitTest.java     |    2 +-
 .../query/internal/QCompilerJUnitTest.java      |    2 +-
 .../SelectResultsComparatorJUnitTest.java       |    2 +-
 .../internal/index/RangeIndexAPIJUnitTest.java  |    2 +-
 .../query/internal/types/TypeUtilTest.java      |    2 +-
 gradle/rat.gradle                               |    6 -
 32 files changed, 1219 insertions(+), 8674 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 360310f..3dcdf1e 100755
--- a/build.gradle
+++ b/build.gradle
@@ -91,6 +91,10 @@ subprojects {
   spotless {
     lineEndings = 'unix';
     java {
+      target project.fileTree(project.projectDir) {
+        include '**/*.java'
+        exclude '**/generated-src/**'
+      }
       eclipseFormatFile "${rootProject.projectDir}/etc/eclipse-java-google-style.xml"
     }
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/build.gradle
----------------------------------------------------------------------
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 067bafc..28085be 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -15,6 +15,9 @@
  * limitations under the License.
  */
 
+
+apply plugin: 'antlr'
+
 sourceSets {
   jca {
     compileClasspath += configurations.compile

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/antlr/org/apache/geode/cache/query/internal/parse/oql.g
----------------------------------------------------------------------
diff --git a/geode-core/src/main/antlr/org/apache/geode/cache/query/internal/parse/oql.g b/geode-core/src/main/antlr/org/apache/geode/cache/query/internal/parse/oql.g
new file mode 100644
index 0000000..a743752
--- /dev/null
+++ b/geode-core/src/main/antlr/org/apache/geode/cache/query/internal/parse/oql.g
@@ -0,0 +1,1195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+**  oql.g
+**
+** Built with Antlr 2.7.4
+**   java antlr.Tool oql.g
+*/
+
+header {
+package org.apache.geode.cache.query.internal.parse;
+import java.util.*;
+import org.apache.geode.cache.query.internal.types.*;
+}
+
+options {
+    language="Java";
+}
+
+class OQLLexer extends Lexer ;
+options {
+    k=2;
+    charVocabulary = '\u0000'..'\uFFFE';
+    testLiterals=false;     // don't automatically test for literals
+    caseSensitive=false;
+    caseSensitiveLiterals = false;
+    defaultErrorHandler = false;
+}
+
+{
+    static {
+        // Set up type names for verbose AST printing
+        antlr.BaseAST.setVerboseStringConversion(true, OQLParser._tokenNames);
+    }
+
+    protected Token makeToken(int t) {
+        Token tok = super.makeToken(t);
+        if (tok.getType() == EOF) tok.setText("EOF");
+        if (tok.getText() == null) {
+          tok.setText("(no text)");
+        }
+        return tok;
+    }
+}    
+
+
+        /* punctuation */
+TOK_RPAREN  :       ')'             ;
+TOK_LPAREN  :       '('             ;
+TOK_COMMA   :       ','             ;
+TOK_SEMIC   :       ';'             ;
+TOK_DOTDOT  :       ".."            ;
+TOK_COLON   :       ':'             ;
+TOK_DOT     :       '.'             ;
+TOK_INDIRECT:       '-' '>'         { $setType(TOK_DOT); } ;
+TOK_CONCAT  :       '|' '|'         ;
+TOK_EQ      :       '='             ;
+TOK_PLUS    :       '+'             ;
+TOK_MINUS   :       '-'             ;
+TOK_SLASH   :       '/'             ;
+TOK_STAR    :       '*'             ;
+TOK_LE      :       '<' '='         ;
+TOK_GE      :       '>' '='         ;
+TOK_NE      :       '<' '>'         ;
+TOK_NE_ALT  :       '!' '='         { $setType(TOK_NE); }  ;
+TOK_LT      :       '<'             ;
+TOK_GT      :       '>'             ;
+TOK_LBRACK  :       '['             ;
+TOK_RBRACK  :       ']'             ;
+TOK_DOLLAR  :       '$'             ;
+
+/* Character Classes */
+protected
+LETTER : ('\u0061'..'\u007a' |
+       '\u00c0'..'\u00d6' |
+       '\u00a1'..'\u00bf' |
+       '\u00d8'..'\u00f6' |
+       '\u00f8'..'\u00ff' |
+       '\u0100'..'\u065f' |
+       '\u066a'..'\u06ef' |
+       '\u06fa'..'\u0965' |
+       '\u0970'..'\u09e5' |
+       '\u09f0'..'\u0a65' |
+       '\u0a70'..'\u0ae5' |
+       '\u0af0'..'\u0b65' |
+       '\u0b70'..'\u0be6' |
+       '\u0bf0'..'\u0c65' |
+       '\u0c70'..'\u0ce5' |
+       '\u0cf0'..'\u0d65' |
+       '\u0d70'..'\u0e4f' |
+       '\u0e5a'..'\u0ecf' |
+       '\u0eda'..'\u103f' |
+       '\u104a'..'\u1fff' |
+       '\u2000'..'\u206f' |       
+       '\u3040'..'\u318f' |
+       '\u3300'..'\u337f' |
+       '\u3400'..'\u3d2d' |
+       '\u4e00'..'\u9fff' |
+       '\uf900'..'\ufaff')
+    ;
+
+protected
+DIGIT : ('\u0030'..'\u0039' |
+       '\u0660'..'\u0669' |
+       '\u06f0'..'\u06f9' |
+       '\u0966'..'\u096f' |
+       '\u09e6'..'\u09ef' |
+       '\u0a66'..'\u0a6f' |
+       '\u0ae6'..'\u0aef' |
+       '\u0b66'..'\u0b6f' |
+       '\u0be7'..'\u0bef' |
+       '\u0c66'..'\u0c6f' |
+       '\u0ce6'..'\u0cef' |
+       '\u0d66'..'\u0d6f' |
+       '\u0e50'..'\u0e59' |
+       '\u0ed0'..'\u0ed9' |
+       '\u1040'..'\u1049')
+    ;
+
+protected
+ALL_UNICODE : ('\u0061'..'\ufffd')	
+    ;
+
+/*
+ * Names
+ */
+protected
+NameFirstCharacter:
+        ( LETTER | '_' )
+    ;
+
+protected
+NameCharacter:
+        ( LETTER | '_' | DIGIT | '$') // an internal $ is used for internal use identifiers
+    ;
+
+protected
+RegionNameCharacter:
+        ( ALL_UNICODE | '_' | DIGIT | '+' | '-' | ':' | '#' | '@' | '$') // an internal $ is used for internal use identifiers
+    ;
+
+QuotedIdentifier
+       options {testLiterals=false;}
+            :
+    
+            '"'! NameFirstCharacter ( NameCharacter )* '"'!
+    ;
+
+
+
+Identifier
+        options {testLiterals=true;}
+            :
+
+            NameFirstCharacter ( NameCharacter )*
+    ;
+
+
+
+RegionPath :  ( ( (TOK_SLASH ( RegionNameCharacter )+ )+ ) | 
+			  ( (TOK_SLASH StringLiteral )+ ) ) 
+    ;
+
+
+/* Numbers */
+// a numeric literal
+NUM_INT
+	{boolean isDecimal=false; Token t=null;}
+    :   (	'0' {isDecimal = true;} // special case for just '0'
+			(	'x'
+				(						// hex
+					// the 'e'|'E' and float suffix stuff look
+					// like hex digits, hence the (...)+ doesn't
+					// know when to stop: ambig.  ANTLR resolves
+					// it correctly by matching immediately.  It
+					// is therefor ok to hush warning.
+					options {
+						warnWhenFollowAmbig=false;
+					}
+				:	HEX_DIGIT
+				)+
+
+			|	//float or double with leading zero
+				(('0'..'9')+ ('.'|EXPONENT|FLOAT_SUFFIX)) => ('0'..'9')+
+
+			|	('0'..'7')+					// octal
+			)?
+		|	('1'..'9') ('0'..'9')*  {isDecimal=true;}		// non-zero decimal
+		)
+		(	'l' { _ttype = NUM_LONG; }
+
+		// only check to see if it's a float if looks like decimal so far
+		|	{isDecimal}?
+            (   '.' ('0'..'9')* (EXPONENT)? (f2:FLOAT_SUFFIX {t=f2;})?
+            |   EXPONENT (f3:FLOAT_SUFFIX {t=f3;})?
+            |   f4:FLOAT_SUFFIX {t=f4;}
+            )
+            {
+			if (t != null && t.getText().toUpperCase() .indexOf('F') >= 0) {
+                _ttype = NUM_FLOAT;
+			}
+            else {
+	           	_ttype = NUM_DOUBLE; // assume double
+			}
+			}
+        )?
+	;
+
+
+// a couple protected methods to assist in matching floating point numbers
+protected
+EXPONENT
+	:	'e' ('+'|'-')? ('0'..'9')+
+	;
+
+
+protected
+FLOAT_SUFFIX
+	:	'f'|'d'
+	;
+
+// hexadecimal digit
+protected
+HEX_DIGIT
+	:	('0'..'9'| 'a'..'f')
+	;
+
+
+protected
+QUOTE
+        :       '\''
+        ;
+
+StringLiteral :
+        QUOTE!
+        (
+            QUOTE QUOTE!
+        |   '\n'                { newline(); }
+        |   ~( '\'' | '\n' )
+        )*
+        QUOTE!
+
+    ;
+
+
+// Whitespace -- ignored
+WS	:	(	' '
+		|	'\t'
+		|	'\f'
+			// handle newlines
+		|	(	options {generateAmbigWarnings=false;}
+			:	"\r\n"  // Evil DOS
+			|	'\r'    // Macintosh
+			|	'\n'    // Unix (the right way)
+			)
+			{ newline(); }
+		)+
+		{ _ttype = Token.SKIP; }
+	;
+
+
+// Single-line comments
+SL_COMMENT
+	:	"--"
+		(~('\n'|'\r'))* ('\n'|'\r'('\n')?)?
+		{$setType(Token.SKIP); newline();}
+	;
+
+// multiple-line comments
+ML_COMMENT
+	:	"/*"
+		(	/*	'\r' '\n' can be matched in one alternative or by matching
+				'\r' in one iteration and '\n' in another.  I am trying to
+				handle any flavor of newline that comes in, but the language
+				that allows both "\r\n" and "\r" and "\n" to all be valid
+				newline is ambiguous.  Consequently, the resulting grammar
+				must be ambiguous.  I'm shutting this warning off.
+			 */
+			options {
+				generateAmbigWarnings=false;
+			}
+		:
+			{ LA(2)!='/' }? '*'
+		|	'\r' '\n'		{newline();}
+		|	'\r'			{newline();}
+		|	'\n'			{newline();}
+		|	~('*'|'\n'|'\r')
+		)*
+		"*/"
+		{$setType(Token.SKIP);}
+	;
+
+
+
+
+/***************************** OQL PARSER *************************************/
+
+class OQLParser
+extends Parser("org.apache.geode.cache.query.internal.parse.UtilParser");
+
+options {
+    buildAST = true;
+    k = 2;
+    codeGenMakeSwitchThreshold = 3;
+    codeGenBitsetTestThreshold = 4;
+    defaultErrorHandler = false;
+}
+
+tokens {
+    QUERY_PROGRAM;
+    QUALIFIED_NAME;
+    QUERY_PARAM;
+    ITERATOR_DEF;
+    PROJECTION_ATTRS;
+    PROJECTION;
+    TYPECAST;
+    COMBO;
+    METHOD_INV;
+    POSTFIX; 
+    OBJ_CONSTRUCTOR;
+    IMPORTS;
+    SORT_CRITERION;
+    LIMIT;
+    HINT;
+    AGG_FUNC;
+    SUM;
+    AVG;
+    COUNT;
+    MAX;
+    MIN;
+}
+
+queryProgram :
+		( traceCommand )?
+       	( 
+       
+       		( declaration ( TOK_SEMIC! declaration )* ( TOK_SEMIC! query ) ) (TOK_SEMIC!)?
+        	|   
+        	query (TOK_SEMIC!)?
+       	)
+       	EOF!
+        { #queryProgram =
+          #([QUERY_PROGRAM, "queryProgram",
+            "org.apache.geode.cache.query.internal.parse.GemFireAST"],
+            #queryProgram); }
+    ;
+
+traceCommand:
+		( 	
+			TOK_LT!
+			"trace"^<AST=org.apache.geode.cache.query.internal.parse.ASTTrace>
+			TOK_GT!
+		)
+	;
+     
+
+loneFromClause :
+    iteratorDef
+        (
+            TOK_COMMA!
+            iteratorDef
+        )* EOF!
+    { #loneFromClause =
+          #([LITERAL_from, "from",
+            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
+            #loneFromClause); }
+    ;
+
+loneProjectionAttributes :
+    projectionAttributes EOF!
+    ;
+
+declaration :
+
+            defineQuery
+        |   importQuery
+        |   undefineQuery
+        |   paramTypeDecl
+
+    ;
+
+importQuery :
+
+        "import"^<AST=org.apache.geode.cache.query.internal.parse.ASTImport>
+        qualifiedName
+        (
+            "as" identifier
+        )?
+
+    ;
+
+loneImports :
+        importQuery ( TOK_SEMIC! importQuery )*
+        (TOK_SEMIC!)?
+        EOF!
+        // combine into a single node
+        { #loneImports = #([IMPORTS, "imports",
+            "org.apache.geode.cache.query.internal.parse.GemFireAST"],
+                #loneImports); }
+    ;
+
+paramTypeDecl :
+    
+        "declare"^ (queryParam) (TOK_COMMA! queryParam)* type
+    ;
+        
+
+qualifiedName :
+
+        identifier
+        (
+            TOK_DOT!
+            identifier
+        )*
+    ;
+
+
+defineQuery :
+
+        "define"^
+            ( "query"! )?
+        identifier
+
+        (
+            TOK_LPAREN!
+            type
+            identifier
+            (
+                TOK_COMMA!
+                type
+                identifier
+            )*
+            TOK_RPAREN!
+        )?
+
+        "as"!
+        query
+    ;
+
+undefineQuery :
+
+        "undefine"^
+        ( "query"! )?
+        identifier
+    ;
+
+query :
+
+        (
+            selectExpr
+        |   expr
+        )
+    ;
+
+selectExpr :
+		( hintCommand )?
+        "select"^<AST=org.apache.geode.cache.query.internal.parse.ASTSelect>
+
+        (
+            // ambig. betweed this distinct and a distinct conversion expr
+            // the first distinct keyword here must be for the select,
+            // so take adv. of greedy and turn off warning
+            options {
+                warnWhenFollowAmbig = false;
+            } :
+
+            "distinct" <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
+            | "all" <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
+        )?
+
+        
+		(			
+          projectionAttributes
+		)
+        fromClause
+        ( whereClause )?
+        ( groupClause )?
+        ( orderClause )?
+        ( limitClause )?
+    ;
+
+fromClause :
+
+        "from"^<AST=org.apache.geode.cache.query.internal.parse.ASTCombination>
+        iteratorDef
+        (
+            TOK_COMMA!
+            iteratorDef
+        )*
+    ;
+
+iteratorDef! :
+
+            (identifier "in" ) =>
+
+            id1:identifier
+            "in"!
+            ex1:expr ( "type"! t1:type )?
+            { #iteratorDef = #([ITERATOR_DEF, "iterDef", "org.apache.geode.cache.query.internal.parse.ASTIteratorDef"], #ex1, #id1, #t1); }
+
+        |   ex2:expr
+            (
+                ( "as"! )?
+                id2:identifier
+            )?
+            ( "type"! t2:type )?
+
+            { #iteratorDef = #([ITERATOR_DEF, "iterDef", "org.apache.geode.cache.query.internal.parse.ASTIteratorDef"], #ex2, #id2, #t2); }
+    ;
+
+whereClause :
+
+        "where"! expr
+    ;
+    
+limitClause! :
+
+        "limit" (TOK_DOLLAR NUM_INT
+        { #limitClause = #([LIMIT, "limitParam",
+               "org.apache.geode.cache.query.internal.parse.ASTParameter"],
+                   #NUM_INT); }
+         | n:NUM_INT{ #limitClause =#[LIMIT,n.getText(),"org.apache.geode.cache.query.internal.parse.ASTLimit"] ; })
+    ;
+
+projectionAttributes :
+
+        (
+            projection
+            (
+                TOK_COMMA!
+                projection
+            )*
+            { #projectionAttributes = #([PROJECTION_ATTRS, "projectionAttrs",
+                "org.apache.geode.cache.query.internal.parse.ASTCombination"],
+                #projectionAttributes); }
+
+        |   TOK_STAR <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
+        )
+    ;
+
+projection!{ AST node  = null;}:
+        
+            lb1:identifier TOK_COLON!  ( tok1:aggregateExpr{node = #tok1;} | tok2:expr{node = #tok2;})
+            { #projection = #([PROJECTION, "projection",
+            "org.apache.geode.cache.query.internal.parse.ASTProjection"],  node, #lb1); } 
+        |
+            (tok3:aggregateExpr{node = #tok3;} | tok4:expr{node = #tok4;})
+            (
+                "as"
+                lb2: identifier
+            )?
+            { #projection = #([PROJECTION, "projection",
+            "org.apache.geode.cache.query.internal.parse.ASTProjection"], node, #lb2); }
+    ;
+
+
+            
+
+groupClause :
+
+        "group"^<AST=org.apache.geode.cache.query.internal.parse.ASTGroupBy>
+        "by"!  groupByList
+
+        (
+            "having"!
+            expr
+        )?
+    ;
+    
+hintCommand :
+		 	
+			TOK_LT!
+			"hint"^<AST=org.apache.geode.cache.query.internal.parse.ASTHint>
+			hintIdentifier
+			(
+			  TOK_COMMA! hintIdentifier
+			)*
+			TOK_GT!
+		
+	;
+
+      
+hintIdentifier :
+ 	n:StringLiteral{ #hintIdentifier =#[HINT,n.getText(),"org.apache.geode.cache.query.internal.parse.ASTHintIdentifier"] ; }       
+;
+
+orderClause :
+
+        "order"^<AST=org.apache.geode.cache.query.internal.parse.ASTOrderBy>
+        "by"!
+        sortCriterion
+        (
+            TOK_COMMA! sortCriterion
+        )*
+    ;
+
+sortCriterion :
+
+        tok:expr { #sortCriterion = #([SORT_CRITERION, "asc", "org.apache.geode.cache.query.internal.parse.ASTSortCriterion"],
+            tok); }        
+        (
+            "asc"! {#sortCriterion.setText("asc");}
+        |   "desc"! {#sortCriterion.setText("desc");}
+
+        )?
+    ;
+
+expr :
+
+        castExpr
+
+     ;
+
+
+castExpr
+	:	
+
+        // Have to backtrack to see if operator follows.  If no operator
+        // follows, it's a typecast.  No semantic checking needed to parse.
+        // if it _looks_ like a cast, it _is_ a cast; else it's a "(expr)"
+    	(TOK_LPAREN type TOK_RPAREN castExpr)=>
+        lp:TOK_LPAREN^<AST=org.apache.geode.cache.query.internal.parse.ASTTypeCast>
+                {#lp.setType(TYPECAST); #lp.setText("typecast");}
+            type TOK_RPAREN!
+        castExpr
+
+    |	orExpr
+	;
+
+orExpr
+      { boolean cmplx = false; } :
+       
+            orelseExpr ( "or"! orelseExpr  { cmplx = true; } )*
+       { if (cmplx) {
+            #orExpr = #([LITERAL_or, "or",
+                    "org.apache.geode.cache.query.internal.parse.ASTOr"],
+                #orExpr); } }
+      ;
+
+orelseExpr 
+       { boolean cmplx = false; } :
+            andExpr ( "orelse"! andExpr { cmplx = true; } )*
+       { if (cmplx) { #orelseExpr = #([LITERAL_orelse, "or"], #orelseExpr); } }
+      ;
+
+
+andExpr 
+        { boolean cmplx = false; } :
+           quantifierExpr ( "and"! quantifierExpr { cmplx = true; } )*
+        { if (cmplx) {
+            #andExpr = #([LITERAL_and, "and",
+                    "org.apache.geode.cache.query.internal.parse.ASTAnd"],
+                    #andExpr); } }
+    ;
+
+quantifierExpr :
+
+            "for"^
+            "all"!
+            inClause TOK_COLON! andthenExpr
+
+        |   
+            ("exists" identifier "in" ) => 
+            "exists"^
+            inClause
+            TOK_COLON! andthenExpr
+
+        |   andthenExpr
+
+    ;
+
+
+inClause :
+            identifier "in"! expr
+         ;
+
+
+
+andthenExpr 
+         { boolean cmplx = false; } :
+            equalityExpr ( "andthen"! equalityExpr { cmplx = true; } )*
+            { if (cmplx) { #andthenExpr = #([LITERAL_andthen, "andthen"], #andthenExpr); } }
+         ;
+
+
+equalityExpr :
+
+            relationalExpr
+
+            (   
+                (   (
+                        TOK_EQ^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
+                    |   TOK_NE^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
+                    )
+                    (   "all"^
+                    |   "any"^
+                    |   "some"^
+                    )?
+                relationalExpr )+
+    
+            |   (  "like"^<AST=org.apache.geode.cache.query.internal.parse.ASTLike>
+                relationalExpr )*
+            )
+    ;
+
+relationalExpr :
+
+        additiveExpr
+        (
+            (
+                TOK_LT^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
+            |   TOK_GT^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
+            |   TOK_LE^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
+            |   TOK_GE^<AST=org.apache.geode.cache.query.internal.parse.ASTCompareOp>
+            )
+
+            (
+                // Simple comparison of expressions
+                additiveExpr
+
+                // Comparison of queries
+            |   (
+                    "all"^
+                |   "any"^
+                |   "some"^
+                )
+                additiveExpr
+            )
+        )*
+    ;
+
+additiveExpr :
+
+        multiplicativeExpr
+        (
+            (
+                TOK_PLUS^
+            |   TOK_MINUS^
+            |   TOK_CONCAT^
+            |   "union"^
+            |   "except"^
+            )
+            multiplicativeExpr
+        )*
+    ;
+
+multiplicativeExpr :
+
+        inExpr
+        (
+            (
+                TOK_STAR^
+            |   TOK_SLASH^
+            |   "mod"^
+            |   "intersect"^
+            )
+            inExpr
+        )*
+    ;
+
+inExpr :
+
+        unaryExpr
+        (
+            "in"^<AST=org.apache.geode.cache.query.internal.parse.ASTIn> unaryExpr
+        )?
+    ;
+
+unaryExpr :
+
+        (
+            (
+                TOK_PLUS!
+            |   TOK_MINUS^<AST=org.apache.geode.cache.query.internal.parse.ASTUnary>
+            |   "abs"^
+            |   "not"^<AST=org.apache.geode.cache.query.internal.parse.ASTUnary>
+            )
+        )*
+        postfixExpr
+
+    ;
+
+postfixExpr
+         { boolean cmplx = false; } :
+            primaryExpr
+
+            (   
+                TOK_LBRACK!
+                    index TOK_RBRACK!
+                { cmplx = true; }
+    
+            |   ( TOK_DOT! | TOK_INDIRECT! ) 
+                  (  methodInvocation[false]
+                   | identifier )
+                { cmplx = true; }
+            )*
+            { if (cmplx) {
+                #postfixExpr = #([POSTFIX, "postfix",
+                   "org.apache.geode.cache.query.internal.parse.ASTPostfix"],
+                    #postfixExpr);
+              }
+            }
+
+    ;
+
+methodInvocation! [boolean implicitReceiver] :
+    
+            methodName:identifier args:argList  
+            { #methodInvocation =
+                #([METHOD_INV, "methodInv",
+                    "org.apache.geode.cache.query.internal.parse.ASTMethodInvocation"],
+                  #methodName, #args); 
+              ((ASTMethodInvocation)#methodInvocation).setImplicitReceiver(implicitReceiver); }
+        ;
+
+index :
+
+        // single element
+        (
+          expr
+          (
+            // multiple elements: OQL defines a comma-delimited list of
+            // indexes in its grammar, but seemingly fails to define the
+            // semantics.
+            // This grammar is left in just in case someone figures out what
+            // this means, but for now this will throw an UnsupportedOperationException
+            // at query compilation time
+            // (throw new UnsupportedOperationException("Only one index expression supported"))
+            (
+                TOK_COMMA!
+                expr 
+            )*
+
+            // Range of elements
+            |   TOK_COLON^ expr
+          ) 
+          | TOK_STAR
+        )
+        { #index = #([TOK_LBRACK, "index",
+            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
+                #index);
+        }
+    ;
+
+argList :
+
+        t:TOK_LPAREN^<AST=org.apache.geode.cache.query.internal.parse.ASTCombination>
+        (
+            expr
+            (
+                TOK_COMMA!
+                expr
+            )*
+        )?
+        TOK_RPAREN!
+    ;
+
+primaryExpr :
+
+        (
+            conversionExpr
+        |   collectionExpr
+        |   aggregateExpr
+        |   undefinedExpr
+        |   ( identifier TOK_LPAREN identifier TOK_COLON ) =>
+                objectConstruction
+        |   structConstruction
+        |   collectionConstruction
+        |   methodInvocation[true]
+        |   identifier
+        |   queryParam
+        |   literal
+        |   TOK_LPAREN! query TOK_RPAREN!
+        |   RegionPath<AST=org.apache.geode.cache.query.internal.parse.ASTRegionPath>
+        )
+    ;
+
+
+conversionExpr :
+	(
+
+	    (
+                  "listtoset"^
+              |   "element"^<AST=org.apache.geode.cache.query.internal.parse.ASTConversionExpr>
+            
+              |   "distinct"^
+              |   "flatten"^
+            )
+            TOK_LPAREN! query TOK_RPAREN!
+        |
+           (  
+              (
+               "nvl"^<AST=org.apache.geode.cache.query.internal.parse.ASTConversionExpr>
+              )
+              TOK_LPAREN!
+              expr TOK_COMMA! expr
+              TOK_RPAREN! 
+           ) 
+        |
+           (  
+              (
+               "to_date"^<AST=org.apache.geode.cache.query.internal.parse.ASTConversionExpr>
+              )
+              TOK_LPAREN!
+              stringLiteral TOK_COMMA! stringLiteral
+              TOK_RPAREN! 
+           )    
+	)
+    ;
+
+collectionExpr :
+
+        (
+            "first"^
+        |   "last"^
+        |   "unique"^
+        |   "exists"^
+        )
+        TOK_LPAREN! query TOK_RPAREN!
+
+    ;
+
+
+
+            
+aggregateExpr  { int aggFunc = -1; boolean distinctOnly = false; }:
+
+             !("sum" {aggFunc = SUM;} | "avg" {aggFunc = AVG;} )
+              TOK_LPAREN ("distinct"! {distinctOnly = true;} ) ? tokExpr1:expr TOK_RPAREN 
+              { #aggregateExpr = #([AGG_FUNC, "aggregate", "org.apache.geode.cache.query.internal.parse.ASTAggregateFunc"],
+              #tokExpr1); 
+                ((ASTAggregateFunc)#aggregateExpr).setAggregateFunctionType(aggFunc);
+                ((ASTAggregateFunc)#aggregateExpr).setDistinctOnly(distinctOnly);
+               }
+             
+             |
+             !("min" {aggFunc = MIN;} | "max" {aggFunc = MAX;} )
+              TOK_LPAREN  tokExpr2:expr TOK_RPAREN 
+              { #aggregateExpr = #([AGG_FUNC, "aggregate", "org.apache.geode.cache.query.internal.parse.ASTAggregateFunc"],
+              #tokExpr2); 
+                ((ASTAggregateFunc)#aggregateExpr).setAggregateFunctionType(aggFunc);               
+               }
+             
+             |
+              "count"^<AST=org.apache.geode.cache.query.internal.parse.ASTAggregateFunc>
+              TOK_LPAREN!  ( TOK_STAR <AST=org.apache.geode.cache.query.internal.parse.ASTDummy>
+              | ("distinct"! {distinctOnly = true;} ) ? expr ) TOK_RPAREN! 
+              {  
+                 ((ASTAggregateFunc)#aggregateExpr).setAggregateFunctionType(COUNT);
+                 #aggregateExpr.setText("aggregate");
+                 ((ASTAggregateFunc)#aggregateExpr).setDistinctOnly(distinctOnly);
+              }
+    ;
+
+undefinedExpr :
+
+        (
+            "is_undefined"^<AST=org.apache.geode.cache.query.internal.parse.ASTUndefinedExpr>
+        |   "is_defined"^<AST=org.apache.geode.cache.query.internal.parse.ASTUndefinedExpr>
+        )
+        TOK_LPAREN!
+        query
+        TOK_RPAREN!
+    ;
+
+objectConstruction :
+
+        identifier
+        t:TOK_LPAREN^
+            {#t.setType(OBJ_CONSTRUCTOR);}
+        fieldList
+        TOK_RPAREN!
+    ;
+
+structConstruction :
+
+        "struct"^
+        TOK_LPAREN!
+        fieldList
+        TOK_RPAREN!
+    ;
+
+
+groupByList :
+
+        expr
+        (
+            TOK_COMMA!
+            expr
+        )*
+        /*{ #groupByList = #([COMBO, "groupByList",
+            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
+                #groupByList); }*/
+  ;
+
+    
+fieldList :
+
+        identifier TOK_COLON! expr
+        (
+            TOK_COMMA!
+            identifier
+            TOK_COLON! expr
+        )*
+        { #fieldList = #([COMBO, "fieldList",
+            "org.apache.geode.cache.query.internal.parse.ASTCombination"],
+                #fieldList); }
+    ;
+
+collectionConstruction :
+        (
+            (
+                "array"^
+            |   "set"^<AST=org.apache.geode.cache.query.internal.parse.ASTConstruction>
+            |   "bag"^
+            )
+            argList
+
+        |   "list"^
+            TOK_LPAREN
+            (
+                expr
+                (
+                    TOK_DOTDOT expr
+                |   (
+                        TOK_COMMA expr
+                    )*
+                )
+            )?
+            TOK_RPAREN
+        )
+    ;
+
+queryParam! :
+
+        TOK_DOLLAR NUM_INT
+        { #queryParam = #([QUERY_PARAM, "queryParam",
+               "org.apache.geode.cache.query.internal.parse.ASTParameter"],
+                   #NUM_INT); }
+        
+    ;
+
+type :
+    
+      (
+//            ( "unsigned" )? // ignored
+//            (
+                typ00:"short"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ00.setJavaType(TypeUtils.getObjectType(Short.class)); }
+            |   typ01:"long"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ01.setJavaType(TypeUtils.getObjectType(Long.class)); }
+//            )
+        |   typ02:"int"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ02.setJavaType(TypeUtils.getObjectType(Integer.class)); }
+        |   typ03:"float"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ03.setJavaType(TypeUtils.getObjectType(Float.class)); }
+        |   typ04:"double"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ04.setJavaType(TypeUtils.getObjectType(Double.class)); }
+        |   typ05:"char"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ05.setJavaType(TypeUtils.getObjectType(Character.class)); }
+        |   typ06:"string"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ06.setJavaType(TypeUtils.getObjectType(String.class)); }
+        |   typ07:"boolean"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ07.setJavaType(TypeUtils.getObjectType(Boolean.class)); }
+        |   typ08:"byte"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ08.setJavaType(TypeUtils.getObjectType(Byte.class)); } 
+        |   typ09:"octet"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ09.setJavaType(TypeUtils.getObjectType(Byte.class)); }
+        |   "enum"^ // unsupported
+            (
+                identifier
+                TOK_DOT
+            )?
+            identifier
+        |   typ10:"date"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ10.setJavaType(TypeUtils.getObjectType(java.sql.Date.class)); }
+        |   typ11:"time"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ11.setJavaType(TypeUtils.getObjectType(java.sql.Time.class)); }
+        |   "interval" // unsupported
+        |   typ12:"timestamp"<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ12.setJavaType(TypeUtils.getObjectType(java.sql.Timestamp.class)); }
+        |   typ13:"set"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                TOK_LT! type TOK_GT!
+                    { #typ13.setJavaType(new CollectionTypeImpl(Set.class, TypeUtils.OBJECT_TYPE /*resolved later*/)); } 
+        |   typ14:"collection"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                TOK_LT! type TOK_GT!
+                    { #typ14.setJavaType(new CollectionTypeImpl(Collection.class, TypeUtils.OBJECT_TYPE /*resolved later*/)); } 
+        |   "bag"^ TOK_LT! type TOK_GT! // not supported
+        |   typ15:"list"^<AST=org.apache.geode.cache.query.internal.parse.ASTType> TOK_LT! type TOK_GT!
+                    { #typ15.setJavaType(new CollectionTypeImpl(List.class, TypeUtils.OBJECT_TYPE /*resolved later*/)); }
+        |   typ16:"array"^<AST=org.apache.geode.cache.query.internal.parse.ASTType> TOK_LT! type TOK_GT!
+                    { #typ16.setJavaType(new CollectionTypeImpl(Object[].class, TypeUtils.OBJECT_TYPE /*resolved later*/)); }
+        |   (typ17:"dictionary"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ17.setJavaType(new MapTypeImpl(Map.class, TypeUtils.OBJECT_TYPE , TypeUtils.OBJECT_TYPE /*resolved later*/)); }
+                | typ18:"map"^<AST=org.apache.geode.cache.query.internal.parse.ASTType>
+                    { #typ18.setJavaType(new MapTypeImpl(Map.class, TypeUtils.OBJECT_TYPE , TypeUtils.OBJECT_TYPE /*resolved later*/)); }
+            )
+            TOK_LT! type TOK_COMMA! type TOK_GT!
+        |!   id:identifier { String txt = #id.getText();
+                #type = #[Identifier, txt, "org.apache.geode.cache.query.internal.parse.ASTType"];
+                 ((ASTType)#type).setTypeName(txt); }
+      )
+      
+
+    ;
+
+literal :
+
+            objectLiteral
+        |   booleanLiteral
+        |   numericLiteral
+        |   charLiteral
+        |   stringLiteral
+        |   dateLiteral
+        |   timeLiteral
+        |   timestampLiteral
+    ;
+
+objectLiteral :
+
+        "nil"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+      | "null"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+      | "undefined"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+    ;
+
+booleanLiteral :
+
+        (
+            "true"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+        |   "false"<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+        )
+    ;
+
+numericLiteral :
+
+        (   NUM_INT<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+          | NUM_LONG<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+          | NUM_FLOAT<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+          | NUM_DOUBLE<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+        )
+        
+    ;
+
+
+charLiteral :
+
+        "char"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+            StringLiteral
+    ;
+
+
+stringLiteral :
+
+        StringLiteral<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+    ;
+
+dateLiteral :
+
+        "date"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+            StringLiteral
+    ;
+
+timeLiteral :
+
+        "time"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+            StringLiteral
+    ;
+
+timestampLiteral :
+
+        "timestamp"^<AST=org.apache.geode.cache.query.internal.parse.ASTLiteral>
+           StringLiteral
+    ;
+
+identifier :
+        Identifier<AST=org.apache.geode.cache.query.internal.parse.ASTIdentifier>
+    |   q:QuotedIdentifier<AST=org.apache.geode.cache.query.internal.parse.ASTIdentifier> 
+            { #q.setType(Identifier); }
+    ;
+

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractCompiledValue.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractCompiledValue.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractCompiledValue.java
index 7924e11..d635e02 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractCompiledValue.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/AbstractCompiledValue.java
@@ -16,8 +16,8 @@ package org.apache.geode.cache.query.internal;
 
 import java.util.*;
 import org.apache.geode.cache.query.*;
-import org.apache.geode.cache.query.types.*;
 import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
+import org.apache.geode.cache.query.types.*;
 import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledIn.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledIn.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledIn.java
index 7f8849e..0aa1efb 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledIn.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledIn.java
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.Region;
@@ -41,7 +42,6 @@ import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.index.IndexData;
 import org.apache.geode.cache.query.internal.index.IndexProtocol;
 import org.apache.geode.cache.query.internal.index.IndexUtils;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.cache.query.internal.types.TypeUtils;
 import org.apache.geode.cache.query.types.ObjectType;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledLike.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledLike.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledLike.java
index 48e79cc..fc4a843 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledLike.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledLike.java
@@ -19,7 +19,6 @@ import java.util.regex.Pattern;
 import org.apache.geode.cache.query.AmbiguousNameException;
 import org.apache.geode.cache.query.FunctionDomainException;
 import org.apache.geode.cache.query.NameResolutionException;
-import org.apache.geode.cache.query.QueryInvalidException;
 import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.SelectResults;
@@ -29,7 +28,6 @@ import org.apache.geode.cache.query.internal.index.IndexProtocol;
 import org.apache.geode.cache.query.internal.index.PrimaryKeyIndex;
 import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.pdx.internal.PdxString;
 
 /**

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledSortCriterion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledSortCriterion.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledSortCriterion.java
index bb3ea3b..5268b1c 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledSortCriterion.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledSortCriterion.java
@@ -17,20 +17,14 @@ package org.apache.geode.cache.query.internal;
 
 import java.util.*;
 
-import org.apache.geode.GemFireCacheException;
-import org.apache.geode.GemFireException;
 import org.apache.geode.cache.CacheException;
 import org.apache.geode.cache.query.AmbiguousNameException;
 import org.apache.geode.cache.query.FunctionDomainException;
-import org.apache.geode.cache.query.IndexInvalidException;
 import org.apache.geode.cache.query.NameResolutionException;
-import org.apache.geode.cache.query.QueryException;
-import org.apache.geode.cache.query.QueryInvalidException;
 import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.cache.query.internal.types.TypeUtils;
-import org.apache.geode.internal.i18n.LocalizedStrings;
 
 /**
  * This class represents a compiled form of sort criterian present in order by clause

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompositeGroupJunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompositeGroupJunction.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompositeGroupJunction.java
index 9b2ca4f..8f57ad6 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompositeGroupJunction.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/CompositeGroupJunction.java
@@ -32,7 +32,6 @@ import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.cache.query.internal.types.StructTypeImpl;
-import org.apache.geode.cache.query.internal.SelectResultsComparator;
 import org.apache.geode.cache.query.types.ObjectType;
 import org.apache.geode.cache.query.types.StructType;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/DerivedInfo.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/DerivedInfo.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/DerivedInfo.java
index 0cfa80d..26c579a 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/DerivedInfo.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/DerivedInfo.java
@@ -17,25 +17,20 @@ package org.apache.geode.cache.query.internal;
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.geode.cache.query.FunctionDomainException;
 import org.apache.geode.cache.query.Index;
 import org.apache.geode.cache.query.NameResolutionException;
 import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.SelectResults;
-import org.apache.geode.cache.query.Struct;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.index.AbstractIndex;
 import org.apache.geode.cache.query.internal.index.IndexProtocol;
 import org.apache.geode.cache.query.internal.index.PartitionedIndex;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
-import org.apache.geode.cache.query.types.CollectionType;
 import org.apache.geode.cache.query.types.ObjectType;
 
 public class DerivedInfo {

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/IndexInfo.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/IndexInfo.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/IndexInfo.java
index e6f0f1c..c2a54bd 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/IndexInfo.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/IndexInfo.java
@@ -15,13 +15,11 @@
 package org.apache.geode.cache.query.internal;
 
 import org.apache.geode.cache.query.FunctionDomainException;
-import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.cache.query.NameResolutionException;
 import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.index.AbstractIndex;
 import org.apache.geode.cache.query.internal.index.IndexProtocol;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 
 public class IndexInfo {
   final private CompiledValue _key;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/PathUtils.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/PathUtils.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/PathUtils.java
index 8c31b0f..bf931a2 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/PathUtils.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/PathUtils.java
@@ -24,8 +24,8 @@ import org.apache.geode.cache.query.NameNotFoundException;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.Struct;
 import org.apache.geode.cache.query.TypeMismatchException;
-import org.apache.geode.cache.query.types.*;
 import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
+import org.apache.geode.cache.query.types.*;
 import org.apache.geode.cache.query.internal.types.*;
 
 

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/QCompiler.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QCompiler.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QCompiler.java
index eec2f97..1ee4d17 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QCompiler.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QCompiler.java
@@ -23,21 +23,17 @@ import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexer;
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
+import org.apache.geode.cache.query.internal.parse.OQLParser;
 import org.apache.logging.log4j.Logger;
 
-import antlr.collections.AST;
-import antlr.debug.misc.ASTFrame;
-
 import org.apache.geode.cache.query.FunctionDomainException;
 import org.apache.geode.cache.query.NameResolutionException;
-import org.apache.geode.cache.query.QueryException;
 import org.apache.geode.cache.query.QueryInvalidException;
 import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.parse.GemFireAST;
-import org.apache.geode.cache.query.internal.parse.OQLLexer;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
-import org.apache.geode.cache.query.internal.parse.OQLParser;
 import org.apache.geode.cache.query.internal.types.CollectionTypeImpl;
 import org.apache.geode.cache.query.internal.types.MapTypeImpl;
 import org.apache.geode.cache.query.internal.types.ObjectTypeImpl;
@@ -45,7 +41,6 @@ import org.apache.geode.cache.query.internal.types.TypeUtils;
 import org.apache.geode.cache.query.types.CollectionType;
 import org.apache.geode.cache.query.types.MapType;
 import org.apache.geode.cache.query.types.ObjectType;
-import org.apache.geode.i18n.LogWriterI18n;
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.i18n.LocalizedStrings;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
index 33e4181..8eaa74a 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QueryUtils.java
@@ -24,6 +24,7 @@ import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.query.AmbiguousNameException;
@@ -41,7 +42,6 @@ import org.apache.geode.cache.query.internal.index.IndexManager;
 import org.apache.geode.cache.query.internal.index.IndexProtocol;
 import org.apache.geode.cache.query.internal.index.IndexUtils;
 import org.apache.geode.cache.query.internal.index.PartitionedIndex;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.cache.query.types.CollectionType;
 import org.apache.geode.cache.query.types.ObjectType;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/RangeJunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/RangeJunction.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/RangeJunction.java
index b2b35ab..42fb30d 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/RangeJunction.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/RangeJunction.java
@@ -33,8 +33,8 @@ import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.Struct;
 import org.apache.geode.cache.query.TypeMismatchException;
-import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
+import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.cache.query.internal.types.TypeUtils;
 import org.apache.geode.cache.query.types.ObjectType;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java
index 3e85ca2..96a3c83 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java
@@ -26,6 +26,7 @@ import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.Cache;
@@ -59,7 +60,6 @@ import org.apache.geode.cache.query.internal.StructFields;
 import org.apache.geode.cache.query.internal.StructImpl;
 import org.apache.geode.cache.query.internal.Support;
 import org.apache.geode.cache.query.internal.index.IndexStore.IndexStoreEntry;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.cache.query.internal.types.TypeUtils;
 import org.apache.geode.cache.query.types.ObjectType;
@@ -73,8 +73,6 @@ import org.apache.geode.internal.cache.RegionEntry;
 import org.apache.geode.internal.cache.persistence.query.CloseableIterator;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.offheap.StoredObject;
-import org.apache.geode.internal.offheap.annotations.Released;
 import org.apache.geode.internal.offheap.annotations.Retained;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.pdx.internal.PdxString;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/FunctionalIndexCreationHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/FunctionalIndexCreationHelper.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/FunctionalIndexCreationHelper.java
index f4f5c20..eb16207 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/FunctionalIndexCreationHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/FunctionalIndexCreationHelper.java
@@ -20,15 +20,12 @@
 package org.apache.geode.cache.query.internal.index;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.query.AmbiguousNameException;
 import org.apache.geode.cache.query.IndexInvalidException;
-import org.apache.geode.cache.query.IndexType;
 import org.apache.geode.cache.query.NameResolutionException;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.CompiledBindArgument;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
index b7aff62..023fbb4 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java
@@ -29,11 +29,11 @@ import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
+import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.logging.log4j.Logger;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.EntryDestroyedException;
-import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.query.AmbiguousNameException;
@@ -63,7 +63,6 @@ import org.apache.geode.cache.query.internal.RuntimeIterator;
 import org.apache.geode.cache.query.internal.Support;
 import org.apache.geode.cache.query.internal.index.HashIndex.IMQEvaluator.HashIndexComparator;
 import org.apache.geode.cache.query.internal.index.IndexStore.IndexStoreEntry;
-import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
 import org.apache.geode.cache.query.internal.types.StructTypeImpl;
 import org.apache.geode.cache.query.internal.types.TypeUtils;
 import org.apache.geode.cache.query.types.ObjectType;

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MapIndexStore.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MapIndexStore.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MapIndexStore.java
index 262f082..74584fb 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MapIndexStore.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/MapIndexStore.java
@@ -17,7 +17,6 @@ package org.apache.geode.cache.query.internal.index;
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.geode.cache.EntryDestroyedException;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.parse.OQLLexerTokenTypes;
@@ -25,9 +24,6 @@ import org.apache.geode.cache.query.internal.types.TypeUtils;
 import org.apache.geode.internal.cache.CachedDeserializable;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.RegionEntry;
-import org.apache.geode.internal.cache.RegionEntryContext;
-import org.apache.geode.internal.cache.Token;
-import org.apache.geode.internal.cache.LocalRegion.NonTXEntry;
 import org.apache.geode.internal.cache.persistence.query.CloseableIterator;
 import org.apache.geode.internal.cache.persistence.query.IndexMap;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/RangeIndex.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/RangeIndex.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/RangeIndex.java
index 0f0f538..5ac48bc 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/RangeIndex.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/RangeIndex.java
@@ -46,7 +46,6 @@ import org.apache.geode.cache.query.TypeMismatchException;
 import org.apache.geode.cache.query.internal.CompiledSortCriterion;
 import org.apache.geode.cache.query.internal.CompiledValue;
 import org.apache.geode.cache.query.internal.ExecutionContext;
-import org.apache.geode.cache.query.internal.QueryMonitor;
 import org.apache.geode.cache.query.internal.QueryObserver;
 import org.apache.geode.cache.query.internal.QueryObserverHolder;
 import org.apache.geode.cache.query.internal.RuntimeIterator;


[05/25] geode git commit: GEODE-165: Removed OQL generated files and added the target into geode-core/build.gradle.

Posted by km...@apache.org.
http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.java
deleted file mode 100644
index bdc41a3..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.java
+++ /dev/null
@@ -1,156 +0,0 @@
-// $ANTLR 2.7.4: "oql.g" -> "OQLParser.java"$
-
-package org.apache.geode.cache.query.internal.parse;
-
-import java.util.*;
-import org.apache.geode.cache.query.internal.types.*;
-
-public interface OQLLexerTokenTypes {
-  int EOF = 1;
-  int NULL_TREE_LOOKAHEAD = 3;
-  int TOK_RPAREN = 4;
-  int TOK_LPAREN = 5;
-  int TOK_COMMA = 6;
-  int TOK_SEMIC = 7;
-  int TOK_DOTDOT = 8;
-  int TOK_COLON = 9;
-  int TOK_DOT = 10;
-  int TOK_INDIRECT = 11;
-  int TOK_CONCAT = 12;
-  int TOK_EQ = 13;
-  int TOK_PLUS = 14;
-  int TOK_MINUS = 15;
-  int TOK_SLASH = 16;
-  int TOK_STAR = 17;
-  int TOK_LE = 18;
-  int TOK_GE = 19;
-  int TOK_NE = 20;
-  int TOK_NE_ALT = 21;
-  int TOK_LT = 22;
-  int TOK_GT = 23;
-  int TOK_LBRACK = 24;
-  int TOK_RBRACK = 25;
-  int TOK_DOLLAR = 26;
-  int LETTER = 27;
-  int DIGIT = 28;
-  int ALL_UNICODE = 29;
-  int NameFirstCharacter = 30;
-  int NameCharacter = 31;
-  int RegionNameCharacter = 32;
-  int QuotedIdentifier = 33;
-  int Identifier = 34;
-  int RegionPath = 35;
-  int NUM_INT = 36;
-  int EXPONENT = 37;
-  int FLOAT_SUFFIX = 38;
-  int HEX_DIGIT = 39;
-  int QUOTE = 40;
-  int StringLiteral = 41;
-  int WS = 42;
-  int SL_COMMENT = 43;
-  int ML_COMMENT = 44;
-  int QUERY_PROGRAM = 45;
-  int QUALIFIED_NAME = 46;
-  int QUERY_PARAM = 47;
-  int ITERATOR_DEF = 48;
-  int PROJECTION_ATTRS = 49;
-  int PROJECTION = 50;
-  int TYPECAST = 51;
-  int COMBO = 52;
-  int METHOD_INV = 53;
-  int POSTFIX = 54;
-  int OBJ_CONSTRUCTOR = 55;
-  int IMPORTS = 56;
-  int SORT_CRITERION = 57;
-  int LIMIT = 58;
-  int HINT = 59;
-  int AGG_FUNC = 60;
-  int SUM = 61;
-  int AVG = 62;
-  int COUNT = 63;
-  int MAX = 64;
-  int MIN = 65;
-  int LITERAL_trace = 66;
-  int LITERAL_import = 67;
-  int LITERAL_as = 68;
-  int LITERAL_declare = 69;
-  int LITERAL_define = 70;
-  int LITERAL_query = 71;
-  int LITERAL_undefine = 72;
-  int LITERAL_select = 73;
-  int LITERAL_distinct = 74;
-  int LITERAL_all = 75;
-  int LITERAL_from = 76;
-  int LITERAL_in = 77;
-  int LITERAL_type = 78;
-  int LITERAL_where = 79;
-  int LITERAL_limit = 80;
-  int LITERAL_group = 81;
-  int LITERAL_by = 82;
-  int LITERAL_having = 83;
-  int LITERAL_hint = 84;
-  int LITERAL_order = 85;
-  int LITERAL_asc = 86;
-  int LITERAL_desc = 87;
-  int LITERAL_or = 88;
-  int LITERAL_orelse = 89;
-  int LITERAL_and = 90;
-  int LITERAL_for = 91;
-  int LITERAL_exists = 92;
-  int LITERAL_andthen = 93;
-  int LITERAL_any = 94;
-  int LITERAL_some = 95;
-  int LITERAL_like = 96;
-  int LITERAL_union = 97;
-  int LITERAL_except = 98;
-  int LITERAL_mod = 99;
-  int LITERAL_intersect = 100;
-  int LITERAL_abs = 101;
-  int LITERAL_not = 102;
-  int LITERAL_listtoset = 103;
-  int LITERAL_element = 104;
-  int LITERAL_flatten = 105;
-  int LITERAL_nvl = 106;
-  int LITERAL_to_date = 107;
-  int LITERAL_first = 108;
-  int LITERAL_last = 109;
-  int LITERAL_unique = 110;
-  int LITERAL_sum = 111;
-  int LITERAL_avg = 112;
-  int LITERAL_min = 113;
-  int LITERAL_max = 114;
-  int LITERAL_count = 115;
-  int LITERAL_is_undefined = 116;
-  int LITERAL_is_defined = 117;
-  int LITERAL_struct = 118;
-  int LITERAL_array = 119;
-  int LITERAL_set = 120;
-  int LITERAL_bag = 121;
-  int LITERAL_list = 122;
-  int LITERAL_short = 123;
-  int LITERAL_long = 124;
-  int LITERAL_int = 125;
-  int LITERAL_float = 126;
-  int LITERAL_double = 127;
-  int LITERAL_char = 128;
-  int LITERAL_string = 129;
-  int LITERAL_boolean = 130;
-  int LITERAL_byte = 131;
-  int LITERAL_octet = 132;
-  int LITERAL_enum = 133;
-  int LITERAL_date = 134;
-  int LITERAL_time = 135;
-  int LITERAL_interval = 136;
-  int LITERAL_timestamp = 137;
-  int LITERAL_collection = 138;
-  int LITERAL_dictionary = 139;
-  int LITERAL_map = 140;
-  int LITERAL_nil = 141;
-  int LITERAL_null = 142;
-  int LITERAL_undefined = 143;
-  int LITERAL_true = 144;
-  int LITERAL_false = 145;
-  int NUM_LONG = 146;
-  int NUM_FLOAT = 147;
-  int NUM_DOUBLE = 148;
-}

http://git-wip-us.apache.org/repos/asf/geode/blob/16e2cfcd/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.txt
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.txt b/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.txt
deleted file mode 100644
index 8c8fda5..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/OQLLexerTokenTypes.txt
+++ /dev/null
@@ -1,147 +0,0 @@
-// $ANTLR 2.7.4: oql.g -> OQLLexerTokenTypes.txt$
-OQLLexer    // output token vocab name
-TOK_RPAREN=4
-TOK_LPAREN=5
-TOK_COMMA=6
-TOK_SEMIC=7
-TOK_DOTDOT=8
-TOK_COLON=9
-TOK_DOT=10
-TOK_INDIRECT=11
-TOK_CONCAT=12
-TOK_EQ=13
-TOK_PLUS=14
-TOK_MINUS=15
-TOK_SLASH=16
-TOK_STAR=17
-TOK_LE=18
-TOK_GE=19
-TOK_NE=20
-TOK_NE_ALT=21
-TOK_LT=22
-TOK_GT=23
-TOK_LBRACK=24
-TOK_RBRACK=25
-TOK_DOLLAR=26
-LETTER=27
-DIGIT=28
-ALL_UNICODE=29
-NameFirstCharacter=30
-NameCharacter=31
-RegionNameCharacter=32
-QuotedIdentifier=33
-Identifier=34
-RegionPath=35
-NUM_INT=36
-EXPONENT=37
-FLOAT_SUFFIX=38
-HEX_DIGIT=39
-QUOTE=40
-StringLiteral=41
-WS=42
-SL_COMMENT=43
-ML_COMMENT=44
-QUERY_PROGRAM=45
-QUALIFIED_NAME=46
-QUERY_PARAM=47
-ITERATOR_DEF=48
-PROJECTION_ATTRS=49
-PROJECTION=50
-TYPECAST=51
-COMBO=52
-METHOD_INV=53
-POSTFIX=54
-OBJ_CONSTRUCTOR=55
-IMPORTS=56
-SORT_CRITERION=57
-LIMIT=58
-HINT=59
-AGG_FUNC=60
-SUM=61
-AVG=62
-COUNT=63
-MAX=64
-MIN=65
-LITERAL_trace="trace"=66
-LITERAL_import="import"=67
-LITERAL_as="as"=68
-LITERAL_declare="declare"=69
-LITERAL_define="define"=70
-LITERAL_query="query"=71
-LITERAL_undefine="undefine"=72
-LITERAL_select="select"=73
-LITERAL_distinct="distinct"=74
-LITERAL_all="all"=75
-LITERAL_from="from"=76
-LITERAL_in="in"=77
-LITERAL_type="type"=78
-LITERAL_where="where"=79
-LITERAL_limit="limit"=80
-LITERAL_group="group"=81
-LITERAL_by="by"=82
-LITERAL_having="having"=83
-LITERAL_hint="hint"=84
-LITERAL_order="order"=85
-LITERAL_asc="asc"=86
-LITERAL_desc="desc"=87
-LITERAL_or="or"=88
-LITERAL_orelse="orelse"=89
-LITERAL_and="and"=90
-LITERAL_for="for"=91
-LITERAL_exists="exists"=92
-LITERAL_andthen="andthen"=93
-LITERAL_any="any"=94
-LITERAL_some="some"=95
-LITERAL_like="like"=96
-LITERAL_union="union"=97
-LITERAL_except="except"=98
-LITERAL_mod="mod"=99
-LITERAL_intersect="intersect"=100
-LITERAL_abs="abs"=101
-LITERAL_not="not"=102
-LITERAL_listtoset="listtoset"=103
-LITERAL_element="element"=104
-LITERAL_flatten="flatten"=105
-LITERAL_nvl="nvl"=106
-LITERAL_to_date="to_date"=107
-LITERAL_first="first"=108
-LITERAL_last="last"=109
-LITERAL_unique="unique"=110
-LITERAL_sum="sum"=111
-LITERAL_avg="avg"=112
-LITERAL_min="min"=113
-LITERAL_max="max"=114
-LITERAL_count="count"=115
-LITERAL_is_undefined="is_undefined"=116
-LITERAL_is_defined="is_defined"=117
-LITERAL_struct="struct"=118
-LITERAL_array="array"=119
-LITERAL_set="set"=120
-LITERAL_bag="bag"=121
-LITERAL_list="list"=122
-LITERAL_short="short"=123
-LITERAL_long="long"=124
-LITERAL_int="int"=125
-LITERAL_float="float"=126
-LITERAL_double="double"=127
-LITERAL_char="char"=128
-LITERAL_string="string"=129
-LITERAL_boolean="boolean"=130
-LITERAL_byte="byte"=131
-LITERAL_octet="octet"=132
-LITERAL_enum="enum"=133
-LITERAL_date="date"=134
-LITERAL_time="time"=135
-LITERAL_interval="interval"=136
-LITERAL_timestamp="timestamp"=137
-LITERAL_collection="collection"=138
-LITERAL_dictionary="dictionary"=139
-LITERAL_map="map"=140
-LITERAL_nil="nil"=141
-LITERAL_null="null"=142
-LITERAL_undefined="undefined"=143
-LITERAL_true="true"=144
-LITERAL_false="false"=145
-NUM_LONG=146
-NUM_FLOAT=147
-NUM_DOUBLE=148


[24/25] geode git commit: GEODE-2240: fix unsafe concurrent access of ArrayList When adding to the expiredTombstones ArrayList the code now holds a sync on getBlockGCLock.

Posted by km...@apache.org.
GEODE-2240: fix unsafe concurrent access of ArrayList
When adding to the expiredTombstones ArrayList the code
now holds a sync on getBlockGCLock.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/7fe38234
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/7fe38234
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/7fe38234

Branch: refs/heads/feature/GEODE-2231
Commit: 7fe382342c17f938c67da29472218ecda41d410e
Parents: 577bda1
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Dec 21 13:48:32 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/geode/internal/cache/TombstoneService.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/7fe38234/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
index 2840134..7032775 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
@@ -669,7 +669,9 @@ public class TombstoneService {
       if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
         logger.trace(LogMarker.TOMBSTONE, "adding expired tombstone {} to batch", tombstone);
       }
-      expiredTombstones.add(tombstone);
+      synchronized (getBlockGCLock()) {
+        expiredTombstones.add(tombstone);
+      }
     }
 
     @Override


[14/25] geode git commit: GEODE-77: Replace JGroups 2.2.9

Posted by km...@apache.org.
GEODE-77: Replace JGroups 2.2.9

This adds a test ensuring that a large membership ID is properly transmitted
via JGroups.  An older version of GemFire recently ran into this problem so
I wanted to make sure it works okay in Geode with its new membership services.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/2a7209dd
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/2a7209dd
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/2a7209dd

Branch: refs/heads/feature/GEODE-2231
Commit: 2a7209dda9b764d97ff640783e0f4357b4b76c58
Parents: 5fa388c
Author: Bruce Schuchardt <bs...@pivotal.io>
Authored: Tue Dec 20 15:01:56 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../membership/MembershipJUnitTest.java         | 72 +++++++++++++-------
 1 file changed, 48 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/2a7209dd/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
index eeb2d9b..f112d1a 100755
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java
@@ -24,9 +24,9 @@ import static org.mockito.Mockito.when;
 
 import java.io.File;
 import java.net.InetAddress;
+import java.util.List;
 import java.util.Properties;
 
-import org.apache.geode.distributed.internal.membership.gms.messenger.GMSEncrypt;
 import org.apache.logging.log4j.Level;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -47,23 +47,9 @@ import org.apache.geode.distributed.internal.membership.gms.mgr.GMSMembershipMan
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.admin.remote.RemoteTransportConfig;
-import org.apache.geode.test.junit.categories.FlakyTest;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
-import org.apache.logging.log4j.Level;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import java.io.File;
-import java.net.InetAddress;
-import java.util.Properties;
-
 import static org.apache.geode.distributed.ConfigurationProperties.*;
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.*;
 
 @Category({IntegrationTest.class, MembershipJUnitTest.class})
 public class MembershipJUnitTest {
@@ -80,7 +66,6 @@ public class MembershipJUnitTest {
     // LogService.setBaseLogLevel(baseLogLevel);
   }
 
-
   // @Test
   // public void testRepeat() throws Exception {
   // for (int i=0; i<50; i++) {
@@ -92,13 +77,46 @@ public class MembershipJUnitTest {
   /**
    * This test creates a locator with a colocated membership manager and then creates a second
    * manager that joins the system of the first.
-   * 
+   *
    * It then makes assertions about the state of the membership view, closes one of the managers and
    * makes more assertions. It also ensures that a cache message can be sent from one manager to the
    * other.
    */
   @Test
   public void testMultipleManagersInSameProcess() throws Exception {
+    doTestMultipleManagersInSameProcessWithGroups("red, blue");
+  }
+
+  /**
+   * Ensure that a large membership group doesn't cause communication issues
+   */
+  @Test
+  public void testManagersWithLargeGroups() throws Exception {
+    StringBuilder stringBuilder = new StringBuilder(80000);
+    boolean first = true;
+    // create 8000 10-byte group names
+    for (int thousands = 1; thousands < 9; thousands++) {
+      for (int group = 0; group < 1000; group++) {
+        if (!first) {
+          stringBuilder.append(',');
+        }
+        first = false;
+        stringBuilder.append(String.format("%1$02d%2$08d", thousands, group));
+      }
+    }
+    List<String> result = doTestMultipleManagersInSameProcessWithGroups(stringBuilder.toString());
+    assertEquals(8000, result.size());
+    for (String group : result) {
+      assertEquals(10, group.length());
+    }
+  }
+
+  /**
+   * this runs the test with a given set of member groups. Returns the groups of the member that was
+   * not the coordinator for verification that they were correctly transmitted
+   */
+  private List<String> doTestMultipleManagersInSameProcessWithGroups(String groups)
+      throws Exception {
 
     MembershipManager m1 = null, m2 = null;
     Locator l = null;
@@ -113,7 +131,7 @@ public class MembershipJUnitTest {
       // this locator will hook itself up with the first MembershipManager
       // to be created
       l = InternalLocator.startLocator(port, new File(""), null, null, null, localHost, false,
-          new Properties(), true, false, null, false);
+          new Properties(), null);
 
       // create configuration objects
       Properties nonDefault = new Properties();
@@ -121,7 +139,7 @@ public class MembershipJUnitTest {
       nonDefault.put(MCAST_PORT, "0");
       nonDefault.put(LOG_FILE, "");
       nonDefault.put(LOG_LEVEL, "fine");
-      nonDefault.put(GROUPS, "red, blue");
+      nonDefault.put(GROUPS, groups);
       nonDefault.put(MEMBER_TIMEOUT, "2000");
       nonDefault.put(LOCATORS, localHost.getHostName() + '[' + port + ']');
       DistributionConfigImpl config = new DistributionConfigImpl(nonDefault);
@@ -168,8 +186,14 @@ public class MembershipJUnitTest {
         }
       }
 
-      System.out.println("testing multicast availability");
-      assertTrue(m1.testMulticast());
+      NetView view = jl1.getView();
+      InternalDistributedMember notCreator;
+      if (view.getCreator().equals(jl1.getMemberID())) {
+        notCreator = view.getMembers().get(1);
+      } else {
+        notCreator = view.getMembers().get(0);
+      }
+      List<String> result = notCreator.getGroups();
 
       System.out.println("sending SerialAckedMessage from m1 to m2");
       SerialAckedMessage msg = new SerialAckedMessage();
@@ -204,6 +228,8 @@ public class MembershipJUnitTest {
       assertTrue(!m2.isConnected());
 
       assertTrue(m1.getView().size() == 1);
+
+      return result;
     } finally {
 
       if (m2 != null) {
@@ -244,7 +270,7 @@ public class MembershipJUnitTest {
       // this locator will hook itself up with the first MembershipManager
       // to be created
       l = InternalLocator.startLocator(port, new File(""), null, null, null, localHost, false, p,
-          true, false, null, false);
+          null);
 
       // create configuration objects
       Properties nonDefault = new Properties();
@@ -368,7 +394,6 @@ public class MembershipJUnitTest {
     sc = new ServiceConfig(transport, config);
     assertEquals(24000, sc.getJoinTimeout());
 
-
     nonDefault.clear();
     nonDefault.put(LOCATORS, SocketCreator.getLocalHost().getHostAddress() + "[" + 12345 + "]");
     config = new DistributionConfigImpl(nonDefault);
@@ -376,7 +401,6 @@ public class MembershipJUnitTest {
     sc = new ServiceConfig(transport, config);
     assertEquals(60000, sc.getJoinTimeout());
 
-
     timeout = 2000;
     System.setProperty("p2p.joinTimeout", "" + timeout);
     try {


[21/25] geode git commit: GEODE-2238: Fix how peers discover locators with cluster config

Posted by km...@apache.org.
GEODE-2238: Fix how peers discover locators with cluster config

Call super.process last in StartupResponseWithVersionMessage, so that
that threads waiting on the response will have the results of
dm.addHostedLocators.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/93994481
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/93994481
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/93994481

Branch: refs/heads/feature/GEODE-2231
Commit: 93994481e361d590ae201e7cbecfd18ee45603b4
Parents: 16e2cfc
Author: Dan Smith <up...@apache.org>
Authored: Tue Dec 20 17:38:47 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../internal/StartupMessageReplyProcessor.java           | 11 -----------
 .../internal/StartupResponseWithVersionMessage.java      |  2 +-
 2 files changed, 1 insertion(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/93994481/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupMessageReplyProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupMessageReplyProcessor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupMessageReplyProcessor.java
index de6e71f..f90f0da 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupMessageReplyProcessor.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupMessageReplyProcessor.java
@@ -101,15 +101,4 @@ public class StartupMessageReplyProcessor extends ReplyProcessor21 {
     // }
     // }
   }
-
-  /**
-   * overridden from ReplyProcessor21 to allow early-out. If an existing member accepted or rejected
-   * us then we are done.
-   */
-  @Override
-  protected boolean canStopWaiting() {
-    return this.receivedAcceptance || this.receivedRejectionMessage;
-  }
-
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/93994481/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupResponseWithVersionMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupResponseWithVersionMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupResponseWithVersionMessage.java
index 6276d63..5bcbb47 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupResponseWithVersionMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/StartupResponseWithVersionMessage.java
@@ -57,7 +57,6 @@ public class StartupResponseWithVersionMessage extends StartupResponseMessage {
 
   @Override
   protected void process(DistributionManager dm) {
-    super.process(dm);
     if (this.hostedLocators != null) {
       dm.addHostedLocators(getSender(), this.hostedLocators, this.isSharedConfigurationEnabled);
     }
@@ -65,6 +64,7 @@ public class StartupResponseWithVersionMessage extends StartupResponseMessage {
       logger.debug("Received StartupResponseWithVersionMessage from a member with version: {}",
           this.version);
     }
+    super.process(dm);
   }
 
   public int getDSFID() {


[23/25] geode git commit: GEODE-2234: Query stats are now calculated per member in the LuceneFunction

Posted by km...@apache.org.
GEODE-2234: Query stats are now calculated per member in the LuceneFunction


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/32b8a004
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/32b8a004
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/32b8a004

Branch: refs/heads/feature/GEODE-2231
Commit: 32b8a004f16a9bc6ac44ee62ad64f863a131dd35
Parents: 9399448
Author: Barry Oglesby <bo...@pivotal.io>
Authored: Tue Dec 20 10:24:17 2016 -0800
Committer: Karen Miller <km...@pivotal.io>
Committed: Fri Dec 23 13:09:28 2016 -0800

----------------------------------------------------------------------
 .../cache/lucene/internal/LuceneIndexStats.java | 35 ++++++++++++++++++++
 .../internal/distributed/LuceneFunction.java    | 32 +++++++++++-------
 .../repository/IndexRepositoryImpl.java         |  4 +--
 .../internal/LuceneIndexStatsJUnitTest.java     | 13 ++++++++
 .../cli/LuceneIndexCommandsDUnitTest.java       |  2 +-
 .../distributed/LuceneFunctionJUnitTest.java    |  4 +++
 .../management/LuceneManagementDUnitTest.java   |  3 +-
 .../IndexRepositoryImplJUnitTest.java           |  4 +--
 8 files changed, 79 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
index 013d44e..a914799 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexStats.java
@@ -36,6 +36,10 @@ public class LuceneIndexStats {
   private static final int queryExecutionTimeId;
   private static final int queryExecutionsInProgressId;
   private static final int queryExecutionTotalHitsId;
+  private static final int repositoryQueryExecutionsId;
+  private static final int repositoryQueryExecutionTimeId;
+  private static final int repositoryQueryExecutionsInProgressId;
+  private static final int repositoryQueryExecutionTotalHitsId;
   private static final int updatesId;
   private static final int updateTimeId;
   private static final int updatesInProgressId;
@@ -58,6 +62,14 @@ public class LuceneIndexStats {
             "Number of query executions currently in progress", "operations"),
         f.createLongCounter("queryExecutionTotalHits",
             "Total number of documents returned by query executions", "entries"),
+        f.createIntCounter("repositoryQueryExecutions",
+            "Number of lucene repository queries executed on this member", "operations"),
+        f.createLongCounter("repositoryQueryExecutionTime",
+            "Amount of time spent executing lucene repository queries", "nanoseconds"),
+        f.createIntGauge("repositoryQueryExecutionsInProgress",
+            "Number of repository query executions currently in progress", "operations"),
+        f.createLongCounter("repositoryQueryExecutionTotalHits",
+            "Total number of documents returned by repository query executions", "entries"),
         f.createIntCounter("updates",
             "Number of lucene index documents added/removed on this member", "operations"),
         f.createLongCounter("updateTime",
@@ -75,6 +87,11 @@ public class LuceneIndexStats {
     queryExecutionTimeId = statsType.nameToId("queryExecutionTime");
     queryExecutionsInProgressId = statsType.nameToId("queryExecutionsInProgress");
     queryExecutionTotalHitsId = statsType.nameToId("queryExecutionTotalHits");
+    repositoryQueryExecutionsId = statsType.nameToId("repositoryQueryExecutions");
+    repositoryQueryExecutionTimeId = statsType.nameToId("repositoryQueryExecutionTime");
+    repositoryQueryExecutionsInProgressId =
+        statsType.nameToId("repositoryQueryExecutionsInProgress");
+    repositoryQueryExecutionTotalHitsId = statsType.nameToId("repositoryQueryExecutionTotalHits");
     updatesId = statsType.nameToId("updates");
     updateTimeId = statsType.nameToId("updateTime");
     updatesInProgressId = statsType.nameToId("updatesInProgress");
@@ -92,6 +109,24 @@ public class LuceneIndexStats {
   /**
    * @return the timestamp that marks the start of the operation
    */
+  public long startRepositoryQuery() {
+    stats.incInt(repositoryQueryExecutionsInProgressId, 1);
+    return getStatTime();
+  }
+
+  /**
+   * @param start the timestamp taken when the operation started
+   */
+  public void endRepositoryQuery(long start, final int totalHits) {
+    stats.incLong(repositoryQueryExecutionTimeId, getStatTime() - start);
+    stats.incInt(repositoryQueryExecutionsInProgressId, -1);
+    stats.incInt(repositoryQueryExecutionsId, 1);
+    stats.incLong(repositoryQueryExecutionTotalHitsId, totalHits);
+  }
+
+  /**
+   * @return the timestamp that marks the start of the operation
+   */
   public long startQuery() {
     stats.incInt(queryExecutionsInProgressId, 1);
     return getStatTime();

http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
index 6a418b9..ec94469 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunction.java
@@ -19,6 +19,8 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 
+import org.apache.geode.cache.lucene.internal.LuceneIndexImpl;
+import org.apache.geode.cache.lucene.internal.LuceneIndexStats;
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.search.Query;
 
@@ -32,14 +34,11 @@ import org.apache.geode.cache.lucene.LuceneQueryException;
 import org.apache.geode.cache.lucene.LuceneQueryProvider;
 import org.apache.geode.cache.lucene.LuceneService;
 import org.apache.geode.cache.lucene.LuceneServiceProvider;
-import org.apache.geode.cache.lucene.internal.InternalLuceneIndex;
 import org.apache.geode.cache.lucene.internal.repository.IndexRepository;
 import org.apache.geode.cache.lucene.internal.repository.IndexResultCollector;
 import org.apache.geode.cache.lucene.internal.repository.RepositoryManager;
-import org.apache.geode.cache.query.QueryException;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.cache.BucketNotFoundException;
-import org.apache.geode.internal.cache.execute.BucketMovedException;
 import org.apache.geode.internal.logging.LogService;
 
 /**
@@ -72,9 +71,10 @@ public class LuceneFunction extends FunctionAdapter implements InternalEntity {
     }
 
     LuceneService service = LuceneServiceProvider.get(region.getCache());
-    InternalLuceneIndex index =
-        (InternalLuceneIndex) service.getIndex(searchContext.getIndexName(), region.getFullPath());
+    LuceneIndexImpl index =
+        (LuceneIndexImpl) service.getIndex(searchContext.getIndexName(), region.getFullPath());
     RepositoryManager repoManager = index.getRepositoryManager();
+    LuceneIndexStats stats = index.getIndexStats();
 
     Query query = null;
     try {
@@ -95,15 +95,23 @@ public class LuceneFunction extends FunctionAdapter implements InternalEntity {
     }
 
     Collection<IndexResultCollector> results = new ArrayList<>();
+    TopEntriesCollector mergedResult = null;
     try {
-      Collection<IndexRepository> repositories = repoManager.getRepositories(ctx);
-      for (IndexRepository repo : repositories) {
-        IndexResultCollector collector = manager.newCollector(repo.toString());
-        logger.debug("Executing search on repo: " + repo.toString());
-        repo.query(query, resultLimit, collector);
-        results.add(collector);
+      long start = stats.startQuery();
+      try {
+        Collection<IndexRepository> repositories = repoManager.getRepositories(ctx);
+        for (IndexRepository repo : repositories) {
+          IndexResultCollector collector = manager.newCollector(repo.toString());
+          if (logger.isDebugEnabled()) {
+            logger.debug("Executing search on repo: " + repo.toString());
+          }
+          repo.query(query, resultLimit, collector);
+          results.add(collector);
+        }
+        mergedResult = (TopEntriesCollector) manager.reduce(results);
+      } finally {
+        stats.endQuery(start, mergedResult == null ? 0 : mergedResult.size());
       }
-      TopEntriesCollector mergedResult = (TopEntriesCollector) manager.reduce(results);
       resultSender.lastResult(mergedResult);
     } catch (IOException | BucketNotFoundException e) {
       logger.warn("", e);

http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java
index 68a0adb..572b5ea 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImpl.java
@@ -101,7 +101,7 @@ public class IndexRepositoryImpl implements IndexRepository {
 
   @Override
   public void query(Query query, int limit, IndexResultCollector collector) throws IOException {
-    long start = stats.startQuery();
+    long start = stats.startRepositoryQuery();
     int totalHits = 0;
     IndexSearcher searcher = searcherManager.acquire();
     try {
@@ -117,7 +117,7 @@ public class IndexRepositoryImpl implements IndexRepository {
       }
     } finally {
       searcherManager.release(searcher);
-      stats.endQuery(start, totalHits);
+      stats.endRepositoryQuery(start, totalHits);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
index c70fa49..f9e200a 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexStatsJUnitTest.java
@@ -63,6 +63,19 @@ public class LuceneIndexStatsJUnitTest {
   }
 
   @Test
+  public void shouldIncrementRepositoryQueryStats() {
+
+    stats.startRepositoryQuery();
+    verifyIncInt("repositoryQueryExecutionsInProgress", 1);
+    stats.endRepositoryQuery(5, 2);
+    verifyIncInt("repositoryQueryExecutionsInProgress", -1);
+    verifyIncInt("repositoryQueryExecutions", 1);
+    verifyIncLong("repositoryQueryExecutionTotalHits", 2);
+    // Because the initial stat time is 0 and the final time is 5, the delta is -5
+    verifyIncLong("repositoryQueryExecutionTime", -5);
+  }
+
+  @Test
   public void shouldIncrementUpdateStats() {
 
     stats.startUpdate();

http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
index 92641df..f0f1579 100755
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsDUnitTest.java
@@ -148,7 +148,7 @@ public class LuceneIndexCommandsDUnitTest extends CliCommandTestBase {
     assertEquals(Collections.singletonList(INDEX_NAME), data.retrieveAllValues("Index Name"));
     assertEquals(Collections.singletonList("Initialized"), data.retrieveAllValues("Status"));
     assertEquals(Collections.singletonList("/region"), data.retrieveAllValues("Region Path"));
-    assertEquals(Collections.singletonList("113"), data.retrieveAllValues("Query Executions"));
+    assertEquals(Collections.singletonList("1"), data.retrieveAllValues("Query Executions"));
     assertEquals(Collections.singletonList("2"), data.retrieveAllValues("Commits"));
     assertEquals(Collections.singletonList("2"), data.retrieveAllValues("Updates"));
     assertEquals(Collections.singletonList("2"), data.retrieveAllValues("Documents"));

http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
index edaa11c..71172f0 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/distributed/LuceneFunctionJUnitTest.java
@@ -32,6 +32,7 @@ import org.apache.geode.cache.lucene.LuceneQueryFactory;
 import org.apache.geode.cache.lucene.LuceneQueryProvider;
 import org.apache.geode.cache.lucene.internal.InternalLuceneService;
 import org.apache.geode.cache.lucene.internal.LuceneIndexImpl;
+import org.apache.geode.cache.lucene.internal.LuceneIndexStats;
 import org.apache.geode.cache.lucene.internal.StringQueryProvider;
 import org.apache.geode.cache.lucene.internal.repository.IndexRepository;
 import org.apache.geode.cache.lucene.internal.repository.IndexResultCollector;
@@ -71,6 +72,7 @@ public class LuceneFunctionJUnitTest {
   IndexResultCollector mockCollector;
   InternalLuceneService mockService;
   LuceneIndexImpl mockIndex;
+  LuceneIndexStats mockStats;
 
   ArrayList<IndexRepository> repos;
   LuceneFunctionContext<IndexResultCollector> searchArgs;
@@ -269,6 +271,7 @@ public class LuceneFunctionJUnitTest {
     mockRepository1 = mock(IndexRepository.class, "repo1");
     mockRepository2 = mock(IndexRepository.class, "repo2");
     mockCollector = mock(IndexResultCollector.class);
+    mockStats = mock(LuceneIndexStats.class);
 
     repos = new ArrayList<IndexRepository>();
     repos.add(mockRepository1);
@@ -289,6 +292,7 @@ public class LuceneFunctionJUnitTest {
     when(mockService.getIndex(eq("indexName"), eq(regionPath))).thenReturn(mockIndex);
     when(mockIndex.getRepositoryManager()).thenReturn(mockRepoManager);
     when(mockIndex.getFieldNames()).thenReturn(new String[] {"gemfire"});
+    when(mockIndex.getIndexStats()).thenReturn(mockStats);
 
     query = queryProvider.getQuery(mockIndex);
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
index 634ea2f..ef4681c 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/management/LuceneManagementDUnitTest.java
@@ -125,8 +125,9 @@ public class LuceneManagementDUnitTest extends ManagementTestBase {
     getManagingNode().invoke(() -> waitForMemberProxiesToRefresh(2));
 
     // Verify index metrics
+    int numManagedNodes = getManagedNodeList().size();
     getManagingNode().invoke(() -> verifyMBeanIndexMetricsValues(regionName, indexName, numPuts,
-        113/* 1 query per bucket */, 1/* 1 result */));
+        numManagedNodes/* 1 query per managed node */, 1/* 1 result */));
   }
 
   private static void waitForMemberProxiesToRefresh(int refreshCount) {

http://git-wip-us.apache.org/repos/asf/geode/blob/32b8a004/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java
index ac81c02..dd52258 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/repository/IndexRepositoryImplJUnitTest.java
@@ -153,8 +153,8 @@ public class IndexRepositoryImplJUnitTest {
         new Type2("Portland Cream doughnut", 1, 2L, 3.0, 4.0f, "Captain my Captain doughnut"));
     repo.commit();
     checkQuery("Cream", "s", "key2", "key4");
-    verify(stats, times(1)).startQuery();
-    verify(stats, times(1)).endQuery(anyLong(), eq(2));
+    verify(stats, times(1)).startRepositoryQuery();
+    verify(stats, times(1)).endRepositoryQuery(anyLong(), eq(2));
   }
 
   @Test