Example usage for org.apache.hadoop.hdfs DistributedFileSystem rename

List of usage examples for org.apache.hadoop.hdfs DistributedFileSystem rename

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs DistributedFileSystem rename.

Prototype

@SuppressWarnings("deprecation")
    @Override
    public boolean rename(Path src, Path dst) throws IOException 

Source Link

Usage

From source file:com.trace.hadoop.TestDFSRename.java

License:Apache License

private void rename(Path src, Path dst, boolean renameSucceeds, boolean quotaException) throws Exception {
    DistributedFileSystem fs = (DistributedFileSystem) cluster.getFileSystem();
    try {//from  w  w w.j  a  v  a 2  s.  co m
        assertEquals(renameSucceeds, fs.rename(src, dst));
    } catch (QuotaExceededException ex) {
        assertTrue(quotaException);
    }
    assertEquals(renameSucceeds, !fs.exists(src));
    assertEquals(renameSucceeds, fs.exists(dst));
}