HADOOP-15831. Include modificationTime in the toString method of CopyListingFileStatus.
Contributed by Ted Yu.
This commit is contained in:
parent
5da042227c
commit
e36ae9639f
|
@ -405,10 +405,11 @@ public final class CopyListingFileStatus implements Writable {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder(super.toString());
|
StringBuilder sb = new StringBuilder(super.toString());
|
||||||
sb.append('{');
|
sb.append('{');
|
||||||
sb.append(this.getPath().toString());
|
sb.append(this.getPath() == null ? "" : this.getPath().toString());
|
||||||
sb.append(" length = ").append(this.getLen());
|
sb.append(" length = ").append(this.getLen());
|
||||||
sb.append(" aclEntries = ").append(aclEntries);
|
sb.append(" aclEntries = ").append(aclEntries);
|
||||||
sb.append(", xAttrs = ").append(xAttrs);
|
sb.append(", xAttrs = ").append(xAttrs);
|
||||||
|
sb.append(", modTime = ").append(modificationTime);
|
||||||
if (isSplit()) {
|
if (isSplit()) {
|
||||||
sb.append(", chunkOffset = ").append(this.getChunkOffset());
|
sb.append(", chunkOffset = ").append(this.getChunkOffset());
|
||||||
sb.append(", chunkLength = ").append(this.getChunkLength());
|
sb.append(", chunkLength = ").append(this.getChunkLength());
|
||||||
|
|
|
@ -31,6 +31,16 @@ import static org.junit.Assert.assertEquals;
|
||||||
*/
|
*/
|
||||||
public class TestCopyListingFileStatus {
|
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
|
@Test
|
||||||
public void testCopyListingFileStatusSerialization() throws Exception {
|
public void testCopyListingFileStatusSerialization() throws Exception {
|
||||||
CopyListingFileStatus src = new CopyListingFileStatus(
|
CopyListingFileStatus src = new CopyListingFileStatus(
|
||||||
|
|
Loading…
Reference in New Issue