0

I am new to Hadoop and offer apologies if this is a naive question.

I have a compiled jar version of Hadoop program. I want to run that Hadoop program (the compiled jar bundle) in local mode (from a Java program). I have no idea how can I do that. I could not locate a tutorial which talks about this. The situation is exacerbated by the fact that jar of Hadoop program is created at runtime so I can not add the jar to my dependencies and use that. Any help or pointer will be appreciated.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • By "Hadoop program", do you mean Spark, MapReduce, or other? – OneCricketeer Nov 04 '16 at 17:40
  • Map Reduce... sorry for not mentioning this before – Nitin M Tiwari Nov 04 '16 at 17:41
  • Okay, you run that by `hadoop -jar /path/to/file.jar`. You cannot run it from a Java program, as far as I know. – OneCricketeer Nov 04 '16 at 17:42
  • Or maybe you are looking for [this answer](http://stackoverflow.com/questions/9849776/calling-a-mapreduce-job-from-a-simple-java-program/9850096#9850096) – OneCricketeer Nov 04 '16 at 17:42
  • I am not sure if I am right but is it not possible to write a Driver class for handling the job and configuration... more like https://dzone.com/articles/running-hadoop-mapreduce.... Problem is I have generated jar which is generated at runtime... – Nitin M Tiwari Nov 04 '16 at 17:43
  • It's been over a year since I've needed to run any plain mapreduce code, so I can't really remember. As for the Jar at runtime, how are you achieving that? How would you get those classes onto the classpath after compile time? – OneCricketeer Nov 04 '16 at 17:45
  • Thanks for the link above. yes you are right, I am looking for the similar thing but I have jar file and don't have access to individual classes and I want to avoid untar and use process. – Nitin M Tiwari Nov 04 '16 at 17:47
  • I work on a compiler which translates a DSL to hadoop code. So that compiler generates this jar file. All I need is to use that jar file from Java. – Nitin M Tiwari Nov 04 '16 at 17:50

0 Answers0