usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [1/5] git commit: fixing query to send to all
Date Tue, 21 Oct 2014 20:34:49 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/loadtest 6614b6e78 -> ee147191a


fixing query to send to all


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

Branch: refs/heads/loadtest
Commit: f9cc232e46034c9f1742493ca32e0372c4f97a52
Parents: 926ae56
Author: Shawn Feldman <sfeldman@apache.org>
Authored: Tue Oct 21 13:57:13 2014 -0600
Committer: Shawn Feldman <sfeldman@apache.org>
Committed: Tue Oct 21 13:57:13 2014 -0600

----------------------------------------------------------------------
 .../usergrid/services/notifications/NotificationsService.java | 4 ++--
 .../apache/usergrid/services/notifications/TaskManager.java   | 7 +++++--
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f9cc232e/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 f98ebfc..4a6e067 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
@@ -176,9 +176,9 @@ public class NotificationsService extends AbstractCollectionService {
             org.apache.usergrid.persistence.index.query.Query query = sp.getQuery();
             if (query == null) {
                 query = new Query();
-                if(!sp.isName() ||
-                        (collection == "devices" && sp.isName() && !sp.getName().equals("notifications")))
{
+                if(collection == "devices" && sp.isName() && !sp.getName().equals("notifications"))
{
                         //look for queries to /devices;ql=/notifications
+                }else{
                     query.addIdentifier(sp.getIdentifier());
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f9cc232e/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
index 03f036d..5902a93 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/TaskManager.java
@@ -162,7 +162,6 @@ public class TaskManager {
             // refresh notification
             if (fetch)
                 notification = em.get(this.notification.getUuid(), Notification.class);
-            notification.setModified(System.currentTimeMillis());
 
             //and write them out again, this will produce the most accurate count
             Map<String, Long> stats = new HashMap<>(2);
@@ -172,13 +171,17 @@ public class TaskManager {
 
             long totals = (notification.getStatistics().get("sent") + notification.getStatistics().get("errors"));
             //none of this is known and should you ever do this
-            Map<String, Object> properties = new HashMap<>();
+            notification.setModified(System.currentTimeMillis());
             notification.setFinished(notification.getModified());
+
+            Map<String, Object> properties = new HashMap<>();
             properties.put("finished", notification.getModified());
             properties.put("state", notification.getState());
             notification.addProperties(properties);
+
             long latency = notification.getFinished() - notification.getStarted();
             LOG.info("notification finished batch: {} of {} devices in " + latency + "ms",
notification.getUuid(), totals);
+
             em.update(notification);
 //        Set<Notifier> notifiers = new HashSet<>(proxy.getNotifierMap().values());
// remove dups
 //        proxy.asyncCheckForInactiveDevices(notifiers);


Mime
View raw message