https://opendal.apache.org/ logo
HDFS | Apache OpenDAL
# general
s
Hi, I am writing a large file to hdfs using OpenDAL. While the file is still being written from the rust application, the partially written file starts showing up on
hadoop dfs -ls /
I want the file to only show up once the write is complete. Alternatively, I tried writing to a temp file and renaming it later. But Hadoop API fails as it does not support renaming. But the docs show that renaming is supported - https://opendal.apache.org/docs/services/hdfs Can someone please help on this ?
x
Thanks for report.
Seems it's better for us to implement rename for hdfs.
And add
atomic_write_dir
support for hdfs like what we do for
fs
.
Would you like to submit an issue for this feature?
s
Sure, but I would need a reference. Can you please point me to a storage that supports atomic writes. I tested write for
fs
but that also does not support atomic writes. I tested local fs and the partially written file started showing up on
ls
. fs has support for rename though
x
Correct: Submit an issue is enough.
atomic_write_dir is a dir that fs will write into this dir first and rename to real path after write finished.
s
I see. Please advise on the next steps. Should I create issues for supporting rename on hdfs and atomic write support ?
Or is there some API to check if the file write is complete? Even if the writes are partial I can include that check in the read path to only start reading a file if the file is complete
x
Yep, we think they are two different feature. We can implement rename API first and than add atomic write.
No, I don't think hdfs can work in this way.
s
Thank you! Let me create two separate issues in that case.
x
correct: rename has already been supported.
> But Hadoop API fails as it does not support renaming. This could be a bug, please attach your loggings about the error message so that we can dig into it
s
Sure
x
Let's track this on github.