How do I use Java to process XML data stream efficiently?

I have massive amount of XML-formatted data coming from TCP connection.  I need to use Java to process it so that it can be further processed by Hadoop. What is the best way to process it efficiently using Java?
condor888Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gurpsbassiCommented:
When you say process it, what exactly do you want to do with it before hadoop gets it?
0
condor888Author Commented:
Hi gurpsbassi, I just want to either convert the XML to Java objects or using Java to store the XML into a database so that Hadoop can continue to process it. Any idea how may I use Java to do that efficiently?
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

gurpsbassiCommented:
Can you not store the files directly into HDFS?
0
condor888Author Commented:
How can I continue to analyze the XML after I store the files to HDFS?
0
gurpsbassiCommented:
Are you needing Hadoop to process this in realtime? or as a batch job?
0
condor888Author Commented:
Either way is fine. So my question is that do I need to use Java to pre-process it before passing it onto Hadoop.
0
gurpsbassiCommented:
Hadoop supports XML inputFormat's.
Once in HFDS you can run map reduce on it.

If you know the XML is valid, there is no need to preprocess it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.