Which describes how a client reads a file from HDFS?

0 votes
asked Aug 10, 2016 in CCD 410 Cloudera Certified Developer for Apache Hadoop (CCDH) by John Hayes (470 points)
retagged Aug 14, 2016 by admin
A. The client queries the NameNode for the block location(s). The NameNode returns the block
location(s) to the client. The client reads the data directory off the DataNode(s).

B. The client queries all DataNodes in parallel. The DataNode that contains the requested data
responds directly to the client. The client reads the data directly off the DataNode.

C. The client contacts the NameNode for the block location(s). The NameNode then queries the
DataNodes for block locations. The DataNodes respond to the NameNode, and the NameNode
redirects the client to the DataNode that holds the requested data block(s). The client then reads the
data directly off the DataNode.

D. The client contacts the NameNode for the block location(s). The NameNode contacts the
DataNode that holds the requested data block. Data is transferred from the DataNode to the
NameNode, and then from the NameNode to the client.

1 Answer

0 votes
answered Aug 10, 2016 by Sandra Reeds (1,040 points)
edited Aug 10, 2016 by Sandra Reeds

Answer

C. The client contacts the NameNode for the block location(s). The NameNode then queries the
DataNodes for block locations. The DataNodes respond to the NameNode, and the NameNode
redirects the client to the DataNode that holds the requested data block(s). The client then reads the
data directly off the DataNode.

Explanation:
The Client communication to HDFS happens using Hadoop HDFS API. Client applications talk to the NameNode whenever they wish to locate a file, or when they want to add/ copy/ move/ delete a file on HDFS.

The NameNode responds the successful requests by returning a list of relevant DataNode servers where the data lives. Client applications can talk directly to a DataNode, once the NameNode has provided the location of the data.

Reference:
24 Interview Questions & Answers for Hadoop MapReduce developers, How the Client
communicates with HDFS?

Most active Members
this month:
    Gute Mathe-Fragen - Bestes Mathe-Forum
    ...