本文整理汇总了Java中org.apache.hadoop.tools.rumen.RackNode类的典型用法代码示例。如果您正苦于以下问题:Java RackNode类的具体用法?Java RackNode怎么用?Java RackNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RackNode类属于org.apache.hadoop.tools.rumen包,在下文中一共展示了RackNode类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startTaskTrackers
import org.apache.hadoop.tools.rumen.RackNode; //导入依赖的package包/类
/**
* Start simulated task trackers based on topology.
* @param clusterStory The cluster topology.
* @param now
* time stamp when the simulator is started, {@link SimulatorTaskTracker}s
* are started shortly after this time stamp
*/
void startTaskTrackers(ClusterStory clusterStory, long now) {
/** port assigned to TTs, incremented by 1 for each TT */
int port = 10000;
long ms = now + 100;
for (MachineNode node : clusterStory.getMachines()) {
String hostname = node.getName();
RackNode rackNode = node.getRackNode();
StaticMapping.addNodeToRack(hostname, rackNode.getName());
String taskTrackerName = "tracker_" + hostname + ":localhost/127.0.0.1:"
+ port;
port++;
SimulatorTaskTracker tt = new SimulatorTaskTracker(jt, taskTrackerName,
hostname, node.getMapSlots(), node.getReduceSlots());
queue.addAll(tt.init(ms++));
}
}
示例2: setStaticMapping
import org.apache.hadoop.tools.rumen.RackNode; //导入依赖的package包/类
static void setStaticMapping(LoggedNetworkTopology topology) {
for (LoggedNetworkTopology rack : topology.getChildren()) {
for (LoggedNetworkTopology node : rack.getChildren()) {
StaticMapping.addNodeToRack(node.getName(),
new RackNode(rack.getName(), 1).getName());
}
}
}