usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [26/50] [abbrv] usergrid git commit: Fix NPE.
Date Mon, 02 May 2016 17:54:57 GMT
Fix NPE.


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

Branch: refs/heads/USERGRID-1246-MASTER
Commit: f6d2430c7509d4fbbe010fa025ff4b44213b4613
Parents: 69ccb1f
Author: Michael Russo <mrusso@apigee.com>
Authored: Wed Apr 20 16:17:53 2016 -0700
Committer: George Reyes <grey@apache.org>
Committed: Mon May 2 10:49:34 2016 -0700

----------------------------------------------------------------------
 .../usergrid/services/notifications/NotificationsService.java   | 5 ++++-
 .../notifications/impl/ApplicationQueueManagerImpl.java         | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/f6d2430c/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
index f4fdb65..65425d7 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/NotificationsService.java
@@ -136,7 +136,10 @@ public class NotificationsService extends AbstractCollectionService {
             // perform some input validates on useGraph payload property vs. ql= path query
             final List<ServiceParameter> parameters = context.getRequest().getOriginalParameters();
             for (ServiceParameter parameter : parameters){
-                if( parameter instanceof ServiceParameter.QueryParameter && context.getProperties().get("useGraph").equals(true)){
+                if( parameter instanceof ServiceParameter.QueryParameter
+                    && context.getProperties().get("useGraph") != null
+                      && context.getProperties().get("useGraph").equals(true)){
+
                     throw new IllegalArgumentException("Query ql parameter cannot be used
with useGraph:true property value");
                 }
             }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/f6d2430c/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
index 1bb92b7..5254fd6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/impl/ApplicationQueueManagerImpl.java
@@ -52,6 +52,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager
{
     private final String queueName;
     private final Meter queueMeter;
     private final Meter sendMeter;
+    private int concurrencyFactor;
 
     private final static String PUSH_PROCESSING_MAXTHREADS_PROP = "usergrid.push.async.processing.threads";
     private final static String PUSH_PROCESSING_QUEUESIZE_PROP = "usergrid.push.async.processing.queue.size";
@@ -84,12 +85,14 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager
{
 
             maxAsyncThreads = Integer.valueOf(System.getProperty(PUSH_PROCESSING_MAXTHREADS_PROP,
"200"));
             workerQueueSize = Integer.valueOf(System.getProperty(PUSH_PROCESSING_QUEUESIZE_PROP,
"2000"));
+            this.concurrencyFactor = Integer.valueOf(System.getProperty(PUSH_PROCESSING_CONCURRENCY_PROP,
"50"));
 
         } catch (Exception e){
 
             // if junk is passed into the property, just default the values
             maxAsyncThreads = 200;
             workerQueueSize = 2000;
+            this.concurrencyFactor = 50;
 
         }
 
@@ -330,7 +333,7 @@ public class ApplicationQueueManagerImpl implements ApplicationQueueManager
{
 
                         }).subscribeOn(Schedulers.from(asyncExecutor));
 
-                }, Integer.valueOf(System.getProperty(PUSH_PROCESSING_CONCURRENCY_PROP, "50")))
+                }, concurrencyFactor)
                 .doOnError(throwable -> {
 
                     logger.error("Error while processing devices for notification : {}",
notification.getUuid());


Mime
View raw message