How does CopyFromLocal command for Hadoop DFS work?
Answer»
The CLIENT connects to the name node to register a new file in HDFS.
The name node creates some metadata about the file (either USING the default BLOCK size, or a configured value for the file)
For each block of DATA to be written, the client queries the name node for a block ID and list of destination datanodes to write the data to. Data is then written to each of the datanodes.