private static Set<String> compileQuery(final Cache cache,final String query) throws QueryInvalidException {
  QCompiler compiler=new QCompiler();
  Set<String> regionsInQuery=null;
  try {
    CompiledValue compiledQuery=compiler.compileQuery(query);
    Set<String> regions=new HashSet<String>();
    compiledQuery.getRegionsInQuery(regions,null);
    regionsInQuery=Collections.unmodifiableSet(regions);
    return regionsInQuery;
  }
 catch (  QueryInvalidException qe) {
    logger.error("{} Failed, Error {}",query,qe.getMessage(),qe);
    throw qe;
  }
}

private static Set < String > compileQuery ( final Cache cache , final String query ) throws QueryInvalidException { QCompiler compiler = new QCompiler ( ) ; Set < String > regionsInQuery = null ; try { CompiledValue compiledQuery = compiler . compileQuery ( query ) ; Set < String > regions = new HashSet < String > ( ) ; compiledQuery . getRegionsInQuery ( regions , null ) ; regionsInQuery = Collections . unmodifiableSet ( regions ) ; return regionsInQuery ; } catch ( QueryInvalidException qe ) { logger . error ( "{} Failed, Error {}" , query , qe . getMessage ( ) , qe ) ; throw qe ; } }
compile the query and return a set of regions involved in the query it throws an queryinvalidexception if the query is not proper
