Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
MapReduce, mail # user - Accessing HDFS


Copy link to this message
-
Accessing HDFS
John Lilley 2013-07-05, 18:10
I've seen mentioned that you can access HDFS via ClientProtocol, as in:
ClientProtocol namenode = DFSClient.createNamenode(conf);
LocatedBlocks lbs = namenode.getBlockLocations(path, start, length);

But we use:
fs = FileSystem.get(URI, conf);
filestatus = fs.getFileStatus(path);
fs.getFileBlockLocations(filestatus, start, length);

As a YARN application and/or DFS client, are there times when I should use the ClientProtocol directly?

Thanks
John