Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Use of java generics in hadoop map reduce jobs?

Solved Go to solution

Use of java generics in hadoop map reduce jobs?

New Contributor

How often we use java generics in map reduce jobs.Your inputs is highly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Use of java generics in hadoop map reduce jobs?

Mentor

In 3 years of writing mapreduce code,i only needed to use generics once. That's not to say it's not useful, it's pretty powerful when you are dealing with objects that have various types. In my case it was a mapreduce program running against HBase, I would extract payload and within it, I had to figure out what was the value type.

3 REPLIES 3

Re: Use of java generics in hadoop map reduce jobs?

You mean the normal Java Generics?

https://en.wikipedia.org/wiki/Generics_in_Java

Like ArrayList<String>() Generics?

In that case I am pretty sure almost every MapReduce job out there uses it. MapReduce can run any Java code that can be executed by the JVM currently in HDP its Java8. So if you want to use Lambda functions you could as well. And Generics have been around forever so I would hope any well written library uses them.

Re: Use of java generics in hadoop map reduce jobs?

Mentor

In 3 years of writing mapreduce code,i only needed to use generics once. That's not to say it's not useful, it's pretty powerful when you are dealing with objects that have various types. In my case it was a mapreduce program running against HBase, I would extract payload and within it, I had to figure out what was the value type.

Re: Use of java generics in hadoop map reduce jobs?

Hmmm I suppose it depends how you see the question. Pretty sure everybody uses generics but you are right I haven't implemented a generic class myself in a MapReduce job before. Pretty sure a lot of libraries do it but yourself during coding. Not really. I think the reason for the question might help.

Don't have an account?
Coming from Hortonworks? Activate your account here