Example usage for org.apache.hadoop.hdfs.tools DFSck run

List of usage examples for org.apache.hadoop.hdfs.tools DFSck run

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs.tools DFSck run.

Prototype

@Override
    public int run(final String[] args) throws IOException 

Source Link

Usage

From source file:org.smartfrog.services.hadoop.operations.dfs.DfsFsckImpl.java

License:Open Source License

/**
 * call {@link DFSck} to check the filesystem. This may take an indeterminate amount of time.
 *
 * @throws Exception on any failure/*from w w w  . jav a  2 s . c  o  m*/
 */
@Override
protected void performDfsOperation(FileSystem fileSystem, ManagedConfiguration conf) throws Exception {
    DFSck fsck = new DFSck(conf);
    List<String> args = new ArrayList<String>();
    addIfSet(args, "move");
    addIfSet(args, "delete");
    addIfSet(args, "blocks");
    addIfSet(args, "locations");
    addIfSet(args, "racks");
    addIfSet(args, "openForWrite", "-openforwrite");
    String[] argv = args.toArray(new String[args.size()]);
    fsck.run(argv);
}