Example usage for org.apache.hadoop.hdfs.web.resources SnapshotNameParam SnapshotNameParam

List of usage examples for org.apache.hadoop.hdfs.web.resources SnapshotNameParam SnapshotNameParam

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.web.resources SnapshotNameParam SnapshotNameParam.

Prototype

public SnapshotNameParam(final String str) 

Source Link

Usage

From source file:com.bigstep.datalake.DLFileSystem.java

License:Apache License

@Override
public Path createSnapshot(final Path path, final String snapshotName) throws IOException {
    statistics.incrementWriteOps(1);/*from  w ww  .jav a2  s .co  m*/
    final HttpOpParam.Op op = PutOpParam.Op.CREATESNAPSHOT;
    Path spath = new FsPathResponseRunner<Path>(op, path, new SnapshotNameParam(snapshotName)) {
        @Override
        Path decodeResponse(Map<?, ?> json) {
            return new Path((String) json.get(Path.class.getSimpleName()));
        }
    }.run();
    return spath;
}

From source file:com.bigstep.datalake.DLFileSystem.java

License:Apache License

@Override
public void deleteSnapshot(final Path path, final String snapshotName) throws IOException {
    statistics.incrementWriteOps(1);//  ww w .  j a va  2s .c o  m
    final HttpOpParam.Op op = DeleteOpParam.Op.DELETESNAPSHOT;
    new FsPathRunner(op, path, new SnapshotNameParam(snapshotName)).run();
}

From source file:com.bigstep.datalake.DLFileSystem.java

License:Apache License

@Override
public void renameSnapshot(final Path path, final String snapshotOldName, final String snapshotNewName)
        throws IOException {
    statistics.incrementWriteOps(1);/* w w w.  j  a  v a  2 s  .  co  m*/
    final HttpOpParam.Op op = PutOpParam.Op.RENAMESNAPSHOT;
    new FsPathRunner(op, path, new OldSnapshotNameParam(snapshotOldName),
            new SnapshotNameParam(snapshotNewName)).run();
}