Package org.teiid.query.sql.lang

Examples of org.teiid.query.sql.lang.CacheHint


        String cacheString = SQLConstants.Reserved.SELECT;
       
        if( isMaterializedGroup) {
          Object matMetadataId = metadata.getMaterialization(metadataID);
          String matTableName = null;
          CacheHint hint = null;
          boolean isImplicitGlobal = matMetadataId == null;
            if (isImplicitGlobal) {
            TempMetadataID tid = context.getGlobalTableStore().getGlobalTempTableMetadataId(metadataID, metadata);
            matTableName = tid.getID();
            hint = tid.getCacheHint();
View Full Code Here


  private static Pattern CACHE_HINT = Pattern.compile("/\\*\\+?\\s*cache(\\(\\s*(pref_mem)?\\s*(ttl:\\d{1,19})?\\s*(updatable)?\\s*(scope:(session|vdb|user))?[^\\)]*\\))?[^\\*]*\\*\\/.*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); //$NON-NLS-1$
   
  static CacheHint getQueryCacheOption(String query) {
      Matcher match = CACHE_HINT.matcher(query);
      if (match.matches()) {
        CacheHint hint = new CacheHint();
        if (match.group(2) !=null) {
          hint.setPrefersMemory(true);
        }
        String ttl = match.group(3);
        if (ttl != null) {
          hint.setTtl(Long.valueOf(ttl.substring(4)));
        }
        if (match.group(4) != null) {
          hint.setUpdatable(true);
        }
        String scope =  match.group(5);
        if (scope != null) {
          scope = scope.substring(6);
          hint.setScope(scope);
        }       
        return hint;
      }
      return null;
    }
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.lang.CacheHint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.