Skip to content

Commit 4a65910

Browse files
committed
code review changes
1 parent 9a15108 commit 4a65910

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,7 +2854,7 @@ else if ( ( v instanceof String ) && isBlank( ( String ) v ) ) {
28542854

28552855
// add to and index in collection of the application
28562856
if ( !is_application) {
2857-
updateIndexForEniity(eType, entity, timestamp);
2857+
updateIndexForEntity(eType, entity, timestamp);
28582858
}
28592859

28602860
//write to our types map
@@ -2864,7 +2864,7 @@ else if ( ( v instanceof String ) && isBlank( ( String ) v ) ) {
28642864
return entity;
28652865
}
28662866

2867-
private <A extends Entity> void updateIndexForEniity(String eType, A entity, long timestamp) throws Exception {
2867+
private <A extends Entity> void updateIndexForEntity(String eType, A entity, long timestamp) throws Exception {
28682868
String collectionName = Schema.defaultCollectionName( eType );
28692869
CpRelationManager cpr = ( CpRelationManager ) getRelationManager( getApplication() );
28702870
cpr.addToCollection( collectionName, entity );

stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/EventBuilderImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222

2323
import java.util.ArrayList;
24-
import java.util.Collections;
2524
import java.util.List;
2625
import java.util.UUID;
2726

stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public class SNSQueueManagerImpl implements LegacyQueueManager {
8484
private static final int MIN_VISIBILITY_TIMEOUT = 1; //seconds
8585
private static final String DEAD_LETTER_QUEUE_SUFFIX = "_dead";
8686

87+
private static final String FAILED_TO_SEND_MESSAGE = "FAILED INDEX REQUEST: Failed to send message to SNS Queue, sending asynchronously. Message:[{}] URL:[{}] Error:[{}]";
88+
8789
static {
8890

8991
/**
@@ -573,7 +575,7 @@ private <T extends Serializable> void sendMessageToAllRegionsSync(final T body)
573575
}
574576
} catch (Exception e) {
575577
if (logger.isErrorEnabled()) {
576-
logger.error("Failed to send this message {} to SNS queue at {}", stringBody, topicArn);
578+
logger.error(FAILED_TO_SEND_MESSAGE, stringBody, topicArn, e);
577579
}
578580
sendMessageToAllRegionsAsync(body);
579581
}
@@ -591,7 +593,7 @@ private <T extends Serializable> void sendMessageToAllRegionsAsync(final T body
591593

592594
final String stringBody = toString( body );
593595

594-
String topicArn = getWriteTopicArn();
596+
final String topicArn = getWriteTopicArn();
595597

596598
if ( logger.isTraceEnabled() ) {
597599
logger.trace( "Publishing Message...{} to arn: {}", stringBody, topicArn );
@@ -603,6 +605,7 @@ private <T extends Serializable> void sendMessageToAllRegionsAsync(final T body
603605
@Override
604606
public void onError( Exception e ) {
605607
logger.error( "Error publishing message... {}", e );
608+
logger.error(FAILED_TO_SEND_MESSAGE, stringBody, topicArn, e);
606609
}
607610

608611

@@ -713,7 +716,7 @@ private <T extends Serializable> void sendMessageToLocalRegionSync(final T body)
713716
url);
714717
}
715718
} catch (Exception e) {
716-
logger.error("Failed to send this message {}. To this address {}. Error was ", messageRequest.getMessageBody(), url, e);
719+
logger.error(FAILED_TO_SEND_MESSAGE, messageRequest.getMessageBody(), url, e);
717720
sendMessageToLocalRegionAsync(body);
718721
}
719722

@@ -740,7 +743,7 @@ private <T extends Serializable> void sendMessageToLocalRegionAsync(final T body
740743

741744
@Override
742745
public void onError( final Exception e ) {
743-
logger.error("Failed to send this message {}. To this address {}. Error was ", stringBody, url, e);
746+
logger.error(FAILED_TO_SEND_MESSAGE, stringBody, url, e);
744747
}
745748

746749

0 commit comments

Comments
 (0)