usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [1/2] incubator-usergrid git commit: change queue to arrayblocking queue
Date Mon, 15 Dec 2014 18:31:18 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o-events a8cc5870d -> 37940e340


change queue to arrayblocking queue


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

Branch: refs/heads/two-dot-o-events
Commit: c6254f21e2cdf36dcc4b7d42f25514753846698d
Parents: 31bb3f1
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Fri Dec 12 13:30:23 2014 -0700
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Fri Dec 12 13:30:23 2014 -0700

----------------------------------------------------------------------
 .../apache/usergrid/services/notifications/apns/APNsAdapter.java | 4 ++--
 .../usergrid/services/notifications/apns/EntityPushManager.java  | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c6254f21/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
index a943bf5..8e97f4c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/APNsAdapter.java
@@ -64,7 +64,7 @@ public class APNsAdapter implements ProviderAdapter {
 
     private EntityManager entityManager;
     private EntityPushManager pushManager;
-    private LinkedBlockingQueue<SimpleApnsPushNotification> queue;
+    private ArrayBlockingQueue<SimpleApnsPushNotification> queue;
 
     public APNsAdapter(EntityManager entityManager, Notifier notifier){
         this.entityManager = entityManager;
@@ -131,7 +131,7 @@ public class APNsAdapter implements ProviderAdapter {
         if (pushManager == null || !pushManager.isStarted() || pushManager.isShutDown())
{
             PushManagerConfiguration config = new PushManagerConfiguration();
             config.setConcurrentConnectionCount(Runtime.getRuntime().availableProcessors()
* 2);
-            queue = new LinkedBlockingQueue<SimpleApnsPushNotification>();
+            queue = new ArrayBlockingQueue<>(10000);
 
             pushManager = new EntityPushManager(notifier, entityManager, queue, config);
             //only tested when a message is sent

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/c6254f21/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/EntityPushManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/EntityPushManager.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/EntityPushManager.java
index c3790b8..5d25649 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/EntityPushManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/apns/EntityPushManager.java
@@ -31,6 +31,7 @@ import org.apache.usergrid.persistence.entities.Notifier;
 import javax.net.ssl.SSLContext;
 import java.io.InputStream;
 import java.security.KeyStore;
+import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingDeque;
 import java.util.concurrent.LinkedBlockingQueue;
 
@@ -41,7 +42,7 @@ public class EntityPushManager extends PushManager<SimpleApnsPushNotification>
{
     private final Notifier notifier;
     private final EntityManager entityManager;
 
-    public EntityPushManager( Notifier notifier, EntityManager entityManager, LinkedBlockingQueue<SimpleApnsPushNotification>
queue, PushManagerConfiguration configuration) {
+    public EntityPushManager( Notifier notifier, EntityManager entityManager, BlockingQueue<SimpleApnsPushNotification>
queue, PushManagerConfiguration configuration) {
         super(getApnsEnvironment(notifier), getSSLContext(notifier), null, null, queue, configuration,
notifier.getName());
         this.notifier = notifier;
         this.entityManager = entityManager;


Mime
View raw message