You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/10/21 22:34:49 UTC

[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 <sf...@apache.org>
Authored: Tue Oct 21 13:57:13 2014 -0600
Committer: Shawn Feldman <sf...@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);


[3/5] git commit: fix send to all parameter

Posted by sf...@apache.org.
fix send to all parameter


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

Branch: refs/heads/loadtest
Commit: 27bc6a4371cd148411f25687cb4c92020d1ce12a
Parents: dcf97c4
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Oct 21 14:01:36 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Oct 21 14:01:36 2014 -0600

----------------------------------------------------------------------
 .../usergrid/services/notifications/NotificationsService.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


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


[2/5] git commit: fix send to all parameter

Posted by sf...@apache.org.
fix send to all parameter


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

Branch: refs/heads/loadtest
Commit: dcf97c40cbace248dae6dbd01531356b72855165
Parents: f9cc232
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Oct 21 13:59:00 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Oct 21 13:59:00 2014 -0600

----------------------------------------------------------------------
 .../usergrid/services/notifications/NotificationsService.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/dcf97c40/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 4a6e067..3617fda 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,7 +176,7 @@ public class NotificationsService extends AbstractCollectionService {
             org.apache.usergrid.persistence.index.query.Query query = sp.getQuery();
             if (query == null) {
                 query = new Query();
-                if(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());


[4/5] git commit: portal should send debug flag

Posted by sf...@apache.org.
portal should send debug flag


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

Branch: refs/heads/loadtest
Commit: 19556e20e9967b98f60b5f5657a1e997025bdf7e
Parents: 27bc6a4
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Oct 21 14:18:15 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Oct 21 14:18:15 2014 -0600

----------------------------------------------------------------------
 .../push/push-send-notification-controller.js   | 44 ++++++++++++--------
 1 file changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/19556e20/portal/js/push/push-send-notification-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/push/push-send-notification-controller.js b/portal/js/push/push-send-notification-controller.js
index 4dd7f4a..7037323 100644
--- a/portal/js/push/push-send-notification-controller.js
+++ b/portal/js/push/push-send-notification-controller.js
@@ -16,10 +16,11 @@
  specific language governing permissions and limitations
  under the License.
  */
- 'use strict'
+'use strict'
 
-AppServices.Controllers.controller('PushSendNotificationCtrl', ['ug', '$scope', '$rootScope', '$location',
-  function (ug, $scope, $rootScope, $location) {
+AppServices.Controllers.controller('PushSendNotificationCtrl', ['ug', '$scope',
+  '$rootScope', '$location',
+  function(ug, $scope, $rootScope, $location) {
 
     $scope.send = {};
     $scope.send.selectedNotifier = {};
@@ -34,7 +35,7 @@ AppServices.Controllers.controller('PushSendNotificationCtrl', ['ug', '$scope',
 
     $scope.$on('notifiers-received', function(event, collection) {
       $scope.notifiersCollection = collection._list;
-      if(!$scope.$$phase) {
+      if (!$scope.$$phase) {
         $scope.$apply();
       }
     });
@@ -47,53 +48,62 @@ AppServices.Controllers.controller('PushSendNotificationCtrl', ['ug', '$scope',
 
     $scope.scheduleNotification = function() {
 
-      if($scope.send.$valid){
+      if ($scope.send.$valid) {
 
         var optionList = '';
         var type = $scope.send.controlGroup;
-        var payload = {payloads:{},deliver:null};
-        payload.payloads[$scope.send.selectedNotifier._data.name] = $scope.send.notifierMessage;
+        var payload = {
+          payloads: {},
+          deliver: null,
+          debug: true
+        };
+        payload.payloads[$scope.send.selectedNotifier._data.name] =
+          $scope.send.notifierMessage;
 
 
-        if(type !== 'all'){
+        if (type !== 'all') {
           //get whatever is selected in the radio button options
           optionList = $scope.send[type]
-          angular.forEach(optionList, function(value, index){
+          angular.forEach(optionList, function(value, index) {
             var path = type + '/' + value + '/notifications';
             ug.sendNotification(path, payload);
           });
-        }else{
+        } else {
           ug.sendNotification('devices;ql=/notifications', payload);
         }
 
-        $rootScope.$broadcast('alert', 'success', 'Notifications have been queued.');
+        $rootScope.$broadcast('alert', 'success',
+          'Notifications have been queued.');
 
       }
 
 
     }
 
-//    todo - this is copied over from old portal for calendar component
+    //    todo - this is copied over from old portal for calendar component
 
     $('#notification-schedule-time-date').datepicker();
-    $('#notification-schedule-time-date').datepicker('setDate', Date.last().sunday());
+    $('#notification-schedule-time-date').datepicker('setDate', Date.last()
+      .sunday());
     $('#notification-schedule-time-time').val("12:00 AM");
     $('#notification-schedule-time-time').timepicker({
       showPeriod: true,
       showLeadingZero: false
     });
 
-    function pad(number, length){
+    function pad(number, length) {
       var str = "" + number
       while (str.length < length) {
-        str = '0'+str
+        str = '0' + str
       }
       return str
     }
 
     var offset = new Date().getTimezoneOffset();
-    offset = ((offset<0? '+':'-') + pad(parseInt(Math.abs(offset/60)), 2) + pad(Math.abs(offset%60), 2));
+    offset = ((offset < 0 ? '+' : '-') + pad(parseInt(Math.abs(offset / 60)),
+      2) + pad(Math.abs(offset % 60), 2));
 
     $('#gmt_display').html('GMT ' + offset);
 
-  }]);
\ No newline at end of file
+  }
+]);
\ No newline at end of file


[5/5] git commit: Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into loadtest

Posted by sf...@apache.org.
Merge branch 'two-dot-o' of https://git-wip-us.apache.org/repos/asf/incubator-usergrid into loadtest


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

Branch: refs/heads/loadtest
Commit: ee147191aa5051cea5d0e8c2d8d87f88f7f37b31
Parents: 6614b6e 19556e2
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Oct 21 14:32:09 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Oct 21 14:32:09 2014 -0600

----------------------------------------------------------------------
 .../push/push-send-notification-controller.js   | 44 ++++++++++++--------
 .../notifications/NotificationsService.java     |  4 +-
 .../services/notifications/TaskManager.java     |  7 +++-
 3 files changed, 34 insertions(+), 21 deletions(-)
----------------------------------------------------------------------