falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajayyad...@apache.org
Subject [1/7] falcon git commit: FALCON-1399 Property for default number of results is not loaded dynamically. Contributed by Ajay Yadava.
Date Thu, 20 Aug 2015 14:21:53 GMT
Repository: falcon
Updated Branches:
  refs/heads/0.7 37fbf122d -> 44ca0bdbc


FALCON-1399 Property for default number of results is not loaded dynamically. Contributed
by Ajay Yadava.


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

Branch: refs/heads/0.7
Commit: 914c09f4e925a48347199f7b4d09341edb78f0d5
Parents: 37fbf12
Author: Ajay Yadava <ajaynsit@gmail.com>
Authored: Mon Aug 17 16:20:43 2015 +0530
Committer: Ajay Yadava <ajaynsit@gmail.com>
Committed: Thu Aug 20 19:48:49 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                                  | 2 ++
 common/src/main/resources/runtime.properties                 | 2 +-
 .../org/apache/falcon/resource/AbstractEntityManager.java    | 6 ++----
 .../org/apache/falcon/resource/AbstractInstanceManager.java  | 4 ++--
 .../apache/falcon/resource/proxy/InstanceManagerProxy.java   | 8 ++++----
 .../falcon/resource/proxy/SchedulableEntityManagerProxy.java | 2 +-
 src/conf/runtime.properties                                  | 2 +-
 .../java/org/apache/falcon/resource/InstanceManager.java     | 8 ++++----
 .../org/apache/falcon/resource/SchedulableEntityManager.java | 2 +-
 9 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 1b71717..fda428e 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -89,6 +89,8 @@ Trunk (Unreleased)
     (Suhas Vasu)
 
   BUG FIXES
+    FALCON-1399 Property for default number of results is not loaded dynamically(Ajay Yadava)
+
     FALCON-1398 CrossEntityValidations contains incorrect validations(Pragya Mittal via Ajay
Yadava)
 
     FALCON-1396 Disable the faulty test(Ajay Yadava via Sowmya Ramesh)

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/common/src/main/resources/runtime.properties
----------------------------------------------------------------------
diff --git a/common/src/main/resources/runtime.properties b/common/src/main/resources/runtime.properties
index f0253e6..086bca0 100644
--- a/common/src/main/resources/runtime.properties
+++ b/common/src/main/resources/runtime.properties
@@ -23,7 +23,7 @@
 
 *.falcon.replication.workflow.maxmaps=5
 *.falcon.replication.workflow.mapbandwidth=100
-*.webservices.default.results.per.page=3000
+*.webservices.default.results.per.page=10
 
 # Default configs to handle replication for late arriving feeds.
 *.feed.late.allowed=true

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
index ff5dc04..f2f9826 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractEntityManager.java
@@ -77,8 +77,6 @@ public abstract class AbstractEntityManager {
     private static MemoryLocks memoryLocks = MemoryLocks.getInstance();
 
     protected static final int XML_DEBUG_LEN = 10 * 1024;
-    protected static final Integer DEFAULT_NUM_RESULTS = getDefaultResultsPerPage();
-
     private AbstractWorkflowEngine workflowEngine;
     protected ConfigurationStore configStore = ConfigurationStore.get();
 
@@ -90,8 +88,8 @@ public abstract class AbstractEntityManager {
         }
     }
 
-    private static int getDefaultResultsPerPage() {
-        Integer result = 3000;
+    protected static Integer getDefaultResultsPerPage() {
+        Integer result = 10;
         final String key = "webservices.default.results.per.page";
         String value = RuntimeProperties.get().getProperty(key, result.toString());
         try {

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/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 b382f95..ab8a2fd 100644
--- a/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
+++ b/prism/src/main/java/org/apache/falcon/resource/AbstractInstanceManager.java
@@ -839,10 +839,10 @@ public abstract class AbstractInstanceManager extends AbstractEntityManager
{
 
     private Pair<Date, Date> getStartAndEndDate(Entity entityObject, String startStr,
String endStr)
         throws FalconException {
-        return getStartAndEndDate(entityObject, startStr, endStr, DEFAULT_NUM_RESULTS);
+        return getStartAndEndDate(entityObject, startStr, endStr, getDefaultResultsPerPage());
     }
 
-    private Pair<Date, Date> getStartAndEndDate(Entity entityObject, String startStr,
String endStr, int numResults)
+    private Pair<Date, Date> getStartAndEndDate(Entity entityObject, String startStr,
String endStr, Integer numResults)
         throws FalconException {
         Pair<Date, Date> clusterStartEndDates = EntityUtil.getEntityStartEndDates(entityObject);
         Frequency frequency = EntityUtil.getFrequency(entityObject);

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
b/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
index 465a636..3343c52 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/InstanceManagerProxy.java
@@ -101,7 +101,7 @@ public class InstanceManagerProxy extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") final String sortOrder,
             @DefaultValue("0") @QueryParam("offset") final Integer offset,
             @QueryParam("numResults") final Integer numResults) {
-        final Integer resultsPerPage = numResults == null ? DEFAULT_NUM_RESULTS : numResults;
+        final Integer resultsPerPage = numResults == null ? getDefaultResultsPerPage() :
numResults;
         return new InstanceProxy<InstancesResult>(InstancesResult.class) {
             @Override
             protected InstancesResult doExecute(String colo) throws FalconException {
@@ -133,7 +133,7 @@ public class InstanceManagerProxy extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") final String sortOrder,
             @DefaultValue("0") @QueryParam("offset") final Integer offset,
             @QueryParam("numResults") Integer numResults) {
-        final Integer resultsPerPage = numResults == null ? DEFAULT_NUM_RESULTS : numResults;
+        final Integer resultsPerPage = numResults == null ? getDefaultResultsPerPage() :
numResults;
         return new InstanceProxy<InstancesResult>(InstancesResult.class) {
             @Override
             protected InstancesResult doExecute(String colo) throws FalconException {
@@ -161,7 +161,7 @@ public class InstanceManagerProxy extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") final String sortOrder,
             @DefaultValue("0") @QueryParam("offset") final Integer offset,
             @QueryParam("numResults") final Integer numResults) {
-        final Integer resultsPerPage = numResults == null ? DEFAULT_NUM_RESULTS : numResults;
+        final Integer resultsPerPage = numResults == null ? getDefaultResultsPerPage() :
numResults;
         return new InstanceProxy<InstancesResult>(InstancesResult.class) {
             @Override
             protected InstancesResult doExecute(String colo) throws FalconException {
@@ -255,7 +255,7 @@ public class InstanceManagerProxy extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") final String sortOrder,
             @DefaultValue("0") @QueryParam("offset") final Integer offset,
             @QueryParam("numResults") final Integer numResults) {
-        final Integer resultsPerPage = numResults == null ? DEFAULT_NUM_RESULTS : numResults;
+        final Integer resultsPerPage = numResults == null ? getDefaultResultsPerPage() :
numResults;
         return new InstanceProxy<InstancesResult>(InstancesResult.class) {
             @Override
             protected InstancesResult doExecute(String colo) throws FalconException {

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
----------------------------------------------------------------------
diff --git a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
index b49d6f8..aa7fd0c 100644
--- a/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
+++ b/prism/src/main/java/org/apache/falcon/resource/proxy/SchedulableEntityManagerProxy.java
@@ -477,7 +477,7 @@ public class SchedulableEntityManagerProxy extends AbstractSchedulableEntityMana
         if (StringUtils.isNotEmpty(type)) {
             type = type.substring(1);
         }
-        resultsPerPage = resultsPerPage == null ? DEFAULT_NUM_RESULTS : resultsPerPage;
+        resultsPerPage = resultsPerPage == null ? getDefaultResultsPerPage() : resultsPerPage;
         return super.getEntityList(fields, nameSubsequence, tagKeywords, type, tags, filterBy,
                 orderBy, sortOrder, offset, resultsPerPage);
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/src/conf/runtime.properties
----------------------------------------------------------------------
diff --git a/src/conf/runtime.properties b/src/conf/runtime.properties
index 1eb3f1c..b8ebe39 100644
--- a/src/conf/runtime.properties
+++ b/src/conf/runtime.properties
@@ -31,7 +31,7 @@ prism.falcon.local.endpoint=https://localhost:15443
 falcon.current.colo=local
 
 #default number of results per call, if numResults option is not specified then this value
is used.
-*.webservices.default.results.per.page=3000
+*.webservices.default.results.per.page=10
 
 # retry count - to fetch the status from the workflow engine
 *.workflow.status.retry.count=30

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/webapp/src/main/java/org/apache/falcon/resource/InstanceManager.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/falcon/resource/InstanceManager.java b/webapp/src/main/java/org/apache/falcon/resource/InstanceManager.java
index cbc936e..76c66f3 100644
--- a/webapp/src/main/java/org/apache/falcon/resource/InstanceManager.java
+++ b/webapp/src/main/java/org/apache/falcon/resource/InstanceManager.java
@@ -56,7 +56,7 @@ public class InstanceManager extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") String sortOrder,
             @DefaultValue("0") @QueryParam("offset") Integer offset,
             @QueryParam("numResults") Integer resultsPerPage) {
-        resultsPerPage = resultsPerPage == null ? DEFAULT_NUM_RESULTS : resultsPerPage;
+        resultsPerPage = resultsPerPage == null ? getDefaultResultsPerPage() : resultsPerPage;
         return super.getRunningInstances(type, entity, colo, lifeCycles, filterBy,
                 orderBy, sortOrder, offset, resultsPerPage);
     }
@@ -82,7 +82,7 @@ public class InstanceManager extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") String sortOrder,
             @DefaultValue("0") @QueryParam("offset") Integer offset,
             @QueryParam("numResults") Integer resultsPerPage) {
-        resultsPerPage = resultsPerPage == null ? DEFAULT_NUM_RESULTS : resultsPerPage;
+        resultsPerPage = resultsPerPage == null ? getDefaultResultsPerPage() : resultsPerPage;
         return super.getInstances(type, entity, startStr, endStr, colo, lifeCycles,
                 filterBy, orderBy, sortOrder, offset, resultsPerPage);
     }
@@ -104,7 +104,7 @@ public class InstanceManager extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") String sortOrder,
             @DefaultValue("0") @QueryParam("offset") Integer offset,
             @QueryParam("numResults") Integer resultsPerPage) {
-        resultsPerPage = resultsPerPage == null ? DEFAULT_NUM_RESULTS : resultsPerPage;
+        resultsPerPage = resultsPerPage == null ? getDefaultResultsPerPage() : resultsPerPage;
         return super.getStatus(type, entity, startStr, endStr, colo, lifeCycles,
                 filterBy, orderBy, sortOrder, offset, resultsPerPage);
     }
@@ -159,7 +159,7 @@ public class InstanceManager extends AbstractInstanceManager {
             @DefaultValue("") @QueryParam("sortOrder") String sortOrder,
             @DefaultValue("0") @QueryParam("offset") Integer offset,
             @QueryParam("numResults") Integer resultsPerPage) {
-        resultsPerPage = resultsPerPage == null ? DEFAULT_NUM_RESULTS : resultsPerPage;
+        resultsPerPage = resultsPerPage == null ? getDefaultResultsPerPage() : resultsPerPage;
         return super.getLogs(type, entity, startStr, endStr, colo, runId, lifeCycles,
                 filterBy, orderBy, sortOrder, offset, resultsPerPage);
     }

http://git-wip-us.apache.org/repos/asf/falcon/blob/914c09f4/webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java
b/webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java
index 9a3d6be..a2af0cd 100644
--- a/webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java
+++ b/webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java
@@ -80,7 +80,7 @@ public class SchedulableEntityManager extends AbstractSchedulableEntityManager
{
         if (StringUtils.isNotEmpty(type)) {
             type = type.substring(1);
         }
-        resultsPerPage = resultsPerPage == null ? DEFAULT_NUM_RESULTS : resultsPerPage;
+        resultsPerPage = resultsPerPage == null ? getDefaultResultsPerPage() : resultsPerPage;
         return super.getEntityList(fields, nameSubsequence, tagKeywords, type, tags, filterBy,
                 orderBy, sortOrder, offset, resultsPerPage);
     }


Mime
View raw message