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

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

Introduction

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

Prototype

public DFSck(Configuration conf) throws IOException 

Source Link

Document

Filesystem checker.

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  ww w  . ja  v  a 2 s  . com*/
 */
@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);
}