org.apache.hadoop.hdfs.server.datanode.DataNode.getInfoPort()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.apache.hadoop.hdfs.server.datanode.DataNode.getInfoPort()方法的一些代码示例,展示了DataNode.getInfoPort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataNode.getInfoPort()方法的具体详情如下:
包路径:org.apache.hadoop.hdfs.server.datanode.DataNode
类名称:DataNode
方法名:getInfoPort

DataNode.getInfoPort介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

/**
 * Create a DatanodeRegistration for a specific block pool.
 * @param nsInfo the namespace info from the first part of the NN handshake
 */
DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) {
 StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID());
 if (storageInfo == null) {
  // it's null in the case of SimulatedDataSet
  storageInfo = new StorageInfo(
    DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION,
    nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(),
    NodeType.DATA_NODE);
 }
 DatanodeID dnId = new DatanodeID(
   streamingAddr.getAddress().getHostAddress(), hostName, 
   storage.getDatanodeUuid(), getXferPort(), getInfoPort(),
     infoSecurePort, getIpcPort());
 return new DatanodeRegistration(dnId, storageInfo, 
   new ExportedBlockKeys(), VersionInfo.getVersion());
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs-test

private static void testViewingFile(MiniDFSCluster cluster, String filePath,
  boolean doTail) throws IOException {
 FileSystem fs = cluster.getFileSystem();
 Path testPath = new Path(filePath);
 if (!fs.exists(testPath)) {
  DFSTestUtil.writeFile(fs, testPath, FILE_DATA);
 }
 InetSocketAddress nnHttpAddress = cluster.getNameNode().getHttpAddress();
 int dnInfoPort = cluster.getDataNodes().get(0).getInfoPort();
 String jspName = doTail ? "tail.jsp" : "browseDirectory.jsp";
 String fileParamName = doTail ? "filename" : "dir";
 URL url = new URL("http://localhost:" + dnInfoPort + "/" + jspName +
   JspHelper.getUrlParam(fileParamName, URLEncoder.encode(testPath.toString(), "UTF-8"), true) +
   JspHelper.getUrlParam("namenodeInfoPort", Integer.toString(nnHttpAddress.getPort())));
 String viewFilePage = DFSTestUtil.urlGet(url);
 assertTrue("page should show preview of file contents", viewFilePage.contains(FILE_DATA));
 if (!doTail) {
  assertTrue("page should show link to download file", viewFilePage
    .contains("/streamFile" + URIUtil.encodePath(testPath.toString())));
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Create a DatanodeRegistration for a specific block pool.
 * @param nsInfo the namespace info from the first part of the NN handshake
 */
DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) {
 StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID());
 if (storageInfo == null) {
  // it's null in the case of SimulatedDataSet
  storageInfo = new StorageInfo(
    DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION,
    nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(),
    NodeType.DATA_NODE);
 }
 DatanodeID dnId = new DatanodeID(
   streamingAddr.getAddress().getHostAddress(), hostName, 
   storage.getDatanodeUuid(), getXferPort(), getInfoPort(),
     infoSecurePort, getIpcPort());
 return new DatanodeRegistration(dnId, storageInfo, 
   new ExportedBlockKeys(), VersionInfo.getVersion());
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Create a DatanodeRegistration for a specific block pool.
 * @param nsInfo the namespace info from the first part of the NN handshake
 */
DatanodeRegistration createBPRegistration(NamespaceInfo nsInfo) {
 StorageInfo storageInfo = storage.getBPStorage(nsInfo.getBlockPoolID());
 if (storageInfo == null) {
  // it's null in the case of SimulatedDataSet
  storageInfo = new StorageInfo(
    DataNodeLayoutVersion.CURRENT_LAYOUT_VERSION,
    nsInfo.getNamespaceID(), nsInfo.clusterID, nsInfo.getCTime(),
    NodeType.DATA_NODE);
 }
 DatanodeID dnId = new DatanodeID(
   streamingAddr.getAddress().getHostAddress(), hostName, 
   storage.getDatanodeUuid(), getXferPort(), getInfoPort(),
     infoSecurePort, getIpcPort());
 return new DatanodeRegistration(dnId, storageInfo, 
   new ExportedBlockKeys(), VersionInfo.getVersion());
}

相关文章

DataNode类方法