@Override public FileStatus[] globStatus(Path pathPattern) throws IOException { FileStatus[] statuses = super.globStatus(pathPattern); if (statuses == null) { acquirePermit("globStatus " + pathPattern); } else { acquirePermits(statuses.length / LISTING_FILES_PER_PERMIT + 1, "globStatus " + pathPattern); } return statuses; }
@Override public FSDataOutputStream create(Path path, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { this.acquirePermit("create " + path); return super.create(path, permission, overwrite, bufferSize, replication, blockSize, progress); }
@Override public FileStatus[] listStatus(Path path) throws IOException { FileStatus[] statuses = super.listStatus(path); if (statuses == null) { acquirePermit("listStatus " + path); } else { acquirePermits(statuses.length / LISTING_FILES_PER_PERMIT + 1, "listStatus " + path); } return statuses; }
@Override public boolean exists(Path path) throws IOException { this.acquirePermit("exists " + path); return super.exists(path); }
@Override public FileStatus[] listStatus(Path path, PathFilter filter) throws IOException { CountingPathFilterDecorator decoratedFilter = new CountingPathFilterDecorator(filter); FileStatus[] statuses = super.listStatus(path, decoratedFilter); if (statuses == null) { acquirePermit("listStatus " + path); } else { acquirePermits(decoratedFilter.getPathsProcessed().get() / LISTING_FILES_PER_PERMIT + 1, "listStatus " + path); } return statuses; }
@Override public boolean mkdirs(Path path, FsPermission permission) throws IOException { this.acquirePermit("mkdirs " + path); return super.mkdirs(path, permission); }
@Override public FileStatus[] globStatus(Path pathPattern) throws IOException { FileStatus[] statuses = super.globStatus(pathPattern); if (statuses == null) { acquirePermit("globStatus " + pathPattern); } else { acquirePermits(statuses.length / LISTING_FILES_PER_PERMIT + 1, "globStatus " + pathPattern); } return statuses; }
@Override public FSDataOutputStream append(Path path, int bufferSize, Progressable progress) throws IOException { this.acquirePermit("append " + path); return super.append(path, bufferSize, progress); }
@Override public FileStatus[] listStatus(Path path, PathFilter filter) throws IOException { CountingPathFilterDecorator decoratedFilter = new CountingPathFilterDecorator(filter); FileStatus[] statuses = super.listStatus(path, decoratedFilter); if (statuses == null) { acquirePermit("listStatus " + path); } else { acquirePermits(decoratedFilter.getPathsProcessed().get() / LISTING_FILES_PER_PERMIT + 1, "listStatus " + path); } return statuses; }
@Override public FSDataInputStream open(Path path, int bufferSize) throws IOException { this.acquirePermit("open " + path); return super.open(path, bufferSize); }
@Override public boolean delete(Path path, boolean recursive) throws IOException { this.acquirePermit("delete " + path); return super.delete(path, recursive); }
@Override public FileStatus getFileStatus(Path path) throws IOException { this.acquirePermit("getFileStatus " + path); return super.getFileStatus(path); }
@Override public boolean rename(Path path0, Path path1) throws IOException { this.acquirePermit("rename " + path0); return HadoopUtils.renamePathHandleLocalFSRace(this.underlyingFs, path0, path1); }
@Override public FSDataInputStream open(Path path, int bufferSize) throws IOException { this.acquirePermit("open " + path); return super.open(path, bufferSize); }
@Override public boolean mkdirs(Path path, FsPermission permission) throws IOException { this.acquirePermit("mkdirs " + path); return super.mkdirs(path, permission); }
@Override public FileStatus getFileStatus(Path path) throws IOException { this.acquirePermit("getFileStatus " + path); return super.getFileStatus(path); }
@Override public FSDataOutputStream append(Path path, int bufferSize, Progressable progress) throws IOException { this.acquirePermit("append " + path); return super.append(path, bufferSize, progress); }
@Override public FSDataOutputStream create(Path path, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { this.acquirePermit("create " + path); return super.create(path, permission, overwrite, bufferSize, replication, blockSize, progress); }
@Override public boolean exists(Path path) throws IOException { this.acquirePermit("exists " + path); return super.exists(path); }
@Override public boolean rename(Path path0, Path path1) throws IOException { this.acquirePermit("rename " + path0); return HadoopUtils.renamePathHandleLocalFSRace(this.underlyingFs, path0, path1); }