Example usage for org.apache.hadoop.tools CopyListingFileStatus CopyListingFileStatus

List of usage examples for org.apache.hadoop.tools CopyListingFileStatus CopyListingFileStatus

Introduction

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

Prototype

public CopyListingFileStatus() 

Source Link

Document

Default constructor.

Usage

From source file:org.apache.falcon.replication.FilteredCopyListingTest.java

License:Apache License

private void verifyContents(Path listingPath, int expected) throws Exception {
    SequenceFile.Reader reader = new SequenceFile.Reader(FileSystem.getLocal(new Configuration()), listingPath,
            new Configuration());
    Text key = new Text();
    FileStatus value = new CopyListingFileStatus();
    Map<String, String> actualValues = new HashMap<String, String>();
    while (reader.next(key, value)) {
        actualValues.put(value.getPath().toString(), key.toString());
    }//from  w  w w  .  jav  a2  s .  c  o m

    Assert.assertEquals(actualValues.size(), expected == -1 ? EXPECTED_VALUES.size() : expected);
    for (Map.Entry<String, String> entry : actualValues.entrySet()) {
        Assert.assertEquals(entry.getValue(), EXPECTED_VALUES.get(entry.getKey()));
    }
}