use of org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op in project hadoop by apache.
the class WebHdfsFileSystem method removeDefaultAcl.
@Override
public void removeDefaultAcl(Path path) throws IOException {
statistics.incrementWriteOps(1);
storageStatistics.incrementOpCounter(OpType.REMOVE_DEFAULT_ACL);
final HttpOpParam.Op op = PutOpParam.Op.REMOVEDEFAULTACL;
new FsPathRunner(op, path).run();
}
use of org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op in project hadoop by apache.
the class WebHdfsFileSystem method renameSnapshot.
@Override
public void renameSnapshot(final Path path, final String snapshotOldName, final String snapshotNewName) throws IOException {
statistics.incrementWriteOps(1);
storageStatistics.incrementOpCounter(OpType.RENAME_SNAPSHOT);
final HttpOpParam.Op op = PutOpParam.Op.RENAMESNAPSHOT;
new FsPathRunner(op, path, new OldSnapshotNameParam(snapshotOldName), new SnapshotNameParam(snapshotNewName)).run();
}
use of org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op in project hadoop by apache.
the class WebHdfsFileSystem method getHdfsFileStatus.
private HdfsFileStatus getHdfsFileStatus(Path f) throws IOException {
final HttpOpParam.Op op = GetOpParam.Op.GETFILESTATUS;
HdfsFileStatus status = new FsPathResponseRunner<HdfsFileStatus>(op, f) {
@Override
HdfsFileStatus decodeResponse(Map<?, ?> json) {
return JsonUtilClient.toFileStatus(json, true);
}
}.run();
if (status == null) {
throw new FileNotFoundException("File does not exist: " + f);
}
return status;
}
use of org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op in project hadoop by apache.
the class WebHdfsFileSystem method setReplication.
@Override
public boolean setReplication(final Path p, final short replication) throws IOException {
statistics.incrementWriteOps(1);
storageStatistics.incrementOpCounter(OpType.SET_REPLICATION);
final HttpOpParam.Op op = PutOpParam.Op.SETREPLICATION;
return new FsPathBooleanRunner(op, p, new ReplicationParam(replication)).run();
}
use of org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op in project hadoop by apache.
the class WebHdfsFileSystem method removeXAttr.
@Override
public void removeXAttr(Path p, String name) throws IOException {
statistics.incrementWriteOps(1);
storageStatistics.incrementOpCounter(OpType.REMOVE_XATTR);
final HttpOpParam.Op op = PutOpParam.Op.REMOVEXATTR;
new FsPathRunner(op, p, new XAttrNameParam(name)).run();
}
Aggregations