|
@@ -24,8 +24,10 @@ import java.io.File;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileInputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.io.PrintWriter;
|
|
import java.io.InputStreamReader;
|
|
import java.io.InputStreamReader;
|
|
import java.io.OutputStreamWriter;
|
|
import java.io.OutputStreamWriter;
|
|
|
|
+import java.io.Writer;
|
|
import java.net.BindException;
|
|
import java.net.BindException;
|
|
import java.net.InetSocketAddress;
|
|
import java.net.InetSocketAddress;
|
|
import java.net.UnknownHostException;
|
|
import java.net.UnknownHostException;
|
|
@@ -4246,19 +4248,38 @@ public class JobTracker implements MRConstants, InterTrackerProtocol,
|
|
public static void main(String argv[]
|
|
public static void main(String argv[]
|
|
) throws IOException, InterruptedException {
|
|
) throws IOException, InterruptedException {
|
|
StringUtils.startupShutdownMessage(JobTracker.class, argv, LOG);
|
|
StringUtils.startupShutdownMessage(JobTracker.class, argv, LOG);
|
|
- if (argv.length != 0) {
|
|
|
|
- System.out.println("usage: JobTracker");
|
|
|
|
- System.exit(-1);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
try {
|
|
try {
|
|
- JobTracker tracker = startTracker(new JobConf());
|
|
|
|
- tracker.offerService();
|
|
|
|
|
|
+ if(argv.length == 0) {
|
|
|
|
+ JobTracker tracker = startTracker(new JobConf());
|
|
|
|
+ tracker.offerService();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ if ("-dumpConfiguration".equals(argv[0]) && argv.length == 1) {
|
|
|
|
+ dumpConfiguration(new PrintWriter(System.out));
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ System.out.println("usage: JobTracker [-dumpConfiguration]");
|
|
|
|
+ System.exit(-1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} catch (Throwable e) {
|
|
} catch (Throwable e) {
|
|
LOG.fatal(StringUtils.stringifyException(e));
|
|
LOG.fatal(StringUtils.stringifyException(e));
|
|
System.exit(-1);
|
|
System.exit(-1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ /**
|
|
|
|
+ * Dumps the configuration properties in Json format
|
|
|
|
+ * @param writer {@link}Writer object to which the output is written
|
|
|
|
+ * @throws IOException
|
|
|
|
+ */
|
|
|
|
+ private static void dumpConfiguration(Writer writer) throws IOException {
|
|
|
|
+ Configuration.dumpConfiguration(new JobConf(), writer);
|
|
|
|
+ writer.write("\n");
|
|
|
|
+ // get the QueueManager configuration properties
|
|
|
|
+ QueueManager.dumpConfiguration(writer);
|
|
|
|
+ writer.write("\n");
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public JobQueueInfo[] getQueues() throws IOException {
|
|
public JobQueueInfo[] getQueues() throws IOException {
|