-2

I want to run my program in MapReduce by these conditions:

  • Main Function exists in Package1,
  • Class1 and Class2 exist in Package2,
  • Class3 and Class4 exist in Package3.

I want to run the program under mapreduce. How can I run Main function, while I have 3 Packages?

arghtype
  • 4,376
  • 11
  • 45
  • 60

2 Answers2

0

You can use any built tool like maven, ant etc. Or you can built it on your own using terminal but then be aware about the dependency of your class.

A jar file have multiple package and it will work in a similar fashion as single package jar works. When you will submit the job use

hadoop jar nameofjarfile nameofpackage.nameofclass(having main method) inputpath outputpath

siddhartha jain
  • 1,006
  • 10
  • 16
  • Thanks , there are dependency between packages and classes. Is there any example for this . I use Terminal for producing Jar file . – Mostafa.Hosseini Feb 17 '17 at 09:14
0

If you are looking out for examples you can just go through the links, as they tried to achieve the same thing.

How to run a jar file in hadoop?

Compiling hadoop java files

This should clear all the doubts.

Community
  • 1
  • 1
Deepan Ram
  • 842
  • 1
  • 10
  • 25
  • try to avoid link-only answers, as they may become invalid once the links get broken. Instead, you can provide those links along with the core of the solution that they give. – vefthym Feb 23 '17 at 10:15