-
Notifications
You must be signed in to change notification settings - Fork 537
HDDS-8278. O3fs/ofs to support setTimes() API #4720
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
Conversation
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.
@jojochuang Thanks working over this, looks good to me, have few minor query, please check.
...one-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
Outdated
Show resolved
Hide resolved
void apply(OmKeyInfo omKeyInfo, long trxnLogIndex) { | ||
// No need to check not null here, this will be never called with null. | ||
long mtime = getModificationTime(); | ||
if (mtime != -1) { |
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.
We should do some validation for mtime, like value should be greater than "0"
Do we have any range of mtime validation which can be set ?
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 -1 has a special meaning according to Hadoop setTimes() API javadoc:
/**
- Set access time of a file.
- @param p The path
- @param mtime Set the modification time of this file.
-
The number of milliseconds since Jan 1, 1970.
-
A value of -1 means that this call should not set modification time.
- @param atime Set the access time of this file.
-
The number of milliseconds since Jan 1, 1970.
-
A value of -1 means that this call should not set access time.
- @throws IOException IO failure
*/
public void setTimes(Path p, long mtime, long atime
) throws IOException {
}
But yes in general we should add a guardrail around it.
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.
minor comments, rest lgtm
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeySetTimesRequest.java
Outdated
Show resolved
Hide resolved
...one-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/utils/OzoneManagerRatisUtils.java
Outdated
Show resolved
Hide resolved
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeySetTimesRequest.java
Outdated
Show resolved
Hide resolved
...ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeySetTimesRequest.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocol/OzoneManagerProtocol.java
Show resolved
Hide resolved
...ager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeySetTimesResponseWithFSO.java
Show resolved
Hide resolved
...ager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeySetTimesResponseWithFSO.java
Outdated
Show resolved
Hide resolved
...one/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
Outdated
Show resolved
Hide resolved
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
Show resolved
Hide resolved
...onefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
Outdated
Show resolved
Hide resolved
TODO: need tests Change-Id: I3fe42a93995e344aa0f55c6fb08319d2bd066355
Change-Id: I0b879ff955c79a6cb95e105c27db2565a398e80e
Change-Id: I0e897cf83c43f5682242eaa8c46ad7290031aca7
Change-Id: I405462009f46a91045f6a92cd0a8f8f556ed79b6
Change-Id: I9f02fc2ad3ae37076fd357921aa9c4db8247dd6e
Change-Id: I3065d57a535727ca47c73477af5a5c4711e6743b
Change-Id: I58e72ce60ee70d3ed4f4d44ebe743aff3a63cafa
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.
LGTM
Change-Id: I21f36c2abc317cbfc686c67753f47eaf03af9a58
Change-Id: I5ffd49999775eee75964cf7cb2456e448f037561
Change-Id: Ie1842a21ebd3abf849cd31f751b31f64dbb2f17e
Thanks Ayush. This is merged. |
@@ -1364,4 +1364,12 @@ public boolean recoverLease(final Path f) throws IOException { | |||
return ozoneClient.getProxy().getOzoneManagerClient().recoverLease( | |||
volume.getName(), bucket.getName(), ofsPath.getKeyName()); | |||
} | |||
|
|||
public void setTimes(String key, long mtime, long atime) throws IOException { |
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.
Does this method need to add Override @jojochuang
What changes were proposed in this pull request?
Support FileSystem.setTimes() API
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8278
How was this patch tested?
Unit tests and file system integration tests.