usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [23/50] incubator-usergrid git commit: Fixes issue with not deleting from the map on message ack
Date Mon, 16 Mar 2015 23:37:51 GMT
Fixes issue with not deleting from the map on message ack


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

Branch: refs/heads/two-dot-o
Commit: 8fa5c9f8f4b6580eccba820c5fbbfdf9f088ed87
Parents: 001f3f8
Author: Todd Nine <tnine@apigee.com>
Authored: Wed Mar 11 11:52:20 2015 -0600
Committer: Todd Nine <tnine@apigee.com>
Committed: Wed Mar 11 11:52:20 2015 -0600

----------------------------------------------------------------------
 .../persistence/index/impl/BufferQueueSQSImpl.java    | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8fa5c9f8/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/BufferQueueSQSImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/BufferQueueSQSImpl.java
b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/BufferQueueSQSImpl.java
index c6acb36..25c2ba6 100644
--- a/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/BufferQueueSQSImpl.java
+++ b/stack/corepersistence/queryindex/src/main/java/org/apache/usergrid/persistence/index/impl/BufferQueueSQSImpl.java
@@ -190,7 +190,7 @@ public class BufferQueueSQSImpl implements BufferQueue {
             //load them into our response
             for ( final QueueMessage message : messages ) {
 
-                final String key = message.getBody().toString();
+                final String key = getMessageKey( message );
 
                 //now see if the key was there
                 final String payload = values.get( key );
@@ -238,6 +238,15 @@ public class BufferQueueSQSImpl implements BufferQueue {
         List<QueueMessage> toAck = new ArrayList<>( messages.size() );
 
         for ( IndexOperationMessage ioe : messages ) {
+
+
+            final SqsIndexOperationMessage sqsIndexOperationMessage =   ( SqsIndexOperationMessage
) ioe;
+
+            final String key = getMessageKey(sqsIndexOperationMessage.getMessage());
+
+            //remove it from the map
+            mapManager.delete( key  );
+
             toAck.add( ( ( SqsIndexOperationMessage ) ioe ).getMessage() );
         }
 
@@ -257,6 +266,9 @@ public class BufferQueueSQSImpl implements BufferQueue {
         return mapper.writeValueAsString( o );
     }
 
+    private String getMessageKey(final QueueMessage message){
+        return message.getBody().toString();
+    }
 
     /**
      * The message that subclasses our IndexOperationMessage.  holds a pointer to the original
message


Mime
View raw message