hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [47/50] [abbrv] hadoop git commit: HADOOP-15831. Include modificationTime in the toString method of CopyListingFileStatus. Contributed by Ted Yu.
Date Fri, 12 Oct 2018 12:29:04 GMT
HADOOP-15831. Include modificationTime in the toString method of CopyListingFileStatus.
Contributed by Ted Yu.


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

Branch: refs/heads/HDFS-13891
Commit: e36ae9639fa7ac87b05a3860517c23082cf76791
Parents: 5da0422
Author: Steve Loughran <stevel@apache.org>
Authored: Fri Oct 12 09:59:19 2018 +0100
Committer: Steve Loughran <stevel@apache.org>
Committed: Fri Oct 12 09:59:19 2018 +0100

----------------------------------------------------------------------
 .../org/apache/hadoop/tools/CopyListingFileStatus.java    |  3 ++-
 .../apache/hadoop/tools/TestCopyListingFileStatus.java    | 10 ++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e36ae963/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/CopyListingFileStatus.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/CopyListingFileStatus.java
b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/CopyListingFileStatus.java
index e01a6b1..e8e5ed8 100644
--- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/CopyListingFileStatus.java
+++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/CopyListingFileStatus.java
@@ -405,10 +405,11 @@ public final class CopyListingFileStatus implements Writable {
   public String toString() {
     StringBuilder sb = new StringBuilder(super.toString());
     sb.append('{');
-    sb.append(this.getPath().toString());
+    sb.append(this.getPath() == null ? "" : this.getPath().toString());
     sb.append(" length = ").append(this.getLen());
     sb.append(" aclEntries = ").append(aclEntries);
     sb.append(", xAttrs = ").append(xAttrs);
+    sb.append(", modTime = ").append(modificationTime);
     if (isSplit()) {
       sb.append(", chunkOffset = ").append(this.getChunkOffset());
       sb.append(", chunkLength = ").append(this.getChunkLength());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e36ae963/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestCopyListingFileStatus.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestCopyListingFileStatus.java
b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestCopyListingFileStatus.java
index 8efc5cf..f665627 100644
--- a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestCopyListingFileStatus.java
+++ b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestCopyListingFileStatus.java
@@ -32,6 +32,16 @@ import static org.junit.Assert.assertEquals;
 public class TestCopyListingFileStatus {
 
   @Test
+  public void testToString() {
+    CopyListingFileStatus src = new CopyListingFileStatus(
+        4344L, false, 2, 512 << 20, 1234L, 5678L, new FsPermission((short)0512),
+        "dingo", "yaks", new Path("hdfs://localhost:4344"));
+    src.toString();
+    src = new CopyListingFileStatus();
+    src.toString();
+  }
+
+  @Test
   public void testCopyListingFileStatusSerialization() throws Exception {
     CopyListingFileStatus src = new CopyListingFileStatus(
         4344L, false, 2, 512 << 20, 1234L, 5678L, new FsPermission((short)0512),


---------------------------------------------------------------------
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