falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From venkat...@apache.org
Subject [4/5] incubator-falcon git commit: FALCON-874 Rest API - Instance and Entity orderBy param values should be case insensitive. Contributed by Balu Vellanki
Date Sat, 08 Nov 2014 05:32:38 GMT
FALCON-874 Rest API - Instance and Entity orderBy param values should be case insensitive.
Contributed by Balu Vellanki


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

Branch: refs/heads/master
Commit: 2186a360c177a549cc2b0179069b10213f4052e9
Parents: 80b0a16
Author: Venkatesh Seetharam <venkatesh@apache.org>
Authored: Fri Nov 7 21:05:37 2014 -0800
Committer: Venkatesh Seetharam <venkatesh@apache.org>
Committed: Fri Nov 7 21:33:26 2014 -0800

----------------------------------------------------------------------
 CHANGES.txt                                                  | 3 +++
 .../org/apache/falcon/resource/AbstractInstanceManager.java  | 8 ++++----
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/2186a360/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d2635b7..d2ca59f 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -129,6 +129,9 @@ Trunk (Unreleased)
   OPTIMIZATIONS
 
   BUG FIXES
+   FALCON-874 Rest API - Instance and Entity orderBy param values should be
+   case insensitive (Balu Vellanki via Venkatesh Seetharam)
+
    FALCON-820 Fix minor nits with HadoopClientFactory
    (Sowmya Ramesh via Venkatesh Seetharam)
 

http://git-wip-us.apache.org/repos/asf/incubator-falcon/blob/2186a360/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java b/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
index 5174dbd..26a4289 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
@@ -221,7 +221,7 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager
{
             return result;
         }
         // Sort the ArrayList using orderBy
-        instanceSet = sortInstances(instanceSet, orderBy, sortOrder);
+        instanceSet = sortInstances(instanceSet, orderBy.toLowerCase(), sortOrder);
         result.setCollection(instanceSet.subList(
                 offset, (offset+pageCount)).toArray(new Instance[pageCount]));
         return result;
@@ -281,7 +281,7 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager
{
     }
 
     private List<Instance> sortInstances(List<Instance> instanceSet,
-                                              String orderBy, String sortOrder) {
+                                         String orderBy, String sortOrder) {
         final String order = getValidSortOrder(sortOrder, orderBy);
         if (orderBy.equals("status")) {
             Collections.sort(instanceSet, new Comparator<Instance>() {
@@ -305,7 +305,7 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager
{
                             : i2.getCluster().compareTo(i1.getCluster());
                 }
             });
-        } else if (orderBy.equals("startTime")){
+        } else if (orderBy.equals("starttime")){
             Collections.sort(instanceSet, new Comparator<Instance>() {
                 @Override
                 public int compare(Instance i1, Instance i2) {
@@ -315,7 +315,7 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager
{
                             : start2.compareTo(start1);
                 }
             });
-        } else if (orderBy.equals("endTime")) {
+        } else if (orderBy.equals("endtime")) {
             Collections.sort(instanceSet, new Comparator<Instance>() {
                 @Override
                 public int compare(Instance i1, Instance i2) {


Mime
View raw message