xiaoyuyao commented on a change in pull request #164:
URL: https://github.com/apache/hadoop-ozone/pull/164#discussion_r439123458
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java
##########
@@ -103,21 +106,52 @@ public OzoneVolume(ConfigurationSource conf,
ClientProtocol proxy,
this.acls = acls;
this.listCacheSize = HddsClientUtils.getListCacheSize(conf);
this.metadata = metadata;
+ long modifiedTime = Time.now();
+ if (modifiedTime < creationTime) {
+ this.modificationTime = Instant.ofEpochMilli(creationTime);
+ } else {
+ this.modificationTime = Instant.ofEpochMilli(modifiedTime);
+ }
+ }
+
+ /**
+ * @param modificationTime modification time of the volume.
+ */
+ @SuppressWarnings("parameternumber")
+ public OzoneVolume(ConfigurationSource conf, ClientProtocol proxy,
+ String name, String admin, String owner, long quotaInBytes,
+ long creationTime, long modificationTime, List<OzoneAcl> acls,
+ Map<String, String> metadata) {
+ this(conf, proxy, name, admin, owner, quotaInBytes,
+ creationTime, acls, metadata);
+ this.modificationTime = Instant.ofEpochMilli(modificationTime);
}
@SuppressWarnings("parameternumber")
public OzoneVolume(ConfigurationSource conf, ClientProtocol proxy,
- String name,
- String admin, String owner, long quotaInBytes,
+ String name, String admin, String owner, long quotaInBytes,
long creationTime, List<OzoneAcl> acls) {
this(conf, proxy, name, admin, owner, quotaInBytes, creationTime, acls,
new HashMap<>());
+ long modifiedTime = Time.now();
Review comment:
similar as above to avoid Time.now()
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneVolume.java
##########
@@ -126,6 +160,20 @@ protected OzoneVolume(String name, String admin, String
owner,
this.creationTime = Instant.ofEpochMilli(creationTime);
this.acls = acls;
this.metadata = new HashMap<>();
+ long modifiedTime = Time.now();
Review comment:
similar as above to avoid Time.now()
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]