本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例5: setNetworkLocation
import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
/** Sets the network location */
public synchronized void setNetworkLocation(String location) {
this.location = NodeBase.normalize(location);
}
示例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);
}
示例7: setNetworkLocation
import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
/** Sets the rack name */
public synchronized void setNetworkLocation(String location) {
this.location = NodeBase.normalize(location);
}
示例8: setNetworkLocation
import org.apache.hadoop.net.NodeBase; //导入方法依赖的package包/类
/**
* Sets the rack name
*/
public synchronized void setNetworkLocation(String location) {
this.location = NodeBase.normalize(location);
}