erickguan commented on code in PR #7815:
URL: https://github.com/apache/opendal/pull/7815#discussion_r3457211104
##########
core/services/hdfs/src/config.rs:
##########
@@ -45,6 +45,25 @@ pub struct HdfsConfig {
pub enable_append: bool,
/// atomic_write_dir of this backend
pub atomic_write_dir: Option<String>,
+ /// Whether HDFS rename should overwrite an existing target file.
+ ///
+ /// If disabled, rename will fail with `AlreadyExists` when the target
file exists.
+ pub rename_overwrite: bool,
+}
+
+#[allow(deprecated)]
+impl Default for HdfsConfig {
Review Comment:
minor(non-blocking): we probably don't need Default in any of services.
##########
core/services/hdfs/src/core.rs:
##########
@@ -37,10 +38,30 @@ impl Debug for HdfsCore {
f.debug_struct("HdfsCore")
.field("root", &self.root)
.field("atomic_write_dir", &self.atomic_write_dir)
+ .field("rename_overwrite", &self.rename_overwrite)
.finish_non_exhaustive()
}
}
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+enum HdfsRenameTargetAction {
Review Comment:
I would see either we have an enum to raise error on the callsite of
`hdfs_rename_existing_file_action`. Otherwise, is returning `Ok()` enough?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]