1

In case of HDFS writes how metadata is being updated in Name node. Once client writes the data to the Data nodes. Either Data nodes or HDFS client will update the metadata in Name node.

sidhartha pani
  • 623
  • 2
  • 12
  • 23

1 Answers1

2

The metadata in name node is always updated by the namenode service.

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
  • my question is once Data nodes received the blocks this block information will be updated to Name Node by Data nodes or HDFS client – sidhartha pani Jan 25 '17 at 12:22
  • 1
    DataNode can only receive a block from the client because the NameNode instructed the client to do so. As soon as the DataNode received the block, it will report to the NameNode via a `blockReceived` message. You can see the [datanode protocol](https://github.com/apache/hadoop/blob/master/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/DatanodeProtocol.java) and [BlockManager](https://github.com/apache/hadoop/blob/master/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java) – Remus Rusanu Jan 25 '17 at 12:48