-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(core): add the description of version parameter for operator #5144
base: main
Are you sure you want to change the base?
Conversation
why is there no opendal/core/src/types/operator/operator.rs Lines 122 to 133 in d479ac3
|
I believe it's intentional. We don't have guidelines for this. Please feel free to write in your preferred way. |
/// | ||
/// Set `version` for this `stat` request. | ||
/// | ||
/// This feature can be used to retrieve the file metadata that matches a specified version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, the way about discussing version
is a bit confusing to me. Unlike ETag
, Version
is not used for matching. Instead, we request the specified version directly. We will return NotFound
if the requested version does not exist for the given path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about
/// This feature can be used to retrieve the path's metadata of a specific version.
///
/// If the version doesn't exist, an error with kind [`ErrorKind::NotFound`] will be returned.
/// | ||
/// This feature can be used to retrieve the file metadata that matches a specified version. | ||
/// | ||
/// If file exists, but the version doesn't match, an error with kind [`ErrorKind::NotFound`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same.
/// By default, OpenDAL reads a file using the current version. By setting the `version`, OpenDAL will read | ||
/// the file with the specified version. | ||
/// | ||
/// If the file exists, but the version doesn't match, an error with kind [`ErrorKind::NotFound`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same.
/// By default, OpenDAL reads a file using the current version. By setting the `version`, OpenDAL will read | ||
/// the file with the specified version. | ||
/// | ||
/// If the file exists, but the version doesn't match, an error with kind [`ErrorKind::NotFound`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same.
/// If `versioning` is not enabled, a `delete` request will permanently remove the file. | ||
/// | ||
/// when `versioning` is enabled, a simple `delete` request won't permanently remove the file, | ||
/// it can still be accessed using its version. | ||
/// By setting the `version`, OpenDAL will permanently remove the file with the specified version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, it's better not to discuss "permanently delete" here. This behavior is determined by the service itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about
/// Set `version` for this `delete` request.
///
/// remove a specific version of the given path.
///
/// If the version doesn't exist, OpenDAL will not return errors.
@@ -1636,6 +1719,24 @@ impl Operator { | |||
/// # } | |||
/// ``` | |||
/// | |||
/// ## `version` | |||
/// | |||
/// Specify whether to list all object versions or not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior we implemented is "list files along with their versions." Please always remember that OpenDAL's vision is "accessing data freely." We should do our best to distinguish OpenDAL's API from the underlying storage services' implementation details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about
/// ## `version`
///
/// Specify whether to list files along with all their versions or not
///
/// if `version` is not enabled, or is set to false, only the current files will be returned.
///
/// if `version` is set to true, all the file versions will be returned.
/// | ||
/// Specify whether to list all object versions or not | ||
/// | ||
/// if `version` is not set, or is set to false, only the active files with the current version will be returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if
version
is not set, or is set to false,
If version
is not enabled?
/// | ||
/// if `version` is not set, or is set to false, only the active files with the current version will be returned. | ||
/// | ||
/// when `version` is set to true and the backend service has `versioning` enabled, all object versions will be returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As previously discussed, please refrain from disclosing details about backend services.
/// if `version` is not set, or is set to false, only the active files with the current version will be returned. | ||
/// | ||
/// when `version` is set to true and the backend service has `versioning` enabled, all object versions will be returned. | ||
/// if `versioning` is not enabled, an error with kind [`ErrorKind::Unsupported`] will be returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will discuss this at #5145. Generally, I don't want to declare it as part of our public API (or expected behavior).
Which issue does this PR close?
Part of #2611.
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?