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

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

Introduction

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

Prototype

int DFS_DATANODE_HTTP_DEFAULT_PORT

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

Click Source Link

Usage

From source file:io.hops.experiments.benchmarks.blockreporting.TinyDatanode.java

License:Apache License

void register(boolean isDataNodePopulated) throws Exception {
    List<BlockReportingNameNodeHandle> namenodes = nameNodeSelector.getNameNodes();
    // get versions from the namenode
    nsInfo = namenodes.get(0).getDataNodeRPC().versionRequest();
    dnRegistration = new DatanodeRegistration(
            new DatanodeID(DNS.getDefaultIP("default"), DNS.getDefaultHost("default", "default"), "",
                    getNodePort(dnIdx), DFSConfigKeys.DFS_DATANODE_HTTP_DEFAULT_PORT,
                    DFSConfigKeys.DFS_DATANODE_IPC_DEFAULT_PORT),
            new DataStorage(nsInfo, ""), new ExportedBlockKeys(), VersionInfo.getVersion());
    dnRegistration.setStorageID(createNewStorageId(dnRegistration.getXferPort(), dnIdx));
    // register datanode
    for (BlockReportingNameNodeHandle nn : namenodes) {
        dnRegistration = nn.getDataNodeRPC().registerDatanode(dnRegistration);
    }/*w  w  w. j  av a  2 s  . c o m*/
    //first block reports
    storage = new DatanodeStorage(dnRegistration.getStorageID());
    if (!isDataNodePopulated) {
        firstBlockReport(new BlockListAsLongs(null, null).getBlockListAsLongs());
    }
}