Return-Path: X-Original-To: apmail-usergrid-commits-archive@minotaur.apache.org Delivered-To: apmail-usergrid-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 54291179E7 for ; Tue, 21 Oct 2014 20:34:50 +0000 (UTC) Received: (qmail 74975 invoked by uid 500); 21 Oct 2014 20:34:50 -0000 Delivered-To: apmail-usergrid-commits-archive@usergrid.apache.org Received: (qmail 74919 invoked by uid 500); 21 Oct 2014 20:34:50 -0000 Mailing-List: contact commits-help@usergrid.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@usergrid.incubator.apache.org Delivered-To: mailing list commits@usergrid.incubator.apache.org Received: (qmail 74827 invoked by uid 99); 21 Oct 2014 20:34:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Oct 2014 20:34:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DD28F93BCC2; Tue, 21 Oct 2014 20:34:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sfeldman@apache.org To: commits@usergrid.apache.org Date: Tue, 21 Oct 2014 20:34:49 -0000 Message-Id: <925523f4d0494162b33e0562871995a7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/5] git commit: fixing query to send to all 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 Authored: Tue Oct 21 13:57:13 2014 -0600 Committer: Shawn Feldman 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 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 properties = new HashMap<>(); + notification.setModified(System.currentTimeMillis()); notification.setFinished(notification.getModified()); + + Map 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 notifiers = new HashSet<>(proxy.getNotifierMap().values()); // remove dups // proxy.asyncCheckForInactiveDevices(notifiers);