當前位置: 首頁>>代碼示例>>Java>>正文


Java RackNode類代碼示例

本文整理匯總了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++));
  }
}
 
開發者ID:rhli,項目名稱:hadoop-EAR,代碼行數:25,代碼來源:SimulatorEngine.java

示例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());
    }
  }
}
 
開發者ID:rekhajoshm,項目名稱:mapreduce-fork,代碼行數:9,代碼來源:SimulatorEngine.java


注:本文中的org.apache.hadoop.tools.rumen.RackNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。