private static boolean ifExistsAndFresh(Configuration conf, FileSystem fs,
                                          URI cache, long confFileStamp,
                                          CacheStatus lcacheStatus,
                                          FileStatus fileStatus)
  throws IOException {
    // check for existence of the cache
    long dfsFileStamp;
    if (fileStatus != null) {
      dfsFileStamp = fileStatus.getModificationTime();
    } else {
      dfsFileStamp = getTimestamp(conf, cache);
    }

    // ensure that the file on hdfs hasn't been modified since the job started
    if (dfsFileStamp != confFileStamp) {
      LOG.fatal("File: " + cache + " has changed on HDFS since job started");
      throw new IOException("File: " + cache +
          " has changed on HDFS since job started");
    }

    if (dfsFileStamp != lcacheStatus.mtime) {
      // needs refreshing
      return false;
    }

    return true;
  }
private static boolean ifExistsAndFresh ( Configuration conf , FileSystem fs , URI cache , long confFileStamp , CacheStatus lcacheStatus , FileStatus fileStatus ) throws IOException { long dfsFileStamp ; if ( fileStatus != null ) { dfsFileStamp = fileStatus . getModificationTime ( ) ; } else { dfsFileStamp = getTimestamp ( conf , cache ) ; } if ( dfsFileStamp != confFileStamp ) { LOG . fatal ( "File: " + cache + " has changed on HDFS since job started" ) ; throw new IOException ( "File: " + cache + " has changed on HDFS since job started" ) ; } if ( dfsFileStamp != lcacheStatus . mtime ) { return false ; } return true ; }
Checks if the cache has already been localized and is fresh