0 votes
in HDFS by
Does HDFS allow a client to read a file which is already opened for writing?

1 Answer

0 votes
by

Basically, the intent of asking this question is to know about the constraints associated with reading a file which is currently being written by some client. You may answer this question in following manner:

Yes, one can read the file which is already opened. But, the problem in reading a file which is currently being written lies in the consistency of the data i.e. HDFS does not provide the surety that the data which has been written into the file will be visible to a new reader before the file has been closed. For this, one can call the hflush operation explicitly which will push all the data in the buffer into the write pipeline and then the hflush operation will wait for the acknowledgements from the DataNodes. Hence, by doing this the data that has been written into the file before the hflush operation will be visible to the readers for sure.   

Related questions

+1 vote
asked Jun 27, 2021 in HDFS by Robindeniel
0 votes
asked Jun 8, 2020 in HDFS by Robindeniel
...