当前位置: 首页>>代码示例>>Java>>正文


Java NodeBase.normalize方法代码示例

本文整理汇总了Java中org.apache.hadoop.net.NodeBase.normalize方法的典型用法代码示例。如果您正苦于以下问题:Java NodeBase.normalize方法的具体用法?Java NodeBase.normalize怎么用?Java NodeBase.normalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.net.NodeBase的用法示例。


在下文中一共展示了NodeBase.normalize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveAndGetNode

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
private Node resolveAndGetNode(String name) {
  List <String> rNameList = dnsToSwitchMapping.resolve(Arrays.asList(new String [] {name}));
  String networkLoc = NodeBase.normalize(rNameList.get(0));
  Node node = null;

  // we depend on clusterMap to get a canonical node object
  // we synchronize this section to guarantee that two concurrent
  // insertions into the clusterMap don't happen (resulting in
  // multiple copies of the same node being created and returned)
  synchronized (clusterMap) {
    while ((node = clusterMap.getNode(networkLoc+"/"+name)) == null) {
      clusterMap.add(new NodeBase(name, networkLoc));
    }
  }

  return node;
}
 
开发者ID:iVCE,项目名称:RDFS,代码行数:18,代码来源:TopologyCache.java

示例2: resolveAndAddToTopology

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
public Node resolveAndAddToTopology(String name) {
  List <String> tmpList = new ArrayList<String>(1);
  tmpList.add(name);
  List <String> rNameList = dnsToSwitchMapping.resolve(tmpList);
  String rName = null;
  if (rNameList == null || rNameList.get(0) == null) {
    rName = NetworkTopology.DEFAULT_RACK;
    LOG.warn("Couldn't resolve " + name + ". Falling back to "
        + NetworkTopology.DEFAULT_RACK);
  } else {
    rName = rNameList.get(0);
  }
  String networkLoc = NodeBase.normalize(rName);
  return addHostToNodeMapping(name, networkLoc);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:16,代码来源:JobTracker.java

示例3: resolveAndAddToTopology

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
public Node resolveAndAddToTopology(String name) {
  List <String> tmpList = new ArrayList<String>(1);
  tmpList.add(name);
  List <String> rNameList = dnsToSwitchMapping.resolve(tmpList);
  String rName = rNameList.get(0);
  String networkLoc = NodeBase.normalize(rName);
  return addHostToNodeMapping(name, networkLoc);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:9,代码来源:JobTracker.java

示例4: resolveAndAddToTopology

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
public Node resolveAndAddToTopology(String name) throws UnknownHostException {
  List <String> tmpList = new ArrayList<String>(1);
  tmpList.add(name);
  List <String> rNameList = dnsToSwitchMapping.resolve(tmpList);
  String rName = rNameList.get(0);
  String networkLoc = NodeBase.normalize(rName);
  return addHostToNodeMapping(name, networkLoc);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:9,代码来源:JobTracker.java

示例5: setNetworkLocation

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
/** Sets the network location */
public synchronized void setNetworkLocation(String location) {
  this.location = NodeBase.normalize(location);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:DatanodeInfo.java

示例6: setNetworkLocation

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
/** Sets the network location */
@Override
public synchronized void setNetworkLocation(String location) {
  this.location = NodeBase.normalize(location);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:6,代码来源:DatanodeInfo.java

示例7: setNetworkLocation

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
/** Sets the rack name */
public synchronized void setNetworkLocation(String location) {
  this.location = NodeBase.normalize(location);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:5,代码来源:DatanodeInfo.java

示例8: setNetworkLocation

import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
/**
 * Sets the rack name
 */
public synchronized void setNetworkLocation(String location) {
  this.location = NodeBase.normalize(location);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:7,代码来源:DatanodeInfo.java


注:本文中的org.apache.hadoop.net.NodeBase.normalize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。