Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7708175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:32:38+00:00 2026-06-01T00:32:38+00:00

what is the difference between calling a mapreduce job from main() and from ToolRunner.run()

  • 0

what is the difference between calling a mapreduce job from main() and from ToolRunner.run()? When we say that the main class say, MapReduce extends Configured implements Tool , what are the additional privileges we get which we do not have if we were to just make a simple run of the job from the main method? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:32:40+00:00Added an answer on June 1, 2026 at 12:32 am

    There’s no extra privileges, but your command line options get run via the GenericOptionsParser, which will allow you extract certain configuration properties and configure a Configuration object from it:

    http://hadoop.apache.org/common/docs/r0.20.2/api/org/apache/hadoop/util/GenericOptionsParser.html

    Basically rather that parsing some options yourself (using the index of the argument in the list), you can explicitly configure Configuration properties from the command line:

    hadoop jar myJar.jar com.Main prop1value prop2value
    
    public static void main(String args[]) {
        Configuration conf = new Configuration();
        conf.set("prop1", args[0]);
        conf.set("prop2", args[1]);
    
        conf.get("prop1"); // will resolve to "prop1Value"
        conf.get("prop2"); // will resolve to "prop2Value"
    }
    

    Becomes much more condensed with ToolRunner:

    hadoop jar myJar.jar com.Main -Dprop1=prop1value -Dprop2=prop2value
    
    public int run(String args[]) {
        Configuration conf = getConf();
    
        conf.get("prop1"); // will resolve to "prop1Value"
        conf.get("prop2"); // will resolve to "prop2Value"
    }
    

    One final word of warning though: when using the Configuration method getConf(), create your Job object first, then pull its Configuration out – the Job constructor makes a copy of the Configruation object passed in, so if you makes changes to the reference passed in, you job will not see those changes:

    public int run(String args[]) {
        Configuration conf = getConf();
    
        conf.set("prop3", "blah");
    
        Job job = new Job(conf); // job will have a deep copy of conf
    
        conf.set("prop4", "dummy"); // here we're amending the original conf
    
        job.getConfiguration().get("prop4"); // will resolve to null
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the difference between two codes? Extends; <?php require_once 'example.class.php'; Class First extends
What is the difference between calling Response.Redirect from the codebehind of a page, versus
Is there any difference between calling len([1,2,3]) or [1,2,3].__len__() ? If there is no
I'm wondering what's the actual difference between calling Thread.Sleep(1) and calling SwitchToThread (if we
In python, is there a difference between calling clear() and assigning {} to a
Given a BehaviorSubject, what is the practical difference between calling all of these different
delegate void DelegateTest(); DelegateTest delTest; Whats the difference between calling delTest.Invoke() and delTest() ?
Will there be a difference between the following two ways of calling a function
What's the difference between clicking on: <a href /> vs. calling window.location.href = ...
Difference between a bus error and a segmentation fault? Can it happen that a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.