usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [26/27] usergrid git commit: code review changes
Date Thu, 05 Oct 2017 04:50:12 GMT
code review changes


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

Branch: refs/heads/expose-reindex
Commit: 4a659106eadefc83cce93f47d6b5090f65b8c1e3
Parents: 9a15108
Author: Peter Johnson <pjohnson@apigee.com>
Authored: Wed Sep 27 15:10:56 2017 -0700
Committer: Peter Johnson <pjohnson@apigee.com>
Committed: Wed Sep 27 15:10:56 2017 -0700

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/CpEntityManager.java |  4 ++--
 .../corepersistence/asyncevents/EventBuilderImpl.java    |  1 -
 .../persistence/queue/impl/SNSQueueManagerImpl.java      | 11 +++++++----
 3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/4a659106/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
index 1dc4a89..3f3794e 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java
@@ -2854,7 +2854,7 @@ public class CpEntityManager implements EntityManager {
 
         // add to and index in collection of the application
         if ( !is_application) {
-            updateIndexForEniity(eType, entity, timestamp);
+            updateIndexForEntity(eType, entity, timestamp);
         }
 
         //write to our types map
@@ -2864,7 +2864,7 @@ public class CpEntityManager implements EntityManager {
         return entity;
     }
 
-    private <A extends Entity> void updateIndexForEniity(String eType, A entity,  long
timestamp) throws Exception {
+    private <A extends Entity> void updateIndexForEntity(String eType, A entity, long
timestamp) throws Exception {
         String collectionName = Schema.defaultCollectionName( eType );
         CpRelationManager cpr = ( CpRelationManager ) getRelationManager( getApplication()
);
         cpr.addToCollection( collectionName, entity );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4a659106/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
index 203d32a..1eb5e03 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java
@@ -21,7 +21,6 @@ package org.apache.usergrid.corepersistence.asyncevents;
 
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/4a659106/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
index 775a64b..bc9be57 100644
--- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
+++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java
@@ -84,6 +84,8 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
     private static final int MIN_VISIBILITY_TIMEOUT = 1; //seconds
     private static final String DEAD_LETTER_QUEUE_SUFFIX = "_dead";
 
+    private static final String FAILED_TO_SEND_MESSAGE = "FAILED INDEX REQUEST: Failed to
send message to SNS Queue, sending asynchronously. Message:[{}] URL:[{}] Error:[{}]";
+
     static {
 
         /**
@@ -573,7 +575,7 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
             }
         } catch (Exception e) {
             if (logger.isErrorEnabled()) {
-                logger.error("Failed to send this message {} to SNS queue at {}", stringBody,
topicArn);
+                logger.error(FAILED_TO_SEND_MESSAGE,  stringBody, topicArn, e);
             }
             sendMessageToAllRegionsAsync(body);
         }
@@ -591,7 +593,7 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
 
         final String stringBody = toString( body );
 
-        String topicArn = getWriteTopicArn();
+        final String topicArn = getWriteTopicArn();
 
         if ( logger.isTraceEnabled() ) {
             logger.trace( "Publishing Message...{} to arn: {}", stringBody, topicArn );
@@ -603,6 +605,7 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
             @Override
             public void onError( Exception e ) {
                 logger.error( "Error publishing message... {}", e );
+                logger.error(FAILED_TO_SEND_MESSAGE, stringBody, topicArn, e);
             }
 
 
@@ -713,7 +716,7 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
                     url);
             }
         } catch (Exception e) {
-            logger.error("Failed to send this message {}. To this address {}. Error was ",
 messageRequest.getMessageBody(), url, e);
+            logger.error(FAILED_TO_SEND_MESSAGE,  messageRequest.getMessageBody(), url, e);
             sendMessageToLocalRegionAsync(body);
         }
 
@@ -740,7 +743,7 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
 
             @Override
             public void onError( final Exception e ) {
-                logger.error("Failed to send this message {}. To this address {}. Error was
", stringBody, url, e);
+                logger.error(FAILED_TO_SEND_MESSAGE, stringBody, url, e);
             }
 
 


Mime
View raw message