You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by mr...@apache.org on 2016/04/21 01:18:12 UTC
[3/3] usergrid git commit: Fix NPE.
Fix NPE.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/158b5de3
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/158b5de3
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/158b5de3
Branch: refs/heads/release-2.1.1
Commit: 158b5de37fbfa1c6585dadb14b9d8508ecc06026
Parents: c5b06db
Author: Michael Russo <mr...@apigee.com>
Authored: Wed Apr 20 16:17:53 2016 -0700
Committer: Michael Russo <mr...@apigee.com>
Committed: Wed Apr 20 16:17:53 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/158b5de3/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/158b5de3/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());