integration/presto/src/main/java/org/apache/carbondata/presto/impl/CarbonTableReader.java
/**
   * Find all the tables under the schema store path (this.carbonFileList)
   * and cache all the table names in this.tableList. Notice that whenever this method
   * is called, it clears this.tableList and populate the list by reading the files.
   */
Find all the tables under the schema store path (this.carbonFileList)
and cache all the table names in this.tableList. Notice that whenever this method
is called, it clears this.tableList and populate the list by reading the files.
Find all the tables under the schema store path ( this . carbonFileList ) and cache all the table names in this . tableList . Notice that whenever this method is called it clears this . tableList and populate the list by reading the files .
private void updateSchemaTables(SchemaTableName schemaTableName) {
    boolean isKeyExists = carbonCache.get().containsKey(schemaTableName);
    if (carbonFileList == null) {
      updateSchemaList();
    }
    try {
      if (isKeyExists && !FileFactory
          .isFileExist(carbonCache.get().get(schemaTableName).carbonTablePath.getSchemaFilePath(),
              fileType)) {
        removeTableFromCache(schemaTableName);
        throw new TableNotFoundException(schemaTableName);
      }
    } catch (IOException e) {
      throw new RuntimeException();
    }
    if (isKeyExists) {
      CarbonTableCacheModel ctcm = carbonCache.get().get(schemaTableName);
      if(ctcm != null && ctcm.tableInfo != null) {
        Long latestTime = FileFactory.getCarbonFile(ctcm.carbonTablePath.getSchemaFilePath())
            .getLastModifiedTime();
        Long oldTime = ctcm.tableInfo.getLastUpdatedTime();
        if (DateUtils.truncate(new Date(latestTime), Calendar.MINUTE)
            .after(DateUtils.truncate(new Date(oldTime), Calendar.MINUTE))) {
          removeTableFromCache(schemaTableName);
        }
      }
    }
    if (!tableList.contains(schemaTableName)) {
      for (CarbonFile cf : carbonFileList.listFiles()) {
        if (!cf.getName().endsWith(".mdt")) {
          for (CarbonFile table : cf.listFiles()) {
            tableList.add(new SchemaTableName(cf.getName(), table.getName()));
          }
        }
      }
    }
  }
private void updateSchemaTables ( SchemaTableName schemaTableName ) { boolean isKeyExists = carbonCache . get ( ) . containsKey ( schemaTableName ) ; if ( carbonFileList == null ) { updateSchemaList ( ) ; } try { if ( isKeyExists && ! FileFactory . isFileExist ( carbonCache . get ( ) . get ( schemaTableName ) . carbonTablePath . getSchemaFilePath ( ) , fileType ) ) { removeTableFromCache ( schemaTableName ) ; throw new TableNotFoundException ( schemaTableName ) ; } } catch ( IOException e ) { throw new RuntimeException ( ) ; } if ( isKeyExists ) { CarbonTableCacheModel ctcm = carbonCache . get ( ) . get ( schemaTableName ) ; if ( ctcm != null && ctcm . tableInfo != null ) { Long latestTime = FileFactory . getCarbonFile ( ctcm . carbonTablePath . getSchemaFilePath ( ) ) . getLastModifiedTime ( ) ; Long oldTime = ctcm . tableInfo . getLastUpdatedTime ( ) ; if ( DateUtils . truncate ( new Date ( latestTime ) , Calendar . MINUTE ) . after ( DateUtils . truncate ( new Date ( oldTime ) , Calendar . MINUTE ) ) ) { removeTableFromCache ( schemaTableName ) ; } } } if ( ! tableList . contains ( schemaTableName ) ) { for ( CarbonFile cf : carbonFileList . listFiles ( ) ) { if ( ! cf . getName ( ) . endsWith ( ".mdt" ) ) { for ( CarbonFile table : cf . listFiles ( ) ) { tableList . add ( new SchemaTableName ( cf . getName ( ) , table . getName ( ) ) ) ; } } } } }
Find all the tables under the schema store path (this.carbonFileList)
 and cache all the table names in this.tableList.
Find all the tables under the schema store path ( this . carbonFileList ) and cache all the table names in this . tableList .
// update logic determine later