@Override public long getSize( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( fileStatus.isDir() ) return 0; return getFileSystem( conf ).getFileStatus( getPath() ).getLen(); }
@Override public long getSize( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( fileStatus.isDir() ) return 0; return getFileSystem( conf ).getFileStatus( getPath() ).getLen(); }
@Override public long getModifiedTime( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( !fileStatus.isDir() ) return fileStatus.getModificationTime(); // todo: this should ignore the _temporary path, or not cache if found in the array makeStatuses( conf ); // statuses is empty, return 0 if( statuses == null || statuses.length == 0 ) return 0; long date = 0; // filter out directories as we don't recurs into sub dirs for( FileStatus status : statuses ) { if( !status.isDir() ) date = Math.max( date, status.getModificationTime() ); } return date; }
@Override public long getModifiedTime( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( !fileStatus.isDir() ) return fileStatus.getModificationTime(); // todo: this should ignore the _temporary path, or not cache if found in the array makeStatuses( conf ); // statuses is empty, return 0 if( statuses == null || statuses.length == 0 ) return 0; long date = 0; // filter out directories as we don't recurs into sub dirs for( FileStatus status : statuses ) { if( !status.isDir() ) date = Math.max( date, status.getModificationTime() ); } return date; }
/** * Method getBlockSize returns the {@code blocksize} specified by the underlying file system for this resource. * * @param conf of JobConf * @return long * @throws IOException when */ public long getBlockSize( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( fileStatus.isDir() ) return 0; return fileStatus.getBlockSize(); }
/** * Method getBlockSize returns the {@code blocksize} specified by the underlying file system for this resource. * * @param conf of JobConf * @return long * @throws IOException when */ public long getBlockSize( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( fileStatus.isDir() ) return 0; return fileStatus.getBlockSize(); }
/** * Method getReplication returns the {@code replication} specified by the underlying file system for * this resource. * * @param conf of JobConf * @return int * @throws IOException when */ public int getReplication( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( fileStatus.isDir() ) return 0; return fileStatus.getReplication(); }
/** * Method getReplication returns the {@code replication} specified by the underlying file system for * this resource. * * @param conf of JobConf * @return int * @throws IOException when */ public int getReplication( Configuration conf ) throws IOException { if( !resourceExists( conf ) ) return 0; FileStatus fileStatus = getFileStatus( conf ); if( fileStatus.isDir() ) return 0; return fileStatus.getReplication(); }