falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject [11/15] falcon git commit: FALCON-1360 Size of feed should be humanized in feed instance listing. Contributed by Sandeep Samudrala.
Date Sat, 08 Aug 2015 14:40:27 GMT
FALCON-1360 Size of feed should be humanized in feed instance listing. Contributed by Sandeep
Samudrala.


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

Branch: refs/heads/0.7
Commit: 40ccf441b482cfdf913095bbd298aef0f0ed96fe
Parents: 47d00ef
Author: Ajay Yadava <ajaynsit@gmail.com>
Authored: Thu Aug 6 09:45:49 2015 +0530
Committer: Ajay Yadav <ajay.yadav@inmobi.com>
Committed: Sat Aug 8 20:06:41 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                              |  2 ++
 .../src/main/java/org/apache/falcon/ResponseHelper.java  |  4 ++--
 .../org/apache/falcon/resource/FeedInstanceResult.java   |  9 +++++++++
 .../main/java/org/apache/falcon/entity/FeedHelper.java   |  1 +
 .../org/apache/falcon/entity/FeedInstanceStatus.java     | 11 +++++++++++
 5 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/40ccf441/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b06e0a8..23c9970 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,8 @@ Trunk (Unreleased)
     FALCON-796 Enable users to triage data processing issues through falcon (Ajay Yadava)
     
   IMPROVEMENTS
+    FALCON-1360 Size of feed should be humanized in feed instance listing(Sndeep Samudrala
via Ajay Yadava)
+
     FALCON-1301 Improve documentation for Installation(Pragya Mittal via Ajay Yadava)
 
     FALCON-1322 Add prefix in runtime.properties(Sandeep Samudrala via Ajay Yadava)

http://git-wip-us.apache.org/repos/asf/falcon/blob/40ccf441/client/src/main/java/org/apache/falcon/ResponseHelper.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/ResponseHelper.java b/client/src/main/java/org/apache/falcon/ResponseHelper.java
index ec6604d..2df3e00 100644
--- a/client/src/main/java/org/apache/falcon/ResponseHelper.java
+++ b/client/src/main/java/org/apache/falcon/ResponseHelper.java
@@ -140,8 +140,8 @@ public final class ResponseHelper {
                 sb.append(toAppend).append("\t");
 
                 toAppend =
-                    instance.getSize() != -1 ? String.valueOf(instance
-                        .getSize()) : "-";
+                    instance.getSize() != -1 ? instance
+                        .getSizeH() : "-";
                 sb.append(toAppend).append("\t");
 
                 toAppend =

http://git-wip-us.apache.org/repos/asf/falcon/blob/40ccf441/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java b/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java
index dc64976..75f0b9a 100644
--- a/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java
+++ b/client/src/main/java/org/apache/falcon/resource/FeedInstanceResult.java
@@ -18,6 +18,8 @@
 
 package org.apache.falcon.resource;
 
+import org.apache.commons.io.FileUtils;
+
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -99,6 +101,9 @@ public class FeedInstanceResult extends APIResult {
         @XmlElement
         public long size;
 
+        @XmlElement
+        public String sizeH;
+
         public Instance() {
         }
 
@@ -132,6 +137,10 @@ public class FeedInstanceResult extends APIResult {
             return size;
         }
 
+        public String getSizeH(){
+            return FileUtils.byteCountToDisplaySize(size);
+        }
+
         @Override
         public String toString() {
             return "{instance:"

http://git-wip-us.apache.org/repos/asf/falcon/blob/40ccf441/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/FeedHelper.java b/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
index bb31de8..894c370 100644
--- a/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
+++ b/common/src/main/java/org/apache/falcon/entity/FeedHelper.java
@@ -733,6 +733,7 @@ public final class FeedHelper {
                 instance.creationTime = feedStatus.getCreationTime();
                 instance.uri = feedStatus.getUri();
                 instance.size = feedStatus.getSize();
+                instance.sizeH = feedStatus.getSizeH();
                 instances[index++] = instance;
             }
             result.setInstances(instances);

http://git-wip-us.apache.org/repos/asf/falcon/blob/40ccf441/common/src/main/java/org/apache/falcon/entity/FeedInstanceStatus.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/falcon/entity/FeedInstanceStatus.java b/common/src/main/java/org/apache/falcon/entity/FeedInstanceStatus.java
index ff06554..8b43671 100644
--- a/common/src/main/java/org/apache/falcon/entity/FeedInstanceStatus.java
+++ b/common/src/main/java/org/apache/falcon/entity/FeedInstanceStatus.java
@@ -32,6 +32,8 @@ public class FeedInstanceStatus {
 
     private long size = -1;
 
+    private String sizeH;
+
     private AvailabilityStatus status = AvailabilityStatus.MISSING;
 
     /**
@@ -72,10 +74,19 @@ public class FeedInstanceStatus {
         return size;
     }
 
+    public String getSizeH(){
+        return sizeH;
+    }
+
     public void setSize(long size) {
         this.size = size;
     }
 
+    public void setSizeH(String sizeH) {
+        this.sizeH = sizeH;
+    }
+
+
     public AvailabilityStatus getStatus() {
         return status;
     }


Mime
View raw message