|
@@ -51,8 +51,11 @@ import org.apache.hadoop.classification.InterfaceAudience.Private;
|
|
|
import org.apache.hadoop.classification.InterfaceStability.Unstable;
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
import org.apache.hadoop.conf.Configured;
|
|
|
+import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
|
|
|
import org.apache.hadoop.fs.Path;
|
|
|
import org.apache.hadoop.metrics2.source.JvmMetrics;
|
|
|
+import org.apache.hadoop.net.DNSToSwitchMapping;
|
|
|
+import org.apache.hadoop.net.TableMapping;
|
|
|
import org.apache.hadoop.tools.rumen.JobTraceReader;
|
|
|
import org.apache.hadoop.tools.rumen.LoggedJob;
|
|
|
import org.apache.hadoop.tools.rumen.LoggedTask;
|
|
@@ -126,6 +129,7 @@ public class SLSRunner extends Configured implements Tool {
|
|
|
// other simulation information
|
|
|
private int numNMs, numRacks, numAMs, numTasks;
|
|
|
private long maxRuntime;
|
|
|
+ private String tableMapping;
|
|
|
|
|
|
private final static Map<String, Object> simulateInfoMap =
|
|
|
new HashMap<String, Object>();
|
|
@@ -231,7 +235,7 @@ public class SLSRunner extends Configured implements Tool {
|
|
|
this.trackedApps = trackApps;
|
|
|
this.printSimulation = printsimulation;
|
|
|
metricsOutputDir = outDir;
|
|
|
-
|
|
|
+ tableMapping = outDir + "/tableMapping.csv";
|
|
|
}
|
|
|
|
|
|
public void start() throws IOException, ClassNotFoundException, YarnException,
|
|
@@ -272,7 +276,12 @@ public class SLSRunner extends Configured implements Tool {
|
|
|
// TODO add support for FifoScheduler
|
|
|
throw new YarnException("Fifo Scheduler is not supported yet.");
|
|
|
}
|
|
|
-
|
|
|
+ rmConf.setClass(
|
|
|
+ CommonConfigurationKeysPublic.NET_TOPOLOGY_NODE_SWITCH_MAPPING_IMPL_KEY,
|
|
|
+ TableMapping.class, DNSToSwitchMapping.class);
|
|
|
+ rmConf.set(
|
|
|
+ CommonConfigurationKeysPublic.NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY,
|
|
|
+ tableMapping);
|
|
|
rmConf.set(SLSConfiguration.METRICS_OUTPUT_DIR, metricsOutputDir);
|
|
|
|
|
|
final SLSRunner se = this;
|
|
@@ -332,6 +341,8 @@ public class SLSRunner extends Configured implements Tool {
|
|
|
throw new YarnException("No node! Please configure nodes.");
|
|
|
}
|
|
|
|
|
|
+ SLSUtils.generateNodeTableMapping(nodeSet, tableMapping);
|
|
|
+
|
|
|
// create NM simulators
|
|
|
Random random = new Random();
|
|
|
Set<String> rackSet = new ConcurrentHashSet<>();
|