hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhema...@apache.org
Subject svn commit: r807640 - in /hadoop/mapreduce/trunk: CHANGES.txt src/docs/src/documentation/content/xdocs/commands_manual.xml src/java/mapred-default.xml src/java/org/apache/hadoop/mapred/JobTracker.java src/java/org/apache/hadoop/mapred/QueueManager.java
Date Tue, 25 Aug 2009 14:08:54 GMT
Author: yhemanth
Date: Tue Aug 25 14:08:54 2009
New Revision: 807640

URL: http://svn.apache.org/viewvc?rev=807640&view=rev
Log:
MAPREDUCE-768. Provide an option to dump jobtracker configuration in JSON format to standard
output. Contributed by V.V.Chaitanya Krishna.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/docs/src/documentation/content/xdocs/commands_manual.xml
    hadoop/mapreduce/trunk/src/java/mapred-default.xml
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=807640&r1=807639&r2=807640&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Tue Aug 25 14:08:54 2009
@@ -75,6 +75,9 @@
     MAPREDUCE-798. MRUnit should be able to test a succession of MapReduce
     passes. (Aaron Kimball via tomwhite)
 
+    MAPREDUCE-768. Provide an option to dump jobtracker configuration in JSON
+    format to standard output. (V.V.Chaitanya Krishna via yhemanth)
+
   IMPROVEMENTS
 
     MAPREDUCE-816. Rename "local" mysql import to "direct" in Sqoop.

Modified: hadoop/mapreduce/trunk/src/docs/src/documentation/content/xdocs/commands_manual.xml
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/docs/src/documentation/content/xdocs/commands_manual.xml?rev=807640&r1=807639&r2=807640&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/docs/src/documentation/content/xdocs/commands_manual.xml (original)
+++ hadoop/mapreduce/trunk/src/docs/src/documentation/content/xdocs/commands_manual.xml Tue
Aug 25 14:08:54 2009
@@ -596,8 +596,20 @@
 					Runs the MapReduce job Tracker node.
 				</p> 
 				<p>
-					<code>Usage: hadoop jobtracker</code>
-				</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>

Modified: hadoop/mapreduce/trunk/src/java/mapred-default.xml
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/mapred-default.xml?rev=807640&r1=807639&r2=807640&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/mapred-default.xml (original)
+++ hadoop/mapreduce/trunk/src/java/mapred-default.xml Tue Aug 25 14:08:54 2009
@@ -896,33 +896,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/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?rev=807640&r1=807639&r2=807640&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Tue Aug 25 14:08:54
2009
@@ -20,7 +20,9 @@
 
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.io.UnsupportedEncodingException;
+import java.io.Writer;
 import java.net.BindException;
 import java.net.InetSocketAddress;
 import java.net.URLEncoder;
@@ -4128,20 +4130,40 @@
   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 {
     return queueManager.getJobQueueInfos();

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java?rev=807640&r1=807639&r2=807640&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/QueueManager.java Tue Aug 25
14:08:54 2009
@@ -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.Iterator;
@@ -440,4 +442,18 @@
       this.queues.put(queue.getName(), queue);
     }
   }
+
+  /**
+   * 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_CONF_FILE_NAME);
+    Configuration.dumpConfiguration(conf, writer);
+  }
 }



Mime
View raw message