Example usage for org.apache.hadoop.hdfs DFSConfigKeys DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_READ_KEY

List of usage examples for org.apache.hadoop.hdfs DFSConfigKeys DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_READ_KEY

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs DFSConfigKeys DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_READ_KEY.

Prototype

String DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_READ_KEY

To view the source code for org.apache.hadoop.hdfs DFSConfigKeys DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_READ_KEY.

Click Source Link

Usage

From source file:io.hops.transaction.TestTransaction.java

License:Apache License

@BeforeClass
public static void setupCluster() throws Exception {
    Configuration conf = new HdfsConfiguration();

    conf.set(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY, "0.0.0.0:0");
    conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_READ_KEY, true);
    conf.setBoolean(DFSConfigKeys.DFS_NAMENODE_AVOID_STALE_DATANODE_FOR_WRITE_KEY, true);
    conf.setInt(DFSConfigKeys.DFS_NAMENODE_REPLICATION_INTERVAL_KEY, 10);

    cluster = new MiniDFSCluster.Builder(conf).numDataNodes(0).storagesPerDatanode(1).build();

    cluster.waitActive();/*from w  ww.  j  a v a 2s  .c o  m*/

}