hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x...@apache.org
Subject hadoop git commit: HDDS-403. Fix createdOn and modifiedOn timestamp for volume, bucket, key. Contributed by Dinesh Chitlangia.
Date Mon, 10 Sep 2018 15:49:38 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 1eef0acfe -> 8fe4062bf


HDDS-403. Fix createdOn and modifiedOn timestamp for volume, bucket, key. Contributed by Dinesh
Chitlangia.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8fe4062b
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8fe4062b
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8fe4062b

Branch: refs/heads/trunk
Commit: 8fe4062bfc20ee181106eb68635d3404c50c9238
Parents: 1eef0ac
Author: Xiaoyu Yao <xyao@apache.org>
Authored: Mon Sep 10 08:45:49 2018 -0700
Committer: Xiaoyu Yao <xyao@apache.org>
Committed: Mon Sep 10 08:45:49 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java  | 4 ++--
 .../src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8fe4062b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
index a6813eb..9c59038 100644
--- a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
+++ b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/client/HddsClientUtils.java
@@ -74,7 +74,7 @@ public final class HddsClientUtils {
    */
   public static String formatDateTime(long millis) {
     ZonedDateTime dateTime = ZonedDateTime.ofInstant(
-        Instant.ofEpochSecond(millis), DATE_FORMAT.get().getZone());
+        Instant.ofEpochMilli(millis), DATE_FORMAT.get().getZone());
     return DATE_FORMAT.get().format(dateTime);
   }
 
@@ -85,7 +85,7 @@ public final class HddsClientUtils {
   public static long formatDateTime(String date) throws ParseException {
     Preconditions.checkNotNull(date, "Date string should not be null.");
     return ZonedDateTime.parse(date, DATE_FORMAT.get())
-        .toInstant().getEpochSecond();
+        .toInstant().toEpochMilli();
   }
 
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8fe4062b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
index d21e5c5..5cf869e 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
@@ -250,8 +250,8 @@ public class KeyManagerImpl implements KeyManager {
             .setKeyName(args.getKeyName())
             .setOmKeyLocationInfos(Collections.singletonList(
                 new OmKeyLocationInfoGroup(0, locations)))
-            .setCreationTime(currentTime)
-            .setModificationTime(currentTime)
+            .setCreationTime(Time.now())
+            .setModificationTime(Time.now())
             .setDataSize(size)
             .setReplicationType(type)
             .setReplicationFactor(factor)


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message