When data is stored in datanode, then the metadata of that data will be stored in the Namenode. So Namenode will identify if the data node is full.