You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by av...@apache.org on 2020/09/02 16:54:40 UTC
[hadoop-ozone] 21/33: HDDS-4149. Implement OzoneFileStatus#toString
(#1356)
This is an automated email from the ASF dual-hosted git repository.
avijayan pushed a commit to branch HDDS-3698-upgrade
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git
commit 085e194984986a796be3c37ab23b5936755a06a8
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Thu Aug 27 13:33:55 2020 +0200
HDDS-4149. Implement OzoneFileStatus#toString (#1356)
---
.../hadoop/ozone/om/helpers/OzoneFileStatus.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFileStatus.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFileStatus.java
index 2ff69c3..ca861d3 100644
--- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFileStatus.java
+++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneFileStatus.java
@@ -130,4 +130,22 @@ public class OzoneFileStatus {
public int hashCode() {
return Objects.hash(getTrimmedName());
}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append(getClass().getSimpleName());
+ sb.append("{");
+ if (keyInfo == null) {
+ sb.append("<root>");
+ } else {
+ sb.append(getTrimmedName());
+ if (isDirectory) {
+ sb.append(" (dir)");
+ }
+ }
+ sb.append("}");
+ return sb.toString();
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-commits-help@hadoop.apache.org