You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 04:28:24 UTC
svn commit: r1076988 - in
/hadoop/common/branches/branch-0.20-security-patches/src:
docs/src/documentation/content/xdocs/ mapred/
mapred/org/apache/hadoop/mapred/
Author: omalley
Date: Fri Mar 4 03:28:24 2011
New Revision: 1076988
URL: http://svn.apache.org/viewvc?rev=1076988&view=rev
Log:
commit 4ccd5a69d27d29a536ecf6ff5fc3327d7f459784
Author: Yahoo\! <lt...@yahoo-inc.com>
Date: Tue Aug 25 09:33:35 2009 -0700
Add MAPREDUCE-768 from patch http://issues.apache.org/jira/secure/attachment/12417616/MAPREDUCE-768-ydist.patch
Modified:
hadoop/common/branches/branch-0.20-security-patches/src/docs/src/documentation/content/xdocs/commands_manual.xml
hadoop/common/branches/branch-0.20-security-patches/src/mapred/mapred-default.xml
hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java
hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java
Modified: hadoop/common/branches/branch-0.20-security-patches/src/docs/src/documentation/content/xdocs/commands_manual.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/docs/src/documentation/content/xdocs/commands_manual.xml?rev=1076988&r1=1076987&r2=1076988&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/docs/src/documentation/content/xdocs/commands_manual.xml (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/docs/src/documentation/content/xdocs/commands_manual.xml Fri Mar 4 03:28:24 2011
@@ -577,15 +577,23 @@
</tr>
</table>
</section>
- <section>
- <title> jobtracker </title>
- <p>
- Runs the MapReduce job Tracker node.
- </p>
- <p>
- <code>Usage: hadoop jobtracker</code>
- </p>
- </section>
+ <section>
+ <title> jobtracker </title>
+ <p>Runs the MapReduce job Tracker node.</p>
+ <p><code>Usage: hadoop jobtracker [-dumpConfiguration]</code></p>
+ <table>
+ <tr>
+ <th>COMMAND_OPTION</th><th> Description</th>
+ </tr>
+ <tr>
+ <td><code>-dumpConfiguration</code></td>
+ <td> Dumps the configuration used by the JobTracker alongwith queue
+ configuration in JSON format into Standard output used by the
+ jobtracker and exits.</td>
+ </tr>
+ </table>
+
+ </section>
<section>
<title> namenode </title>
Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/mapred-default.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/mapred-default.xml?rev=1076988&r1=1076987&r2=1076988&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/mapred-default.xml (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/mapred-default.xml Fri Mar 4 03:28:24 2011
@@ -818,33 +818,6 @@
</property>
<property>
- <name>mapred.queue.names</name>
- <value>default</value>
- <description> Comma separated list of queues configured for this jobtracker.
- Jobs are added to queues and schedulers can configure different
- scheduling properties for the various queues. To configure a property
- for a queue, the name of the queue must match the name specified in this
- value. Queue properties that are common to all schedulers are configured
- here with the naming convention, mapred.queue.$QUEUE-NAME.$PROPERTY-NAME,
- for e.g. mapred.queue.default.submit-job-acl.
- The number of queues configured in this parameter could depend on the
- type of scheduler being used, as specified in
- mapred.jobtracker.taskScheduler. For example, the JobQueueTaskScheduler
- supports only a single queue, which is the default configured here.
- Before adding more queues, ensure that the scheduler you've configured
- supports multiple queues.
- </description>
-</property>
-
-<property>
- <name>mapred.acls.enabled</name>
- <value>false</value>
- <description> Specifies whether ACLs are enabled, and should be checked
- for various operations.
- </description>
-</property>
-
-<property>
<name>mapred.job.queue.name</name>
<value>default</value>
<description> Queue to which a job is submitted. This must match one of the
Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=1076988&r1=1076987&r2=1076988&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java Fri Mar 4 03:28:24 2011
@@ -24,8 +24,10 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
+import java.io.Writer;
import java.net.BindException;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
@@ -4246,19 +4248,38 @@ public class JobTracker implements MRCon
public static void main(String argv[]
) throws IOException, InterruptedException {
StringUtils.startupShutdownMessage(JobTracker.class, argv, LOG);
- if (argv.length != 0) {
- System.out.println("usage: JobTracker");
- System.exit(-1);
- }
-
+
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) {
LOG.fatal(StringUtils.stringifyException(e));
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
public JobQueueInfo[] getQueues() throws IOException {
Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java?rev=1076988&r1=1076987&r2=1076988&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/QueueManager.java Fri Mar 4 03:28:24 2011
@@ -19,6 +19,8 @@
package org.apache.hadoop.mapred;
import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Writer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
@@ -364,4 +366,18 @@ class QueueManager {
queueAclsInfolist.size()]);
}
+ /**
+ * prints the configuration of QueueManager in Json format.
+ * The method should be modified accordingly whenever
+ * QueueManager(Configuration) constructor is modified.
+ * @param writer {@link}Writer object to which the configuration properties
+ * are printed in json format
+ * @throws IOException
+ */
+ static void dumpConfiguration(Writer writer) throws IOException {
+ Configuration conf = new Configuration(false);
+ conf.addResource(QUEUE_ACLS_FILE_NAME);
+ Configuration.dumpConfiguration(conf, writer);
+ }
+
}