Example usage for org.apache.hadoop.hdfs DFSTestUtil readFile

List of usage examples for org.apache.hadoop.hdfs DFSTestUtil readFile

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs DFSTestUtil readFile.

Prototype

public static String readFile(File f) throws IOException 

Source Link

Usage

From source file:com.mellanox.r4h.MiniDFSCluster.java

License:Apache License

public String readBlockOnDataNode(int i, ExtendedBlock block) throws IOException {
    assert (i >= 0 && i < dataNodes.size()) : "Invalid datanode " + i;
    File blockFile = getBlockFile(i, block);
    if (blockFile != null && blockFile.exists()) {
        return DFSTestUtil.readFile(blockFile);
    }//from w w w . j  av  a 2 s  .co m
    return null;
}