Search in sources :

Example 11 with Op

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();
}
Also used : Op(org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op)

Example 12 with Op

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();
}
Also used : Op(org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op)

Example 13 with Op

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;
}
Also used : HdfsFileStatus(org.apache.hadoop.hdfs.protocol.HdfsFileStatus) Op(org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op) FileNotFoundException(java.io.FileNotFoundException)

Example 14 with Op

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();
}
Also used : Op(org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op)

Example 15 with Op

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();
}
Also used : Op(org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op)

Aggregations

Op (org.apache.hadoop.hdfs.web.resources.HttpOpParam.Op)40 IOException (java.io.IOException)8 Path (org.apache.hadoop.fs.Path)3 FsPermission (org.apache.hadoop.fs.permission.FsPermission)3 FileNotFoundException (java.io.FileNotFoundException)2 Map (java.util.Map)1 ContentSummary (org.apache.hadoop.fs.ContentSummary)1 MD5MD5CRC32FileChecksum (org.apache.hadoop.fs.MD5MD5CRC32FileChecksum)1 AclStatus (org.apache.hadoop.fs.permission.AclStatus)1 HdfsFileStatus (org.apache.hadoop.hdfs.protocol.HdfsFileStatus)1 DelegationTokenIdentifier (org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier)1 AccessControlException (org.apache.hadoop.security.AccessControlException)1 InvalidToken (org.apache.hadoop.security.token.SecretManager.InvalidToken)1 Token (org.apache.hadoop.security.token.Token)1