Kranthi
Kranthi

Reputation: 117

Hadoop File Copy Native Java API vs WebHDFS

I have a requirement to copy files from HDFS to local. Now, I have 2 options . 1) Either use Hadoop Native Java API (FileSystem) or 2) Use WebHDFS [ I don;t have any issues with enabling it to my cluster]

Can someone let me know what is preferred option and why?

Upvotes: 1

Views: 779

Answers (1)

zsxwing
zsxwing

Reputation: 20826

If you are using Java, I recommend the native Java APIs as it's more flexible and give you more control.

However, WebHDFS is better if you don't want to involve dozens of libraries required by Hadoop. It decouples your application and Hadoop. Of course, you need pay a little performance cost due to HTTP.

Upvotes: 1

Related Questions