[14/15] usergrid git commit: Fixes incorrect units on timeout from millis to seconds.
Fixes incorrect units on timeout from millis to seconds. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1fe1d1a3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1fe1d1a3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1fe1d1a3 Branch: refs/heads/master Commit: 1fe1d1a34e806ebfc53d0c6cb729e7e4aab804a1 Parents: e50835f Author: Todd NineAuthored: Tue Oct 20 11:37:03 2015 -0600 Committer: Todd Nine Committed: Tue Oct 20 11:44:35 2015 -0600 -- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/1fe1d1a3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 6f779b5..7034a67 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -25,6 +25,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -491,8 +492,11 @@ public class AmazonAsyncEventService implements AsyncEventService { final UUID newMessageId = UUIDGenerator.newTimeUUID(); +final int expirationTimeInSeconds = +( int ) TimeUnit.MILLISECONDS.toSeconds( indexProcessorFig.getIndexMessageTtl() ); + //write to the map in ES -esMapPersistence.putString( newMessageId.toString(), jsonValue, indexProcessorFig.getIndexMessageTtl() ); +esMapPersistence.putString( newMessageId.toString(), jsonValue, expirationTimeInSeconds );
[10/15] usergrid git commit: Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized.
Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/fbb6c823 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fbb6c823 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fbb6c823 Branch: refs/heads/master Commit: fbb6c823b7e2a1f5f55ab044942b38d1157970c0 Parents: d8e6572 Author: Michael RussoAuthored: Mon Oct 19 21:28:46 2015 -0700 Committer: Michael Russo Committed: Mon Oct 19 21:28:46 2015 -0700 -- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java| 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/fbb6c823/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 3c18992..1bb00dc 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 @@ -543,6 +543,11 @@ public class SNSQueueManagerImpl implements QueueManager { @Override public void sendMessages( final List bodies ) throws IOException { +if ( sqsAsync == null ) { +logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); +return; +} + for ( Object body : bodies ) { sendMessage( ( Serializable ) body ); }
[04/15] usergrid git commit: Fixes empty payload notification issue.
Fixes empty payload notification issue. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/0326629a Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/0326629a Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/0326629a Branch: refs/heads/master Commit: 0326629a24cec3bd44d91810b4b8f0516c69c9b8 Parents: 3e15585 Author: Todd NineAuthored: Mon Oct 19 13:53:30 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 13:53:30 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 55 .../asyncevents/AsyncIndexProvider.java | 4 +- .../index/AmazonAsyncEventServiceTest.java | 2 +- 3 files changed, 36 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/0326629a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index f8ef5e7..6b2eb45 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -89,6 +89,21 @@ import rx.Subscription; import rx.schedulers.Schedulers; +/** + * TODO, this whole class is becoming a nightmare. We need to remove all consume from this class and refactor it into the following manner. + * + * 1. Produce. Keep the code in the handle as is + * 2. Consume: Move the code into a refactored system + * 2.1 A central dispatcher + * 2.2 An interface that produces an observable of type BatchOperation. Any handler will be refactored into it's own + * impl that will then emit a stream of batch operations to perform + * 2.3 The central dispatcher will then subscribe to these events and merge them. Handing them off to a batch handler + * 2.4 The batch handler will roll up the operations into a batch size, and then queue them + * 2.5 The receive batch handler will execute the batch operations + * + * TODO determine how we error handle? + * + */ @Singleton public class AmazonAsyncEventService implements AsyncEventService { @@ -360,7 +375,8 @@ public class AmazonAsyncEventService implements AsyncEventService { public void queueInitializeApplicationIndex( final ApplicationScope applicationScope) { IndexLocationStrategy indexLocationStrategy = indexLocationStrategyFactory.getIndexLocationStrategy( applicationScope ); -offerTopic(new InitializeApplicationIndexEvent(queueFig.getPrimaryRegion(), new ReplicatedIndexLocationStrategy(indexLocationStrategy))); +offerTopic( new InitializeApplicationIndexEvent( queueFig.getPrimaryRegion(), +new ReplicatedIndexLocationStrategy( indexLocationStrategy ) ) ); } @@ -503,35 +519,29 @@ public class AmazonAsyncEventService implements AsyncEventService { final String message = esMapPersistence.getString( messageId.toString() ); -String highConsistency = null; +final IndexOperationMessage indexOperationMessage; if(message == null){ logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level" ); -highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); - -} +final String highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); -//read the value from the string +if(highConsistency == null){ +logger.error( "Unable to find the ES batch with id {} to process at a higher consistency level" ); -final IndexOperationMessage indexOperationMessage; +throw new RuntimeException( "Unable to find the ES batch to process with message id " + messageId ); +} -//our original local read has it, parse it. -if(message != null){ - indexOperationMessage = ObjectJsonSerializer.INSTANCE.fromString( message, IndexOperationMessage.class ); -} -//we tried to read it at a higher consistency level and it works -else if (highConsistency != null){ indexOperationMessage = ObjectJsonSerializer.INSTANCE.fromString( highConsistency, IndexOperationMessage.class ); -} -//we couldn't find it, bail -else{ -logger.error( "Unable to find the ES batch with id {} to process at a higher consistency level"
[2/2] usergrid git commit: Added logging changes for people who don't know how to use log4j. Added catch for duplicate usernames.
Added logging changes for people who don't know how to use log4j. Added catch for duplicate usernames. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/afe0c51d Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/afe0c51d Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/afe0c51d Branch: refs/heads/1.x Commit: afe0c51d67ca1d3f262890ec44363200128e7361 Parents: 6e2ff96 Author: George ReyesAuthored: Mon Oct 19 16:52:52 2015 -0700 Committer: George Reyes Committed: Mon Oct 19 16:52:52 2015 -0700 -- .../apache/usergrid/tools/AdminPointerFix.java | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/afe0c51d/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java -- diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java b/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java index 72ae4d7..6243571 100644 --- a/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java +++ b/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java @@ -38,6 +38,7 @@ import org.apache.usergrid.persistence.Results; import org.apache.usergrid.persistence.cassandra.CassandraService; import org.apache.usergrid.persistence.entities.Application; import org.apache.usergrid.persistence.entities.User; +import org.apache.usergrid.persistence.exceptions.DuplicateUniquePropertyExistsException; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; @@ -78,6 +79,7 @@ public class AdminPointerFix extends ExportingToolBase { startSpring(); logger.info( "Starting crawl of all admins" ); +System.out.println( "Starting crawl of all admins" ); EntityManager em = emf.getEntityManager( CassandraService.MANAGEMENT_APPLICATION_ID ); Application app = em.getApplication(); @@ -115,6 +117,8 @@ public class AdminPointerFix extends ExportingToolBase { if ( ids.size() > 1 ) { logger.info( "Found multiple users with the username {}", username ); +System.out.println("Found multiple users with the username"+ username+". Run DupAdmiRepair."); + } } @@ -123,6 +127,8 @@ public class AdminPointerFix extends ExportingToolBase { if ( ids.size() > 1 ) { logger.info( "Found multiple users with the email {}", email ); +System.out.println("Found multiple users with the username"+ email+". Run DupAdmiRepair."); + } @@ -136,13 +142,24 @@ public class AdminPointerFix extends ExportingToolBase { UUID toLoad = tempIds.get( 0 ); logger.warn( "Could not load target user by email {}, loading by UUID {} instead", email, toLoad ); +System.out.println("Could not load the target user by email: "+email+". Loading by the following uuid instead: "+toLoad.toString()); targetUser = managementService.getAdminUserByUuid( toLoad ); User targetUserEntity = em.get( targetUser.getUuid(), User.class ); -em.update( targetUserEntity ); +try { +em.update( targetUserEntity ); +}catch(DuplicateUniquePropertyExistsException dup){ +System.out.println("Found duplicate unique property: "+dup.getPropertyName()+ ". Duplicate property is: "+dup.getPropertyValue()); +if (dup.getPropertyName().equals( "username" )){ + targetUserEntity.setUsername( targetUserEntity.getEmail() ); +} +else +throw dup; +} } } logger.info( "Repair complete" ); +System.out.println("Repair Complete"); } }
usergrid git commit: Fixes comments and refactors map to be a cleaner read pattern
Repository: usergrid Updated Branches: refs/heads/USERGRID-1048 fbb6c823b -> e50835f10 Fixes comments and refactors map to be a cleaner read pattern Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e50835f1 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e50835f1 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e50835f1 Branch: refs/heads/USERGRID-1048 Commit: e50835f1016a9988513a00b64337222957fa7747 Parents: fbb6c82 Author: Todd NineAuthored: Tue Oct 20 09:34:43 2015 -0600 Committer: Todd Nine Committed: Tue Oct 20 09:34:43 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 2 +- .../core/astyanax/CassandraConfig.java | 8 ++--- .../core/astyanax/CassandraConfigImpl.java | 1 + .../map/impl/MapSerializationImpl.java | 37 .../queue/impl/SNSQueueManagerImpl.java | 4 +-- 5 files changed, 14 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 38c2966..6f779b5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -521,7 +521,7 @@ public class AmazonAsyncEventService implements AsyncEventService { final IndexOperationMessage indexOperationMessage; if(message == null){ -logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level", +logger.warn( "Received message with id {} to process, unable to find it, reading with higher consistency level", messageId); final String highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java index 817aee2..dba3646 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java @@ -34,25 +34,25 @@ public interface CassandraConfig { * Get the currently configured ReadCL * @return */ -public ConsistencyLevel getReadCL(); +ConsistencyLevel getReadCL(); /** * Get the currently configured ReadCL that is more consitent than getReadCL * @return */ -public ConsistencyLevel getConsistentReadCL(); +ConsistencyLevel getConsistentReadCL(); /** * Get the currently configured write CL * @return */ -public ConsistencyLevel getWriteCL(); +ConsistencyLevel getWriteCL(); /** * Return the number of shards that has been set in the property file * @return */ -public int[] getShardSettings(); +int[] getShardSettings(); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java index 17b91c6..7373322 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java @@ -83,6 +83,7 @@ public class CassandraConfigImpl implements CassandraConfig { public ConsistencyLevel getConsistentReadCL() { return consistentCl; } + @Override public ConsistencyLevel getWriteCL() { return
[03/12] usergrid git commit: Merge branch 'refs/heads/2.1-release' into USERGRID-1048
Merge branch 'refs/heads/2.1-release' into USERGRID-1048 Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3e155852 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3e155852 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3e155852 Branch: refs/heads/2.1-release Commit: 3e1558524728c96834cfd66d9e53e3f1b6a7d3d6 Parents: 04a3f47 a09485a Author: Todd NineAuthored: Mon Oct 19 13:30:04 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 13:30:04 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 149 ++- .../asyncevents/AsyncIndexProvider.java | 26 ++-- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 -- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 2 +- .../queue/impl/SNSQueueManagerImpl.java | 8 +- 13 files changed, 135 insertions(+), 256 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/3e155852/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index d319ac8,c198674..f8ef5e7 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@@ -97,7 -84,9 +100,8 @@@ public class AmazonAsyncEventService im public static final String QUEUE_NAME = "index"; //keep this short as AWS limits queue name size to 80 chars private final QueueManager queue; -private final QueueScope queueScope; private final IndexProcessorFig indexProcessorFig; + private final QueueFig queueFig; private final IndexProducer indexProducer; private final EntityCollectionManagerFactory entityCollectionManagerFactory; private final IndexLocationStrategyFactory indexLocationStrategyFactory; @@@ -125,33 -113,28 +129,35 @@@ @Inject -public AmazonAsyncEventService(final QueueManagerFactory queueManagerFactory, - final IndexProcessorFig indexProcessorFig, - final IndexProducer indexProducer, - final MetricsFactory metricsFactory, - final EntityCollectionManagerFactory entityCollectionManagerFactory, - final IndexLocationStrategyFactory indexLocationStrategyFactory, - final EntityIndexFactory entityIndexFactory, - final EventBuilder eventBuilder, - final RxTaskScheduler rxTaskScheduler, - QueueFig queueFig) { +public AmazonAsyncEventService( final QueueManagerFactory queueManagerFactory, +final IndexProcessorFig indexProcessorFig, +final IndexProducer indexProducer, +final MetricsFactory metricsFactory, +final EntityCollectionManagerFactory entityCollectionManagerFactory, +final IndexLocationStrategyFactory indexLocationStrategyFactory, +final EntityIndexFactory entityIndexFactory, +final EventBuilder eventBuilder, +final MapManagerFactory mapManagerFactory, ++final QueueFig queueFig, +final RxTaskScheduler rxTaskScheduler ) { this.indexProducer = indexProducer; this.entityCollectionManagerFactory = entityCollectionManagerFactory; this.indexLocationStrategyFactory = indexLocationStrategyFactory; this.entityIndexFactory = entityIndexFactory; this.eventBuilder = eventBuilder; + +final MapScope mapScope = new MapScopeImpl( CpNamingUtils.getManagementApplicationId(), "indexEvents"); + +this.esMapPersistence =
[11/12] usergrid git commit: Fixes comments and refactors map to be a cleaner read pattern
Fixes comments and refactors map to be a cleaner read pattern Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e50835f1 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e50835f1 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e50835f1 Branch: refs/heads/2.1-release Commit: e50835f1016a9988513a00b64337222957fa7747 Parents: fbb6c82 Author: Todd NineAuthored: Tue Oct 20 09:34:43 2015 -0600 Committer: Todd Nine Committed: Tue Oct 20 09:34:43 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 2 +- .../core/astyanax/CassandraConfig.java | 8 ++--- .../core/astyanax/CassandraConfigImpl.java | 1 + .../map/impl/MapSerializationImpl.java | 37 .../queue/impl/SNSQueueManagerImpl.java | 4 +-- 5 files changed, 14 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 38c2966..6f779b5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -521,7 +521,7 @@ public class AmazonAsyncEventService implements AsyncEventService { final IndexOperationMessage indexOperationMessage; if(message == null){ -logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level", +logger.warn( "Received message with id {} to process, unable to find it, reading with higher consistency level", messageId); final String highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java index 817aee2..dba3646 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java @@ -34,25 +34,25 @@ public interface CassandraConfig { * Get the currently configured ReadCL * @return */ -public ConsistencyLevel getReadCL(); +ConsistencyLevel getReadCL(); /** * Get the currently configured ReadCL that is more consitent than getReadCL * @return */ -public ConsistencyLevel getConsistentReadCL(); +ConsistencyLevel getConsistentReadCL(); /** * Get the currently configured write CL * @return */ -public ConsistencyLevel getWriteCL(); +ConsistencyLevel getWriteCL(); /** * Return the number of shards that has been set in the property file * @return */ -public int[] getShardSettings(); +int[] getShardSettings(); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java index 17b91c6..7373322 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java @@ -83,6 +83,7 @@ public class CassandraConfigImpl implements CassandraConfig { public ConsistencyLevel getConsistentReadCL() { return consistentCl; } + @Override public ConsistencyLevel getWriteCL() { return writeCl;
[10/12] usergrid git commit: Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized.
Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/fbb6c823 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fbb6c823 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fbb6c823 Branch: refs/heads/2.1-release Commit: fbb6c823b7e2a1f5f55ab044942b38d1157970c0 Parents: d8e6572 Author: Michael RussoAuthored: Mon Oct 19 21:28:46 2015 -0700 Committer: Michael Russo Committed: Mon Oct 19 21:28:46 2015 -0700 -- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java| 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/fbb6c823/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 3c18992..1bb00dc 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 @@ -543,6 +543,11 @@ public class SNSQueueManagerImpl implements QueueManager { @Override public void sendMessages( final List bodies ) throws IOException { +if ( sqsAsync == null ) { +logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); +return; +} + for ( Object body : bodies ) { sendMessage( ( Serializable ) body ); }
[1/2] usergrid git commit: Add Jacoco to all modules.
Repository: usergrid Updated Branches: refs/heads/jacoco [created] 29f5717fc Add Jacoco to all modules. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/0f6f052e Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/0f6f052e Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/0f6f052e Branch: refs/heads/jacoco Commit: 0f6f052e574183eb8a1b937bbac903d5e0629749 Parents: e7c805f Author: Dave JohnsonAuthored: Mon Oct 19 14:03:53 2015 -0400 Committer: Dave Johnson Committed: Mon Oct 19 14:03:53 2015 -0400 -- stack/core/pom.xml | 2 +- stack/corepersistence/collection/pom.xml | 50 +++--- stack/corepersistence/common/pom.xml | 16 + stack/corepersistence/graph/pom.xml | 16 + stack/corepersistence/map/pom.xml| 16 + stack/corepersistence/model/pom.xml | 16 + stack/corepersistence/queryindex/pom.xml | 10 +++ stack/corepersistence/queue/pom.xml | 16 + stack/pom.xml| 95 ++- stack/rest/pom.xml | 8 ++- stack/services/pom.xml | 4 +- stack/test-utils/pom.xml | 2 +- stack/tools/pom.xml | 2 +- stack/websocket/pom.xml | 2 +- 14 files changed, 191 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/core/pom.xml -- diff --git a/stack/core/pom.xml b/stack/core/pom.xml index 15470ad..e0f8d43 100644 --- a/stack/core/pom.xml +++ b/stack/core/pom.xml @@ -89,7 +89,7 @@ ${usergrid.it.forkCount} ${usergrid.it.threads} true --Dtest.barrier.timestamp=${maven.build.timestamp} -Dtest.clean.storage=true -Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline} +-Dtest.barrier.timestamp=${maven.build.timestamp} -Dtest.clean.storage=true -Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline} http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/corepersistence/collection/pom.xml -- diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml index 8d5ca57..62fadf7 100644 --- a/stack/corepersistence/collection/pom.xml +++ b/stack/corepersistence/collection/pom.xml @@ -18,48 +18,16 @@ - - - + +org.apache.maven.plugins +maven-surefire-plugin +${surefire.plugin.version} + + -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec + + + http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/corepersistence/common/pom.xml -- diff --git a/stack/corepersistence/common/pom.xml b/stack/corepersistence/common/pom.xml index 5481573..6e1e81b 100644 --- a/stack/corepersistence/common/pom.xml +++ b/stack/corepersistence/common/pom.xml @@ -12,6 +12,22 @@ common Usergrid Common + + + + + +org.apache.maven.plugins +maven-surefire-plugin +${surefire.plugin.version} + + -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec + + + + + + http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/corepersistence/graph/pom.xml -- diff --git a/stack/corepersistence/graph/pom.xml b/stack/corepersistence/graph/pom.xml index 1b02dd4..776380f 100644 --- a/stack/corepersistence/graph/pom.xml +++ b/stack/corepersistence/graph/pom.xml @@ -33,6 +33,22 @@ Usergrid Graph + + + + + +org.apache.maven.plugins +
[1/4] usergrid git commit: Update the visibility timeout used when taking messages from SQS as it overrides the queue's configured/default timeout. Also change the queue's visibility timeout property
Repository: usergrid Updated Branches: refs/heads/jacoco 29f5717fc -> fb69ba3e9 Update the visibility timeout used when taking messages from SQS as it overrides the queue's configured/default timeout. Also change the queue's visibility timeout property to be exposed as milliseconds for consistency. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2b22c610 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2b22c610 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2b22c610 Branch: refs/heads/jacoco Commit: 2b22c610ddc3b9f9f08777fe5467713efe2ba553 Parents: 0f589f6 Author: Michael RussoAuthored: Thu Oct 15 10:23:29 2015 -0700 Committer: Michael Russo Committed: Thu Oct 15 10:23:29 2015 -0700 -- .../usergrid/corepersistence/index/IndexProcessorFig.java | 7 +++ .../java/org/apache/usergrid/persistence/queue/QueueFig.java | 6 +++--- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java | 2 +- .../persistence/queue/util/AmazonNotificationUtils.java | 4 +++- 4 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java index 410f162..7d022e5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java @@ -62,11 +62,10 @@ public interface IndexProcessorFig extends GuicyFig { /** * Set the visibility timeout for messages received from the queue. (in milliseconds). - * AWS default is also currently 30 seconds. Received messages will remain 'in flight' until - * they are ack'd(deleted) or this timeout occurs. If the timeout occurs, the messages will become - * visible again for re-processing. + * Received messages will remain 'in flight' until they are ack'd(deleted) or this timeout occurs. + * If the timeout occurs, the messages will become visible again for re-processing. */ -@Default( "3" ) +@Default( "5000" ) // 5 seconds @Key( INDEX_QUEUE_VISIBILITY_TIMEOUT ) int getIndexQueueVisibilityTimeout(); http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java -- diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java index 7f26bcf..0453a9b 100644 --- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java +++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java @@ -76,10 +76,10 @@ public interface QueueFig extends GuicyFig { int getAsyncQueueSize(); /** - * Set the visibility timeout for faster retries + * Set the visibility timeout (in milliseconds) for faster retries * @return */ @Key( "usergrid.queue.visibilityTimeout" ) -@Default("10") -String getVisibilityTimeout(); +@Default("5000") // 5 seconds +int getVisibilityTimeout(); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/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 a2b5d72..d476f76 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 @@ -351,7 +351,7 @@ public class SNSQueueManagerImpl implements QueueManager { ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(url); receiveMessageRequest.setMaxNumberOfMessages(limit); -receiveMessageRequest.setVisibilityTimeout(transactionTimeout / 1000); +receiveMessageRequest.setVisibilityTimeout(Math.max(1,
[2/4] usergrid git commit: Add sourceRegion to SQS event message based on queue primary region. Remove cached entity manager (unused).
Add sourceRegion to SQS event message based on queue primary region. Remove cached entity manager (unused). Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/a09485a3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/a09485a3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/a09485a3 Branch: refs/heads/jacoco Commit: a09485a3a5ac8b4217b294f4754ea8a70a7ec447 Parents: 2b22c61 Author: Michael RussoAuthored: Fri Oct 16 13:12:42 2015 -0700 Committer: Michael Russo Committed: Fri Oct 16 13:12:42 2015 -0700 -- .../asyncevents/AmazonAsyncEventService.java| 40 ++--- .../asyncevents/AsyncIndexProvider.java | 10 +- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 --- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 2 +- .../queue/impl/SNSQueueManagerImpl.java | 6 +- .../queue/impl/SQSQueueManagerImpl.java | 2 +- 14 files changed, 64 insertions(+), 202 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/a09485a3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 95126c6..c198674 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -29,6 +29,7 @@ import java.util.stream.Stream; import com.google.common.base.Optional; import org.apache.usergrid.persistence.index.impl.IndexProducer; +import org.apache.usergrid.persistence.queue.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,10 +57,6 @@ import org.apache.usergrid.persistence.index.IndexLocationStrategy; import org.apache.usergrid.persistence.index.impl.IndexOperationMessage; import org.apache.usergrid.persistence.model.entity.Entity; import org.apache.usergrid.persistence.model.entity.Id; -import org.apache.usergrid.persistence.queue.QueueManager; -import org.apache.usergrid.persistence.queue.QueueManagerFactory; -import org.apache.usergrid.persistence.queue.QueueMessage; -import org.apache.usergrid.persistence.queue.QueueScope; import org.apache.usergrid.persistence.queue.impl.QueueScopeImpl; import com.codahale.metrics.Counter; @@ -89,6 +86,7 @@ public class AmazonAsyncEventService implements AsyncEventService { private final QueueManager queue; private final QueueScope queueScope; private final IndexProcessorFig indexProcessorFig; +private final QueueFig queueFig; private final IndexProducer indexProducer; private final EntityCollectionManagerFactory entityCollectionManagerFactory; private final IndexLocationStrategyFactory indexLocationStrategyFactory; @@ -115,15 +113,16 @@ public class AmazonAsyncEventService implements AsyncEventService { @Inject -public AmazonAsyncEventService( final QueueManagerFactory queueManagerFactory, -final IndexProcessorFig indexProcessorFig, -final IndexProducer indexProducer, -final MetricsFactory metricsFactory, -final EntityCollectionManagerFactory entityCollectionManagerFactory, -final IndexLocationStrategyFactory indexLocationStrategyFactory, -final EntityIndexFactory entityIndexFactory, -final EventBuilder eventBuilder, -final RxTaskScheduler rxTaskScheduler ) { +public AmazonAsyncEventService(final QueueManagerFactory queueManagerFactory, + final IndexProcessorFig indexProcessorFig, + final IndexProducer indexProducer, + final MetricsFactory metricsFactory, + final
[4/4] usergrid git commit: Merge branch 'master' into jacoco
Merge branch 'master' into jacoco Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/fb69ba3e Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fb69ba3e Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fb69ba3e Branch: refs/heads/jacoco Commit: fb69ba3e9052134b55392431ce9dfe6d879ac9d1 Parents: 29f5717 a679aea Author: Dave JohnsonAuthored: Tue Oct 20 13:42:54 2015 -0400 Committer: Dave Johnson Committed: Tue Oct 20 13:42:54 2015 -0400 -- .../asyncevents/AmazonAsyncEventService.java| 40 ++--- .../asyncevents/AsyncIndexProvider.java | 10 +- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/IndexProcessorFig.java| 7 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 --- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 8 +- .../queue/impl/SNSQueueManagerImpl.java | 8 +- .../queue/impl/SQSQueueManagerImpl.java | 2 +- .../queue/util/AmazonNotificationUtils.java | 4 +- 16 files changed, 74 insertions(+), 211 deletions(-) --
[02/12] usergrid git commit: Fixes serialization tests and verifies full end to end functionality.
Fixes serialization tests and verifies full end to end functionality. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/04a3f47b Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/04a3f47b Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/04a3f47b Branch: refs/heads/2.1-release Commit: 04a3f47bd86ec0674ff487f479327e0f174f0425 Parents: 94a9078 Author: Todd NineAuthored: Mon Oct 19 12:00:56 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 12:00:56 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 70 ++- .../asyncevents/model/AsyncEvent.java | 5 +- .../index/IndexProcessorFig.java| 7 +- .../util/ObjectJsonSerializer.java | 28 +- .../persistence/queue/QueueManager.java | 2 +- .../persistence/queue/guice/QueueModule.java| 1 - .../queue/impl/SNSQueueManagerImpl.java | 515 ++- .../queue/impl/SQSQueueManagerImpl.java | 362 - 8 files changed, 336 insertions(+), 654 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/04a3f47b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index c9f0953..d319ac8 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -29,19 +29,13 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.google.common.base.Optional; - -import org.apache.usergrid.corepersistence.asyncevents.model.ElasticsearchIndexEvent; -import org.apache.usergrid.corepersistence.util.CpNamingUtils; -import org.apache.usergrid.corepersistence.util.ObjectJsonSerializer; -import org.apache.usergrid.exception.NotImplementedException; -import org.apache.usergrid.persistence.index.impl.IndexProducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.usergrid.corepersistence.asyncevents.model.AsyncEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EdgeDeleteEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EdgeIndexEvent; +import org.apache.usergrid.corepersistence.asyncevents.model.ElasticsearchIndexEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EntityDeleteEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EntityIndexEvent; import org.apache.usergrid.corepersistence.asyncevents.model.InitializeApplicationIndexEvent; @@ -50,6 +44,8 @@ import org.apache.usergrid.corepersistence.index.IndexLocationStrategyFactory; import org.apache.usergrid.corepersistence.index.IndexProcessorFig; import org.apache.usergrid.corepersistence.index.ReplicatedIndexLocationStrategy; import org.apache.usergrid.corepersistence.rx.impl.EdgeScope; +import org.apache.usergrid.corepersistence.util.CpNamingUtils; +import org.apache.usergrid.corepersistence.util.ObjectJsonSerializer; import org.apache.usergrid.persistence.collection.EntityCollectionManager; import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory; import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope; @@ -61,6 +57,7 @@ import org.apache.usergrid.persistence.index.EntityIndex; import org.apache.usergrid.persistence.index.EntityIndexFactory; import org.apache.usergrid.persistence.index.IndexLocationStrategy; import org.apache.usergrid.persistence.index.impl.IndexOperationMessage; +import org.apache.usergrid.persistence.index.impl.IndexProducer; import org.apache.usergrid.persistence.map.MapManager; import org.apache.usergrid.persistence.map.MapManagerFactory; import org.apache.usergrid.persistence.map.MapScope; @@ -78,6 +75,7 @@ import com.codahale.metrics.Counter; import com.codahale.metrics.Gauge; import com.codahale.metrics.Histogram; import com.codahale.metrics.Timer; +import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.inject.Inject; import com.google.inject.Singleton; @@ -94,8 +92,6 @@ public class AmazonAsyncEventService implements AsyncEventService { private static final Logger logger = LoggerFactory.getLogger(AmazonAsyncEventService.class); -private static final ObjectJsonSerializer OBJECT_JSON_SERIALIZER = new
[05/12] usergrid git commit: Makes consistency configurable
Makes consistency configurable Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/19d30eaf Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/19d30eaf Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/19d30eaf Branch: refs/heads/2.1-release Commit: 19d30eafc77095ee74ae126f9d0a849e997b6ad7 Parents: 0326629 Author: Todd NineAuthored: Mon Oct 19 13:59:08 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 13:59:08 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 4 +--- .../map/impl/MapSerializationImpl.java | 21 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/19d30eaf/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 6b2eb45..67d0dab 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -29,9 +29,6 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.google.common.base.Optional; -import org.apache.usergrid.persistence.index.impl.IndexProducer; -import org.apache.usergrid.persistence.queue.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -68,6 +65,7 @@ import org.apache.usergrid.persistence.map.impl.MapScopeImpl; import org.apache.usergrid.persistence.model.entity.Entity; import org.apache.usergrid.persistence.model.entity.Id; import org.apache.usergrid.persistence.model.util.UUIDGenerator; +import org.apache.usergrid.persistence.queue.QueueFig; import org.apache.usergrid.persistence.queue.QueueManager; import org.apache.usergrid.persistence.queue.QueueManagerFactory; import org.apache.usergrid.persistence.queue.QueueMessage; http://git-wip-us.apache.org/repos/asf/usergrid/blob/19d30eaf/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java -- diff --git a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java index 1aa3229..ffe10c9 100644 --- a/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java +++ b/stack/corepersistence/map/src/main/java/org/apache/usergrid/persistence/map/impl/MapSerializationImpl.java @@ -33,6 +33,8 @@ import org.apache.cassandra.db.marshal.UTF8Type; import org.apache.usergrid.persistence.core.astyanax.BucketScopedRowKey; import org.apache.usergrid.persistence.core.astyanax.BucketScopedRowKeySerializer; +import org.apache.usergrid.persistence.core.astyanax.CassandraConfig; +import org.apache.usergrid.persistence.core.astyanax.CassandraFig; import org.apache.usergrid.persistence.core.astyanax.CompositeFieldSerializer; import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamily; import org.apache.usergrid.persistence.core.astyanax.MultiTennantColumnFamilyDefinition; @@ -105,15 +107,9 @@ public class MapSerializationImpl implements MapSerialization { /** * How to funnel keys for buckets */ -private static final Funnel MAP_KEY_FUNNEL = new Funnel() { +private static final Funnel MAP_KEY_FUNNEL = ( key, into ) -> into.putString( key, StringHashUtils.UTF8 ); -@Override -public void funnel( final String key, final PrimitiveSink into ) { -into.putString( key, StringHashUtils.UTF8 ); -} -}; - /** * Locator to get us all buckets */ @@ -121,10 +117,14 @@ public class MapSerializationImpl implements MapSerialization { new ExpandingShardLocator<>( MAP_KEY_FUNNEL, NUM_BUCKETS ); private final Keyspace keyspace; +private final CassandraConfig cassandraConfig; @Inject -public MapSerializationImpl( final Keyspace keyspace ) {this.keyspace = keyspace;} +public MapSerializationImpl( final Keyspace keyspace, final CassandraConfig cassandraConfig ) { +this.keyspace = keyspace; +this.cassandraConfig = cassandraConfig; +} @Override @@ -387,7 +387,7 @@ public class MapSerializationImpl implements
[12/12] usergrid git commit: Fixes incorrect units on timeout from millis to seconds.
Fixes incorrect units on timeout from millis to seconds. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1fe1d1a3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1fe1d1a3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1fe1d1a3 Branch: refs/heads/2.1-release Commit: 1fe1d1a34e806ebfc53d0c6cb729e7e4aab804a1 Parents: e50835f Author: Todd NineAuthored: Tue Oct 20 11:37:03 2015 -0600 Committer: Todd Nine Committed: Tue Oct 20 11:44:35 2015 -0600 -- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/1fe1d1a3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 6f779b5..7034a67 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -25,6 +25,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -491,8 +492,11 @@ public class AmazonAsyncEventService implements AsyncEventService { final UUID newMessageId = UUIDGenerator.newTimeUUID(); +final int expirationTimeInSeconds = +( int ) TimeUnit.MILLISECONDS.toSeconds( indexProcessorFig.getIndexMessageTtl() ); + //write to the map in ES -esMapPersistence.putString( newMessageId.toString(), jsonValue, indexProcessorFig.getIndexMessageTtl() ); +esMapPersistence.putString( newMessageId.toString(), jsonValue, expirationTimeInSeconds );
[07/12] usergrid git commit: Updates the defaults to be more sensible in a multi-region environment
Updates the defaults to be more sensible in a multi-region environment Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3ec0f588 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3ec0f588 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3ec0f588 Branch: refs/heads/2.1-release Commit: 3ec0f5886b82737d4a7ed64fae01afbdb6707763 Parents: 4013f17 Author: Todd NineAuthored: Mon Oct 19 17:44:39 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 17:44:39 2015 -0600 -- .../corepersistence/index/PublishRxTest.java| 95 .../usergrid/corepersistence/index/RxTest.java | 108 +++ .../persistence/core/astyanax/CassandraFig.java | 6 +- 3 files changed, 111 insertions(+), 98 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ec0f588/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/PublishRxTest.java -- diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/PublishRxTest.java b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/PublishRxTest.java deleted file mode 100644 index 973a42d..000 --- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/PublishRxTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.usergrid.corepersistence.index; - - -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; - -import org.junit.Ignore; -import org.junit.Test; - -import rx.Observable; -import rx.Subscription; -import rx.observables.ConnectableObservable; -import rx.schedulers.Schedulers; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - - -/** - * Test to test some assumptions about RX behaviors - */ -public class PublishRxTest { - -@Test -public void testPublish() throws InterruptedException { - -final int count = 10; - -final CountDownLatch latch = new CountDownLatch( count ); - -final Subscription connectedObservable = -Observable.range( 0, count ).doOnNext( integer -> latch.countDown() ).subscribeOn( Schedulers.io() ) - .subscribe(); - - -final boolean completed = latch.await( 5, TimeUnit.SECONDS ); - -assertTrue( "publish1 behaves as expected", completed ); - -final boolean completedSubscription = connectedObservable.isUnsubscribed(); - -assertTrue( "Subscription complete", completedSubscription ); -} - - -@Test -@Ignore("This seems like it should work, yet blocks forever") -public void testConnectableObserver() throws InterruptedException { - -final int count = 10; - -final CountDownLatch latch = new CountDownLatch( count ); - -final ConnectableObservable connectedObservable = Observable.range( 0, count ).publish(); - - -//connect to our latch, which should run on it's own subscription -//start our latch running -connectedObservable.doOnNext( integer -> latch.countDown() ).subscribeOn( Schedulers.io() ).subscribe(); - - -final Observable countObservable = connectedObservable.subscribeOn( Schedulers.io() ).count(); - -//start the sequence -connectedObservable.connect(); - - -final boolean completed = latch.await( 5, TimeUnit.SECONDS ); - -assertTrue( "publish1 behaves as expected", completed ); - -final int returnedCount = countObservable.toBlocking().last(); - -assertEquals( "Counts the same", count, returnedCount ); -} -} http://git-wip-us.apache.org/repos/asf/usergrid/blob/3ec0f588/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java -- diff --git a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java
[08/12] usergrid git commit: Add sourceRegion to ElasticsearchIndexEvent, fix logging statements, update sqs/sns client null checks.
Add sourceRegion to ElasticsearchIndexEvent, fix logging statements, update sqs/sns client null checks. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3a7e60b3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3a7e60b3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3a7e60b3 Branch: refs/heads/2.1-release Commit: 3a7e60b3131e207890354ca5fa84258795296372 Parents: 19d30ea Author: Michael RussoAuthored: Mon Oct 19 17:07:18 2015 -0700 Committer: Michael Russo Committed: Mon Oct 19 17:07:18 2015 -0700 -- .../asyncevents/AmazonAsyncEventService.java| 9 ++--- .../asyncevents/model/ElasticsearchIndexEvent.java | 3 ++- .../persistence/queue/impl/SNSQueueManagerImpl.java | 9 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/3a7e60b3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 67d0dab..2b583b5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -498,7 +498,8 @@ public class AmazonAsyncEventService implements AsyncEventService { //now queue up the index message -final ElasticsearchIndexEvent elasticsearchIndexEvent = new ElasticsearchIndexEvent( newMessageId ); +final ElasticsearchIndexEvent elasticsearchIndexEvent = +new ElasticsearchIndexEvent(queueFig.getPrimaryRegion(), newMessageId ); //send to the topic so all regions index the batch @@ -520,12 +521,14 @@ public class AmazonAsyncEventService implements AsyncEventService { final IndexOperationMessage indexOperationMessage; if(message == null){ -logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level" ); +logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level", +messageId); final String highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); if(highConsistency == null){ -logger.error( "Unable to find the ES batch with id {} to process at a higher consistency level" ); +logger.error( "Unable to find the ES batch with id {} to process at a higher consistency level", +messageId); throw new RuntimeException( "Unable to find the ES batch to process with message id " + messageId ); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/3a7e60b3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java index 207b15e..049c3a5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java @@ -35,7 +35,8 @@ public final class ElasticsearchIndexEvent extends AsyncEvent { public ElasticsearchIndexEvent() { } -public ElasticsearchIndexEvent( UUID indexBatchId ) { +public ElasticsearchIndexEvent(String sourceRegion, UUID indexBatchId) { +super(sourceRegion); this.indexBatchId = indexBatchId; } http://git-wip-us.apache.org/repos/asf/usergrid/blob/3a7e60b3/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 58b2a4d..3c18992 100644 --- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/impl/SNSQueueManagerImpl.java +++
[09/10] usergrid git commit: USERGRID-1044: add region to unlimited load test plus rename "auditRegion" to "usergridRegion" since it can be used for non-audit purposes
USERGRID-1044: add region to unlimited load test plus rename "auditRegion" to "usergridRegion" since it can be used for non-audit purposes Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2f307a75 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2f307a75 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2f307a75 Branch: refs/heads/master Commit: 2f307a75066204a894bd68115518e29064ae56cc Parents: 963a084 Author: Mike DunkerAuthored: Mon Oct 19 12:56:22 2015 -0700 Committer: Mike Dunker Committed: Mon Oct 19 12:56:22 2015 -0700 -- .../runAuditVerifyCollectionEntities.sh | 7 +++ stack/loadtests/runLoadEntitiesUnlimited.sh | 4 +++- .../usergrid/enums/ConfigProperties.scala | 6 +++--- .../org/apache/usergrid/helpers/Headers.scala | 4 ++-- .../usergrid/scenarios/AuditScenarios.scala | 10 - .../scenarios/EntityCollectionScenarios.scala | 22 ++-- .../org/apache/usergrid/settings/Settings.scala | 2 +- stack/loadtests/testConfig.sh | 1 + 8 files changed, 29 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/runAuditVerifyCollectionEntities.sh -- diff --git a/stack/loadtests/runAuditVerifyCollectionEntities.sh b/stack/loadtests/runAuditVerifyCollectionEntities.sh index fa75505..695c9ee 100755 --- a/stack/loadtests/runAuditVerifyCollectionEntities.sh +++ b/stack/loadtests/runAuditVerifyCollectionEntities.sh @@ -28,18 +28,17 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi #RETRY_COUNT= DELETE_AFTER_SUCCESSFUL_AUDIT=false -AUDIT_REGION= die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)[AUDIT_REGION]]]" +[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)[USERGRID_REGION]]]" RAMP_USERS="$1" RAMP_TIME="$2" AUDIT_UUID_FILENAME="$3" FAILED_UUID_FILENAME="$4" [ "$#" -ge 5 ] && DELETE_AFTER_SUCCESSFUL_AUDIT="$5" -[ "$#" -ge 6 ] && AUDIT_REGION="$6" +[ "$#" -ge 6 ] && USERGRID_REGION="$6" shift $# @@ -65,6 +64,6 @@ mvn gatling:execute \ -DfailedUuidFilename=${FAILED_UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ -DdeleteAfterSuccessfulAudit=${DELETE_AFTER_SUCCESSFUL_AUDIT} \ --DauditRegion=${AUDIT_REGION} \ +-DusergridRegion=${USERGRID_REGION} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.AuditSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/runLoadEntitiesUnlimited.sh -- diff --git a/stack/loadtests/runLoadEntitiesUnlimited.sh b/stack/loadtests/runLoadEntitiesUnlimited.sh index 9222a57..11ca0a4 100755 --- a/stack/loadtests/runLoadEntitiesUnlimited.sh +++ b/stack/loadtests/runLoadEntitiesUnlimited.sh @@ -44,7 +44,7 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" +[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT [USERGRID_REGION]" RAMP_USERS="$1" RAMP_TIME="$2" @@ -52,6 +52,7 @@ RAMP_TIME="$2" [ "$#" -ge 4 ] && ENTITY_SEED="$4" [ "$#" -ge 5 ] && ENTITY_WORKER_NUM="$5" [ "$#" -ge 6 ] && ENTITY_WORKER_COUNT="$6" +[ "$#" -ge 7 ] && USERGRID_REGION="$6" shift $# @@ -97,5 +98,6 @@ mvn gatling:execute \ -DrampTime=${RAMP_TIME} \ -DuuidFilename=${UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ +-DusergridRegion=${USERGRID_REGION} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.ConfigurableSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala index d825bb6..f74222e 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala +++
[01/10] usergrid git commit: USERGRID-1044: support for multi-worker tests without end that can be audited
Repository: usergrid Updated Branches: refs/heads/master 59edea1c2 -> 1393c2f76 USERGRID-1044: support for multi-worker tests without end that can be audited Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/a9927a3b Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/a9927a3b Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/a9927a3b Branch: refs/heads/master Commit: a9927a3baa23bcd30dcacb4255af649c38ed3d90 Parents: 91fa489 Author: Mike DunkerAuthored: Tue Oct 6 14:24:40 2015 -0700 Committer: Mike Dunker Committed: Tue Oct 6 14:24:40 2015 -0700 -- stack/loadtests/runDeleteEntities.sh| 13 ++- stack/loadtests/runLoadEntitiesUnlimited.sh | 101 +++ .../datagenerators/FeederGenerator.scala| 9 +- .../usergrid/enums/ConfigProperties.scala | 11 +- .../apache/usergrid/helpers/Extractors.scala| 10 ++ .../scenarios/EntityCollectionScenarios.scala | 27 +++-- .../org/apache/usergrid/settings/Settings.scala | 94 - stack/loadtests/testConfig.sh | 2 + 8 files changed, 227 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/a9927a3b/stack/loadtests/runDeleteEntities.sh -- diff --git a/stack/loadtests/runDeleteEntities.sh b/stack/loadtests/runDeleteEntities.sh index 2013e89..d0da19b 100755 --- a/stack/loadtests/runDeleteEntities.sh +++ b/stack/loadtests/runDeleteEntities.sh @@ -42,24 +42,27 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [NUM_ENTITIES [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" +[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) ENTITY_PREFIX [NUM_ENTITIES [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" RAMP_USERS="$1" RAMP_TIME="$2" -[ "$#" -ge 3 ] && NUM_ENTITIES="$3" -[ "$#" -ge 4 ] && ENTITY_SEED="$4" -[ "$#" -ge 5 ] && ENTITY_WORKER_NUM="$5" -[ "$#" -ge 6 ] && ENTITY_WORKER_COUNT="$6" +ENTITY_PREFIX="$3" +[ "$#" -ge 4 ] && NUM_ENTITIES="$4" +[ "$#" -ge 5 ] && ENTITY_SEED="$5" +[ "$#" -ge 6 ] && ENTITY_WORKER_NUM="$6" +[ "$#" -ge 7 ] && ENTITY_WORKER_COUNT="$7" shift $# SCENARIO_TYPE=deleteEntities +INTERLEAVED_WORKER_FEED=true #Compile everything mvn compile #Execute the test mvn gatling:execute \ +-DinterleavedWorkerFeed=${INTERLEAVED_WORKER_FEED} \ -DbaseUrl=${URL} \ -DadminUser=${ADMIN_USER} \ -DadminPassword=${ADMIN_PASSWORD} \ http://git-wip-us.apache.org/repos/asf/usergrid/blob/a9927a3b/stack/loadtests/runLoadEntitiesUnlimited.sh -- diff --git a/stack/loadtests/runLoadEntitiesUnlimited.sh b/stack/loadtests/runLoadEntitiesUnlimited.sh new file mode 100755 index 000..9222a57 --- /dev/null +++ b/stack/loadtests/runLoadEntitiesUnlimited.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +. "$DIR/testConfig.sh" + +# from testConfig.sh +#URL= +#ADMIN_USER= +#ADMIN_PASSWORD= +#ENTITY_WORKER_NUM= #may be overridden on command line +#ENTITY_WORKER_COUNT= #may be overridden on command line +#ORG= +#APP= +#AUTH_TYPE= +#TOKEN_TYPE= +#CREATE_ORG= +#CREATE_APP= +#SANDBOX_COLLECTION= +#NUM_ENTITIES= #ignored +#SKIP_SETUP= +#COLLECTION= +#ENTITY_TYPE= +#ENTITY_PREFIX= +#ENTITY_SEED= #may be overridden on command line +#RETRY_COUNT= +#ENTITY_PROGRESS_COUNT= +#CONSTANT_USERS_PER_SEC= +#CONSTANT_USERS_DURATION= +#FLUSH_CSV + +die() { echo "$@" 1>&2 ; exit 1; } + +[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" + +RAMP_USERS="$1" +RAMP_TIME="$2" +[ "$#" -ge 3 ] && UUID_FILENAME="$3" +[ "$#" -ge 4 ] && ENTITY_SEED="$4" +[ "$#" -ge 5 ] && ENTITY_WORKER_NUM="$5" +[ "$#" -ge 6 ] && ENTITY_WORKER_COUNT="$6" + +shift $# + +SCENARIO_TYPE=loadEntities
[07/11] usergrid git commit: Fixes comments and refactors map to be a cleaner read pattern
Fixes comments and refactors map to be a cleaner read pattern Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e50835f1 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e50835f1 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e50835f1 Branch: refs/heads/remove-inmemory-event-service Commit: e50835f1016a9988513a00b64337222957fa7747 Parents: fbb6c82 Author: Todd NineAuthored: Tue Oct 20 09:34:43 2015 -0600 Committer: Todd Nine Committed: Tue Oct 20 09:34:43 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 2 +- .../core/astyanax/CassandraConfig.java | 8 ++--- .../core/astyanax/CassandraConfigImpl.java | 1 + .../map/impl/MapSerializationImpl.java | 37 .../queue/impl/SNSQueueManagerImpl.java | 4 +-- 5 files changed, 14 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 38c2966..6f779b5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -521,7 +521,7 @@ public class AmazonAsyncEventService implements AsyncEventService { final IndexOperationMessage indexOperationMessage; if(message == null){ -logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level", +logger.warn( "Received message with id {} to process, unable to find it, reading with higher consistency level", messageId); final String highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java index 817aee2..dba3646 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java @@ -34,25 +34,25 @@ public interface CassandraConfig { * Get the currently configured ReadCL * @return */ -public ConsistencyLevel getReadCL(); +ConsistencyLevel getReadCL(); /** * Get the currently configured ReadCL that is more consitent than getReadCL * @return */ -public ConsistencyLevel getConsistentReadCL(); +ConsistencyLevel getConsistentReadCL(); /** * Get the currently configured write CL * @return */ -public ConsistencyLevel getWriteCL(); +ConsistencyLevel getWriteCL(); /** * Return the number of shards that has been set in the property file * @return */ -public int[] getShardSettings(); +int[] getShardSettings(); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java index 17b91c6..7373322 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java @@ -83,6 +83,7 @@ public class CassandraConfigImpl implements CassandraConfig { public ConsistencyLevel getConsistentReadCL() { return consistentCl; } + @Override public ConsistencyLevel getWriteCL() { return writeCl;
[11/11] usergrid git commit: Merge branch 'master' into remove-inmemory-event-service
Merge branch 'master' into remove-inmemory-event-service Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/fad8ecdb Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fad8ecdb Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fad8ecdb Branch: refs/heads/remove-inmemory-event-service Commit: fad8ecdb08e58a9a72a9268763dfee48e87d2b55 Parents: 5eed63d 59edea1 Author: Shawn FeldmanAuthored: Tue Oct 20 13:16:30 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 13:16:30 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 15 ++- .../model/ElasticsearchIndexEvent.java | 3 +- .../corepersistence/index/PublishRxTest.java| 95 .../usergrid/corepersistence/index/RxTest.java | 108 +++ .../core/astyanax/CassandraConfig.java | 8 +- .../core/astyanax/CassandraConfigImpl.java | 1 + .../persistence/core/astyanax/CassandraFig.java | 6 +- .../map/impl/MapSerializationImpl.java | 37 ++- .../queue/impl/SNSQueueManagerImpl.java | 10 +- 9 files changed, 140 insertions(+), 143 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/fad8ecdb/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/fad8ecdb/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java -- diff --cc stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java index 000,1d940d0..d7b0bdb mode 00,100644..100644 --- a/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java +++ b/stack/core/src/test/java/org/apache/usergrid/corepersistence/index/RxTest.java @@@ -1,0 -1,108 +1,108 @@@ + /* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + package org.apache.usergrid.corepersistence.index; + + + import java.util.concurrent.CountDownLatch; + import java.util.concurrent.TimeUnit; + + import org.junit.Ignore; + import org.junit.Test; + + import rx.Observable; + import rx.Subscription; + import rx.observables.ConnectableObservable; + import rx.schedulers.Schedulers; + + import static org.junit.Assert.assertEquals; + import static org.junit.Assert.assertTrue; + + + /** + * Test to test some assumptions about RX behaviors + */ + public class RxTest { + + @Test + public void testPublish() throws InterruptedException { + + final int count = 10; + + final CountDownLatch latch = new CountDownLatch( count ); + + final Subscription connectedObservable = + Observable.range( 0, count ).doOnNext( integer -> latch.countDown() ).subscribeOn( Schedulers.io() ) + .subscribe(); + + -final boolean completed = latch.await( 5, TimeUnit.SECONDS ); ++final boolean completed = latch.await( 3, TimeUnit.SECONDS ); + + assertTrue( "publish1 behaves as expected", completed ); + + final boolean completedSubscription = connectedObservable.isUnsubscribed(); + + assertTrue( "Subscription complete", completedSubscription ); + } + + + @Test + @Ignore("This seems like it should work, yet blocks forever") + public void testConnectableObserver() throws InterruptedException { + + final int count = 10; + + final CountDownLatch latch = new CountDownLatch( count ); + + final ConnectableObservable connectedObservable = Observable.range( 0, count ).publish(); + + + //connect to our latch, which should run on it's own subscription + //start our latch running + connectedObservable.doOnNext( integer -> latch.countDown() ).subscribeOn( Schedulers.io() ).subscribe(); + + + final Observable countObservable =
[10/11] usergrid git commit: Merge branch 'USERGRID-1048' of https://git-wip-us.apache.org/repos/asf/usergrid
Merge branch 'USERGRID-1048' of https://git-wip-us.apache.org/repos/asf/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/59edea1c Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/59edea1c Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/59edea1c Branch: refs/heads/remove-inmemory-event-service Commit: 59edea1c2a8a2c182daad4ee7f3e42c295984b86 Parents: 5f62e4c 1fe1d1a Author: Shawn FeldmanAuthored: Tue Oct 20 13:13:12 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 13:13:12 2015 -0600 -- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) --
[09/11] usergrid git commit: Fixes incorrect units on timeout from millis to seconds.
Fixes incorrect units on timeout from millis to seconds. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1fe1d1a3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1fe1d1a3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1fe1d1a3 Branch: refs/heads/remove-inmemory-event-service Commit: 1fe1d1a34e806ebfc53d0c6cb729e7e4aab804a1 Parents: e50835f Author: Todd NineAuthored: Tue Oct 20 11:37:03 2015 -0600 Committer: Todd Nine Committed: Tue Oct 20 11:44:35 2015 -0600 -- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/1fe1d1a3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 6f779b5..7034a67 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -25,6 +25,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -491,8 +492,11 @@ public class AmazonAsyncEventService implements AsyncEventService { final UUID newMessageId = UUIDGenerator.newTimeUUID(); +final int expirationTimeInSeconds = +( int ) TimeUnit.MILLISECONDS.toSeconds( indexProcessorFig.getIndexMessageTtl() ); + //write to the map in ES -esMapPersistence.putString( newMessageId.toString(), jsonValue, indexProcessorFig.getIndexMessageTtl() ); +esMapPersistence.putString( newMessageId.toString(), jsonValue, expirationTimeInSeconds );
[08/10] usergrid git commit: USERGRID-1044: add optional region header functionality to most requests
USERGRID-1044: add optional region header functionality to most requests Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/963a0841 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/963a0841 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/963a0841 Branch: refs/heads/master Commit: 963a08417aa66eea567301e2592751d051a1a73c Parents: 06e3fa4 Author: Mike DunkerAuthored: Mon Oct 19 11:07:41 2015 -0700 Committer: Mike Dunker Committed: Mon Oct 19 11:07:41 2015 -0700 -- .../org/apache/usergrid/scenarios/AuditScenarios.scala | 3 +++ .../usergrid/scenarios/EntityCollectionScenarios.scala | 11 +++ 2 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/963a0841/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index bd0d007..be754f4 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -58,6 +58,7 @@ object AuditScenarios { http("GET collections") .get(collectionGetUrl(false)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200),extractAuditEntities(SessionVarCollectionEntities),maybeExtractCursor(SessionVarCursor))) .foreach("${" + SessionVarCollectionEntities + "}", "singleResult") { exec(session => { @@ -75,6 +76,7 @@ object AuditScenarios { http("GET collections") .get(collectionGetUrl(true)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200),extractAuditEntities(SessionVarCollectionEntities),maybeExtractCursor(SessionVarCursor))) .foreach("${" + SessionVarCollectionEntities + "}", "singleResult") { exec(session => { @@ -118,6 +120,7 @@ object AuditScenarios { http("DELETE audited entity") .delete("/${collectionName}/${uuid}") .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(extractEntityUuid(SessionVarDeletedUuid))) .exec(session => { val uuid = session(SessionVarDeletedUuid).as[String] http://git-wip-us.apache.org/repos/asf/usergrid/blob/963a0841/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala index de95920..bc3cf8c 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala @@ -73,6 +73,7 @@ object EntityCollectionScenarios { http("GET entities") .get(entityGetUrl(false)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200), maybeExtractCursor(SessionVarCursor)) ) @@ -80,6 +81,7 @@ object EntityCollectionScenarios { http("GET entities") .get(entityGetUrl(true)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200), maybeExtractCursor(SessionVarCursor)) ) @@ -110,6 +112,7 @@ object EntityCollectionScenarios { http("GET entity by name (anonymous)") .get(randomEntityNameUrl()) .headers(Headers.authAnonymous) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -117,6 +120,7 @@ object EntityCollectionScenarios { http("GET entity by name (token)") .get(randomEntityNameUrl()) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -153,6 +157,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${uuid}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authAnonymous) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -161,6 +166,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${uuid}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -207,6 +213,7 @@ object EntityCollectionScenarios {
[04/10] usergrid git commit: USERGRID-1044: if query audit fails, try direct access
USERGRID-1044: if query audit fails, try direct access Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2757e905 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2757e905 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2757e905 Branch: refs/heads/master Commit: 2757e905d9a2cf38adf426df6604dd78e8a512ac Parents: b62ad30 Author: Mike DunkerAuthored: Thu Oct 15 09:34:14 2015 -0700 Committer: Mike Dunker Committed: Thu Oct 15 09:34:14 2015 -0700 -- .../usergrid/scenarios/AuditScenarios.scala | 40 ++-- .../org/apache/usergrid/settings/Settings.scala | 19 +++--- 2 files changed, 50 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2757e905/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index aaabf99..905c652 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -131,6 +131,38 @@ object AuditScenarios { session }) + val getCollectionEntityDirect = exec( +http("GET collection entity direct") + .get("/${collectionName}/${uuid}") + .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) + .check(status.is(200),jsonPath("$.count").optional.saveAs("count"),extractAuditEntities(SessionVarCollectionEntities))) + .exec(session => { +val count = session("count").as[String].toInt +val uuid = session("uuid").as[String] +val entityName = session("name").as[String] +val modified = session("modified").as[String].toLong +val collectionName = session(SessionVarCollectionName).as[String] + +if (count < 1) { + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditNotFoundAtAll() + println(s"NOT FOUND AT ALL: $collectionName.$entityName ($uuid)") +} else if (count == 1) { + // found via direct access but not query + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditNotFoundViaQuery() + println(s"NOT FOUND VIA QUERY: $collectionName.$entityName ($uuid)") +} else { + // count > 1 -> invalid + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditBadResponse() + println(s"INVALID RESPONSE (count=$count): $collectionName.$entityName ($uuid)") +} + +session + }) + val getCollectionEntity = exec( http("GET collection entity") .get("/${collectionName}?ql=uuid=${uuid}") @@ -145,20 +177,22 @@ object AuditScenarios { val collectionName = session(SessionVarCollectionName).as[String] if (count < 1) { - Settings.addAuditUuid(uuid, collectionName, entityName, modified) - Settings.incAuditNotFound() - println(s"NOT FOUND: $collectionName.$entityName ($uuid)") + // will check to see whether accessible directly } else if (count > 1) { Settings.addAuditUuid(uuid, collectionName, entityName, modified) Settings.incAuditBadResponse() println(s"INVALID RESPONSE (count=$count): $collectionName.$entityName ($uuid)") } else { + // count == 1 -> success // println(s"FOUND: $collectionName.$entityName ($uuid)") Settings.incAuditSuccess() } session }) + .doIf(session => session("count").as[String].toInt < 1) { +exec(getCollectionEntityDirect) + } .doIf(session => Settings.deleteAfterSuccessfulAudit && session("count").as[String].toInt == 1) { // tryMax(Settings.retryCount) { exec(deleteAuditedEntity) http://git-wip-us.apache.org/repos/asf/usergrid/blob/2757e905/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala index 979fb3f..374440d 100755 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala @@ -429,7 +429,8 @@ object Settings { } private val countAuditSuccess = new
[04/11] usergrid git commit: Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized.
Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/fbb6c823 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fbb6c823 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fbb6c823 Branch: refs/heads/remove-inmemory-event-service Commit: fbb6c823b7e2a1f5f55ab044942b38d1157970c0 Parents: d8e6572 Author: Michael RussoAuthored: Mon Oct 19 21:28:46 2015 -0700 Committer: Michael Russo Committed: Mon Oct 19 21:28:46 2015 -0700 -- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java| 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/fbb6c823/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 3c18992..1bb00dc 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 @@ -543,6 +543,11 @@ public class SNSQueueManagerImpl implements QueueManager { @Override public void sendMessages( final List bodies ) throws IOException { +if ( sqsAsync == null ) { +logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); +return; +} + for ( Object body : bodies ) { sendMessage( ( Serializable ) body ); }
[10/10] usergrid git commit: Merge commit 'refs/pull/403/head' of github.com:apache/usergrid
Merge commit 'refs/pull/403/head' of github.com:apache/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1393c2f7 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1393c2f7 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1393c2f7 Branch: refs/heads/master Commit: 1393c2f76e44150352497f661907801151807806 Parents: 59edea1 2f307a7 Author: Michael RussoAuthored: Tue Oct 20 12:18:48 2015 -0700 Committer: Michael Russo Committed: Tue Oct 20 12:18:48 2015 -0700 -- .../runAuditVerifyCollectionEntities.sh | 11 +- stack/loadtests/runDeleteEntities.sh| 13 +- stack/loadtests/runLoadEntitiesUnlimited.sh | 103 + .../datagenerators/FeederGenerator.scala| 9 +- .../usergrid/enums/ConfigProperties.scala | 15 +- .../apache/usergrid/helpers/Extractors.scala| 24 ++- .../org/apache/usergrid/helpers/Headers.scala | 7 + .../usergrid/scenarios/AuditScenarios.scala | 121 ++- .../scenarios/EntityCollectionScenarios.scala | 38 - .../org/apache/usergrid/settings/Settings.scala | 150 +++ stack/loadtests/testConfig.sh | 3 + 11 files changed, 435 insertions(+), 59 deletions(-) --
[02/11] usergrid git commit: Add sourceRegion to ElasticsearchIndexEvent, fix logging statements, update sqs/sns client null checks.
Add sourceRegion to ElasticsearchIndexEvent, fix logging statements, update sqs/sns client null checks. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3a7e60b3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3a7e60b3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3a7e60b3 Branch: refs/heads/remove-inmemory-event-service Commit: 3a7e60b3131e207890354ca5fa84258795296372 Parents: 19d30ea Author: Michael RussoAuthored: Mon Oct 19 17:07:18 2015 -0700 Committer: Michael Russo Committed: Mon Oct 19 17:07:18 2015 -0700 -- .../asyncevents/AmazonAsyncEventService.java| 9 ++--- .../asyncevents/model/ElasticsearchIndexEvent.java | 3 ++- .../persistence/queue/impl/SNSQueueManagerImpl.java | 9 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/3a7e60b3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 67d0dab..2b583b5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -498,7 +498,8 @@ public class AmazonAsyncEventService implements AsyncEventService { //now queue up the index message -final ElasticsearchIndexEvent elasticsearchIndexEvent = new ElasticsearchIndexEvent( newMessageId ); +final ElasticsearchIndexEvent elasticsearchIndexEvent = +new ElasticsearchIndexEvent(queueFig.getPrimaryRegion(), newMessageId ); //send to the topic so all regions index the batch @@ -520,12 +521,14 @@ public class AmazonAsyncEventService implements AsyncEventService { final IndexOperationMessage indexOperationMessage; if(message == null){ -logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level" ); +logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level", +messageId); final String highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); if(highConsistency == null){ -logger.error( "Unable to find the ES batch with id {} to process at a higher consistency level" ); +logger.error( "Unable to find the ES batch with id {} to process at a higher consistency level", +messageId); throw new RuntimeException( "Unable to find the ES batch to process with message id " + messageId ); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/3a7e60b3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java index 207b15e..049c3a5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/model/ElasticsearchIndexEvent.java @@ -35,7 +35,8 @@ public final class ElasticsearchIndexEvent extends AsyncEvent { public ElasticsearchIndexEvent() { } -public ElasticsearchIndexEvent( UUID indexBatchId ) { +public ElasticsearchIndexEvent(String sourceRegion, UUID indexBatchId) { +super(sourceRegion); this.indexBatchId = indexBatchId; } http://git-wip-us.apache.org/repos/asf/usergrid/blob/3a7e60b3/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 58b2a4d..3c18992 100644 ---
[01/15] usergrid git commit: Adds strong consistency read to maps. Persists ES batches into Cassandra for multi region execution.
Repository: usergrid Updated Branches: refs/heads/master a679aea4a -> 59edea1c2 Adds strong consistency read to maps. Persists ES batches into Cassandra for multi region execution. A bug in wiring JSON to SQS still exists, it's incorrectly escaping some message subtypes. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/94a90781 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/94a90781 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/94a90781 Branch: refs/heads/master Commit: 94a9078125fc32d755e33e562f8e8fd8624641c1 Parents: 2b22c61 Author: Todd NineAuthored: Fri Oct 16 18:02:44 2015 -0600 Committer: Todd Nine Committed: Fri Oct 16 18:02:44 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 186 +++--- .../asyncevents/AsyncEventService.java | 1 + .../asyncevents/AsyncIndexProvider.java | 22 +- .../asyncevents/model/AsyncEvent.java | 3 +- .../model/ElasticsearchIndexEvent.java | 50 .../index/IndexProcessorFig.java| 8 + .../util/ObjectJsonSerializer.java | 74 ++ .../index/AmazonAsyncEventServiceTest.java | 6 +- .../index/AsyncIndexServiceTest.java| 2 +- .../usergrid/persistence/map/MapManager.java| 25 +- .../persistence/map/impl/MapManagerImpl.java| 6 + .../persistence/map/impl/MapSerialization.java | 27 +- .../map/impl/MapSerializationImpl.java | 248 ++- .../index/impl/DeIndexOperation.java| 4 + .../persistence/index/impl/IndexOperation.java | 4 + .../index/impl/IndexOperationMessage.java | 5 + .../persistence/queue/DefaultQueueManager.java | 12 +- .../persistence/queue/QueueManager.java | 8 +- .../queue/impl/SNSQueueManagerImpl.java | 188 ++ .../queue/impl/SQSQueueManagerImpl.java | 28 ++- .../services/queues/ImportQueueManager.java | 9 +- 21 files changed, 666 insertions(+), 250 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/94a90781/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 95126c6..c9f0953 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -21,13 +21,20 @@ package org.apache.usergrid.corepersistence.asyncevents; import java.io.IOException; +import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; import com.google.common.base.Optional; + +import org.apache.usergrid.corepersistence.asyncevents.model.ElasticsearchIndexEvent; +import org.apache.usergrid.corepersistence.util.CpNamingUtils; +import org.apache.usergrid.corepersistence.util.ObjectJsonSerializer; +import org.apache.usergrid.exception.NotImplementedException; import org.apache.usergrid.persistence.index.impl.IndexProducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,8 +61,13 @@ import org.apache.usergrid.persistence.index.EntityIndex; import org.apache.usergrid.persistence.index.EntityIndexFactory; import org.apache.usergrid.persistence.index.IndexLocationStrategy; import org.apache.usergrid.persistence.index.impl.IndexOperationMessage; +import org.apache.usergrid.persistence.map.MapManager; +import org.apache.usergrid.persistence.map.MapManagerFactory; +import org.apache.usergrid.persistence.map.MapScope; +import org.apache.usergrid.persistence.map.impl.MapScopeImpl; import org.apache.usergrid.persistence.model.entity.Entity; import org.apache.usergrid.persistence.model.entity.Id; +import org.apache.usergrid.persistence.model.util.UUIDGenerator; import org.apache.usergrid.persistence.queue.QueueManager; import org.apache.usergrid.persistence.queue.QueueManagerFactory; import org.apache.usergrid.persistence.queue.QueueMessage; @@ -82,12 +94,13 @@ public class AmazonAsyncEventService implements AsyncEventService { private static final Logger logger = LoggerFactory.getLogger(AmazonAsyncEventService.class); +private static final ObjectJsonSerializer OBJECT_JSON_SERIALIZER = new ObjectJsonSerializer( ); + // SQS maximum receive messages is 10
[15/15] usergrid git commit: Merge branch 'USERGRID-1048' of https://git-wip-us.apache.org/repos/asf/usergrid
Merge branch 'USERGRID-1048' of https://git-wip-us.apache.org/repos/asf/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/59edea1c Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/59edea1c Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/59edea1c Branch: refs/heads/master Commit: 59edea1c2a8a2c182daad4ee7f3e42c295984b86 Parents: 5f62e4c 1fe1d1a Author: Shawn FeldmanAuthored: Tue Oct 20 13:13:12 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 13:13:12 2015 -0600 -- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) --
Git Push Summary
Repository: usergrid Updated Branches: refs/heads/two-dot-o [deleted] 543d2b4eb
Git Push Summary
Repository: usergrid Updated Branches: refs/heads/USERGRID-1048 [deleted] 1fe1d1a34
[03/15] usergrid git commit: Merge branch 'refs/heads/2.1-release' into USERGRID-1048
Merge branch 'refs/heads/2.1-release' into USERGRID-1048 Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3e155852 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3e155852 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3e155852 Branch: refs/heads/master Commit: 3e1558524728c96834cfd66d9e53e3f1b6a7d3d6 Parents: 04a3f47 a09485a Author: Todd NineAuthored: Mon Oct 19 13:30:04 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 13:30:04 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 149 ++- .../asyncevents/AsyncIndexProvider.java | 26 ++-- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 -- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 2 +- .../queue/impl/SNSQueueManagerImpl.java | 8 +- 13 files changed, 135 insertions(+), 256 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/3e155852/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index d319ac8,c198674..f8ef5e7 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@@ -97,7 -84,9 +100,8 @@@ public class AmazonAsyncEventService im public static final String QUEUE_NAME = "index"; //keep this short as AWS limits queue name size to 80 chars private final QueueManager queue; -private final QueueScope queueScope; private final IndexProcessorFig indexProcessorFig; + private final QueueFig queueFig; private final IndexProducer indexProducer; private final EntityCollectionManagerFactory entityCollectionManagerFactory; private final IndexLocationStrategyFactory indexLocationStrategyFactory; @@@ -125,33 -113,28 +129,35 @@@ @Inject -public AmazonAsyncEventService(final QueueManagerFactory queueManagerFactory, - final IndexProcessorFig indexProcessorFig, - final IndexProducer indexProducer, - final MetricsFactory metricsFactory, - final EntityCollectionManagerFactory entityCollectionManagerFactory, - final IndexLocationStrategyFactory indexLocationStrategyFactory, - final EntityIndexFactory entityIndexFactory, - final EventBuilder eventBuilder, - final RxTaskScheduler rxTaskScheduler, - QueueFig queueFig) { +public AmazonAsyncEventService( final QueueManagerFactory queueManagerFactory, +final IndexProcessorFig indexProcessorFig, +final IndexProducer indexProducer, +final MetricsFactory metricsFactory, +final EntityCollectionManagerFactory entityCollectionManagerFactory, +final IndexLocationStrategyFactory indexLocationStrategyFactory, +final EntityIndexFactory entityIndexFactory, +final EventBuilder eventBuilder, +final MapManagerFactory mapManagerFactory, ++final QueueFig queueFig, +final RxTaskScheduler rxTaskScheduler ) { this.indexProducer = indexProducer; this.entityCollectionManagerFactory = entityCollectionManagerFactory; this.indexLocationStrategyFactory = indexLocationStrategyFactory; this.entityIndexFactory = entityIndexFactory; this.eventBuilder = eventBuilder; + +final MapScope mapScope = new MapScopeImpl( CpNamingUtils.getManagementApplicationId(), "indexEvents"); + +this.esMapPersistence =
[05/10] usergrid git commit: USERGRID-1044: fix direct access on query failure
USERGRID-1044: fix direct access on query failure and log when name/uuid error/mismatch in payload occurs Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/9e813810 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/9e813810 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/9e813810 Branch: refs/heads/master Commit: 9e813810756a1b48a23b1bac4d7cec6bc326f186 Parents: 2757e90 Author: Mike DunkerAuthored: Thu Oct 15 13:16:04 2015 -0700 Committer: Mike Dunker Committed: Thu Oct 15 13:16:04 2015 -0700 -- .../apache/usergrid/helpers/Extractors.scala| 18 - .../usergrid/scenarios/AuditScenarios.scala | 84 +++- .../scenarios/EntityCollectionScenarios.scala | 6 +- .../org/apache/usergrid/settings/Settings.scala | 19 + 4 files changed, 100 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/9e813810/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala index 8a18053..136a561 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala @@ -41,9 +41,9 @@ object Extractors { } /** - * Will extract the uuid from the create response. If the uuid is not present, an empty string will be set + * Will extract the uuid from the response. If the uuid is not present, an empty string will be set */ - def extractCreateUuid(saveAsName: String) = { + def extractEntityUuid(saveAsName: String) = { jsonPath("$.entities[0].uuid").transformOption(extract => { //it may or may not be present. If it is, save it, otherwise save it as an empty string extract.orElse(Some("")) @@ -51,9 +51,19 @@ object Extractors { } /** - * Will extract the modified date from the create response. If the modified field is not present, -1 will be set + * Will extract the name from the response. If the name is not present, an empty string will be set */ - def extractCreateModified(saveAsName: String) = { + def extractEntityName(saveAsName: String) = { +jsonPath("$.entities[0].name").transformOption(extract => { + //it may or may not be present. If it is, save it, otherwise save it as an empty string + extract.orElse(Some("")) +}).saveAs(saveAsName) + } + + /** + * Will extract the modified date from the response. If the modified field is not present, -1 will be set + */ + def extractEntityModified(saveAsName: String) = { jsonPath("$.entities[0].modified").ofType[Long].transformOption(extract => { //it may or may not be present. If it is, save it, otherwise save it as -1 extract.orElse(Some(-1)) http://git-wip-us.apache.org/repos/asf/usergrid/blob/9e813810/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index 905c652..0b798a8 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -32,7 +32,8 @@ object AuditScenarios { //The value for the cursor val SessionVarCursor: String = "cursor" - val SessionVarUuid: String = "entityUuid" + val SessionVarEntityUuid: String = "entityUuid" + val SessionVarEntityName: String = "entityName" val SessionVarDeletedUuid: String = "deletedUuid" val SessionVarCollectionName: String = "collectionName" val SessionVarCollectionEntities: String = "collectionEntities" @@ -117,7 +118,7 @@ object AuditScenarios { http("DELETE audited entity") .delete("/${collectionName}/${uuid}") .headers(Headers.authToken) - .check(extractCreateUuid(SessionVarDeletedUuid))) + .check(extractEntityUuid(SessionVarDeletedUuid))) .exec(session => { val uuid = session(SessionVarDeletedUuid).as[String] @@ -136,28 +137,50 @@ object AuditScenarios { .get("/${collectionName}/${uuid}") .headers(Headers.authToken) .headers(Headers.auditRegionHeaders) - .check(status.is(200),jsonPath("$.count").optional.saveAs("count"),extractAuditEntities(SessionVarCollectionEntities))) + .check() +
[2/2] usergrid git commit: Jacoco reports now built into every module w/instructions in Coverage.md.
Jacoco reports now built into every module w/instructions in Coverage.md. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/29f5717f Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/29f5717f Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/29f5717f Branch: refs/heads/jacoco Commit: 29f5717fcec50bdeea41b4175a31f84a7921fe7b Parents: 0f6f052 Author: Dave JohnsonAuthored: Tue Oct 20 13:42:18 2015 -0400 Committer: Dave Johnson Committed: Tue Oct 20 13:42:18 2015 -0400 -- stack/Coverage.md| 21 + stack/corepersistence/graph/pom.xml | 106 -- stack/corepersistence/pom.xml| 9 +++ stack/corepersistence/queryindex/pom.xml | 46 +-- stack/pom.xml| 7 -- 5 files changed, 86 insertions(+), 103 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/29f5717f/stack/Coverage.md -- diff --git a/stack/Coverage.md b/stack/Coverage.md new file mode 100644 index 000..a2c1e47 --- /dev/null +++ b/stack/Coverage.md @@ -0,0 +1,21 @@ +Generating Coverage reports +--- + +run this command: mvn verify jacoco:report + +Once you do that the below coverage reports will be available. + +Coverage reports +--- + +* [./core/target/site/jacoco/index.html](file:./core/target/site/jacoco/index.html) +* [./corepersistence/collection/target/site/jacoco/index.html](file:./corepersistence/collection/target/site/jacoco/index.html) +* [./corepersistence/common/target/site/jacoco/index.html](file:./corepersistence/common/target/site/jacoco/index.html) +* [./corepersistence/graph/target/site/jacoco/index.html](file:./corepersistence/graph/target/site/jacoco/index.html) +* [./corepersistence/map/target/site/jacoco/index.html](file:./corepersistence/map/target/site/jacoco/index.html) +* [./corepersistence/model/target/site/jacoco/index.html](file:./corepersistence/model/target/site/jacoco/index.html) +* [./corepersistence/queryindex/target/site/jacoco/index.html](file:./corepersistence/queryindex/target/site/jacoco/index.html) +* [./corepersistence/queue/target/site/jacoco/index.html](file:./corepersistence/queue/target/site/jacoco/index.html) +* [./services/target/site/jacoco/index.html](file:./services/target/site/jacoco/index.html) +* [./rest/target/site/jacoco/index.html](file:./services/target/site/jacoco/index.html) + http://git-wip-us.apache.org/repos/asf/usergrid/blob/29f5717f/stack/corepersistence/graph/pom.xml -- diff --git a/stack/corepersistence/graph/pom.xml b/stack/corepersistence/graph/pom.xml index 776380f..4a3a8a7 100644 --- a/stack/corepersistence/graph/pom.xml +++ b/stack/corepersistence/graph/pom.xml @@ -34,20 +34,6 @@ Usergrid Graph - - - - -org.apache.maven.plugins -maven-surefire-plugin -${surefire.plugin.version} - - -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec - - - - - @@ -106,64 +92,36 @@ - - - - - - -org.apache.maven.plugins -maven-surefire-plugin - - - -**/*ChopTest.java -**/*LoadTest.java -**/*StressTest.java - - - - - - + + + + +org.apache.maven.plugins +maven-surefire-plugin +${surefire.plugin.version} + + + -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec + + + + + +org.apache.maven.plugins +maven-surefire-plugin + + + +**/*ChopTest.java +**/*LoadTest.java +**/*StressTest.java + + + + + + + + http://git-wip-us.apache.org/repos/asf/usergrid/blob/29f5717f/stack/corepersistence/pom.xml -- diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml index 09effb5..b98139c 100644 --- a/stack/corepersistence/pom.xml +++
[1/3] usergrid git commit: Update the visibility timeout used when taking messages from SQS as it overrides the queue's configured/default timeout. Also change the queue's visibility timeout property
Repository: usergrid Updated Branches: refs/heads/master e7c805f1e -> a679aea4a Update the visibility timeout used when taking messages from SQS as it overrides the queue's configured/default timeout. Also change the queue's visibility timeout property to be exposed as milliseconds for consistency. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2b22c610 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2b22c610 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2b22c610 Branch: refs/heads/master Commit: 2b22c610ddc3b9f9f08777fe5467713efe2ba553 Parents: 0f589f6 Author: Michael RussoAuthored: Thu Oct 15 10:23:29 2015 -0700 Committer: Michael Russo Committed: Thu Oct 15 10:23:29 2015 -0700 -- .../usergrid/corepersistence/index/IndexProcessorFig.java | 7 +++ .../java/org/apache/usergrid/persistence/queue/QueueFig.java | 6 +++--- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java | 2 +- .../persistence/queue/util/AmazonNotificationUtils.java | 4 +++- 4 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java index 410f162..7d022e5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java @@ -62,11 +62,10 @@ public interface IndexProcessorFig extends GuicyFig { /** * Set the visibility timeout for messages received from the queue. (in milliseconds). - * AWS default is also currently 30 seconds. Received messages will remain 'in flight' until - * they are ack'd(deleted) or this timeout occurs. If the timeout occurs, the messages will become - * visible again for re-processing. + * Received messages will remain 'in flight' until they are ack'd(deleted) or this timeout occurs. + * If the timeout occurs, the messages will become visible again for re-processing. */ -@Default( "3" ) +@Default( "5000" ) // 5 seconds @Key( INDEX_QUEUE_VISIBILITY_TIMEOUT ) int getIndexQueueVisibilityTimeout(); http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java -- diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java index 7f26bcf..0453a9b 100644 --- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java +++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java @@ -76,10 +76,10 @@ public interface QueueFig extends GuicyFig { int getAsyncQueueSize(); /** - * Set the visibility timeout for faster retries + * Set the visibility timeout (in milliseconds) for faster retries * @return */ @Key( "usergrid.queue.visibilityTimeout" ) -@Default("10") -String getVisibilityTimeout(); +@Default("5000") // 5 seconds +int getVisibilityTimeout(); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/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 a2b5d72..d476f76 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 @@ -351,7 +351,7 @@ public class SNSQueueManagerImpl implements QueueManager { ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(url); receiveMessageRequest.setMaxNumberOfMessages(limit); -receiveMessageRequest.setVisibilityTimeout(transactionTimeout / 1000); +receiveMessageRequest.setVisibilityTimeout(Math.max(1,
[1/2] usergrid git commit: Added a tool to fix the "Could not find organization for email". This is primarily a 1.0 problem but if it does appear in 2.0 then this tool can be applied there as well.
Repository: usergrid Updated Branches: refs/heads/1.x 6c1d22e79 -> afe0c51d6 Added a tool to fix the "Could not find organization for email". This is primarily a 1.0 problem but if it does appear in 2.0 then this tool can be applied there as well. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/6e2ff961 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/6e2ff961 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/6e2ff961 Branch: refs/heads/1.x Commit: 6e2ff96132ec2a95b540405bbb811cf3eb1b8180 Parents: 6c1d22e Author: George ReyesAuthored: Fri Oct 16 14:20:40 2015 -0700 Committer: George Reyes Committed: Fri Oct 16 14:20:40 2015 -0700 -- .../apache/usergrid/tools/AdminPointerFix.java | 148 +++ 1 file changed, 148 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/6e2ff961/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java -- diff --git a/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java b/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java new file mode 100644 index 000..72ae4d7 --- /dev/null +++ b/stack/tools/src/main/java/org/apache/usergrid/tools/AdminPointerFix.java @@ -0,0 +1,148 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.usergrid.tools; + + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.UUID; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Option; +import org.apache.commons.cli.OptionBuilder; +import org.apache.commons.cli.Options; + +import org.apache.usergrid.management.UserInfo; +import org.apache.usergrid.persistence.Entity; +import org.apache.usergrid.persistence.EntityManager; +import org.apache.usergrid.persistence.Query; +import org.apache.usergrid.persistence.Results; +import org.apache.usergrid.persistence.cassandra.CassandraService; +import org.apache.usergrid.persistence.entities.Application; +import org.apache.usergrid.persistence.entities.User; + +import com.google.common.collect.HashMultimap; +import com.google.common.collect.Multimap; + + +/** + * Fixes issues where admin data is in organizations but can't accessed or reset the password of. This usually returns + * the error "Could not find organization for email" because the user can't be found but when the org is queried the + * user shows up there. If you see that then run this tool. + */ +public class AdminPointerFix extends ExportingToolBase { +private static final int PAGE_SIZE = 100; + +private static final Logger logger = LoggerFactory.getLogger( AdminPointerFix.class ); + + +@Override +@SuppressWarnings( "static-access" ) +public Options createOptions() { + +Option hostOption = +OptionBuilder.withArgName( "host" ).hasArg().isRequired( true ).withDescription( "Cassandra host" ) + .create( "host" ); + + + +Options options = new Options(); +options.addOption( hostOption ); + +return options; +} + + +@Override +public void runTool( CommandLine line ) throws Exception { + + +startSpring(); + +logger.info( "Starting crawl of all admins" ); + +EntityManager em = emf.getEntityManager( CassandraService.MANAGEMENT_APPLICATION_ID ); +Application app = em.getApplication(); + +// search for all orgs + +Query query = new Query(); +query.setLimit( PAGE_SIZE ); +Results r = null; + +Multimap emails = HashMultimap.create(); +Multimap usernames = HashMultimap.create(); +do { + +//get all users in the management app and page for each set of a PAGE_SIZE +r = em.searchCollection( app, "users", query ); + +for (
[2/3] usergrid git commit: Add sourceRegion to SQS event message based on queue primary region. Remove cached entity manager (unused).
Add sourceRegion to SQS event message based on queue primary region. Remove cached entity manager (unused). Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/a09485a3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/a09485a3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/a09485a3 Branch: refs/heads/master Commit: a09485a3a5ac8b4217b294f4754ea8a70a7ec447 Parents: 2b22c61 Author: Michael RussoAuthored: Fri Oct 16 13:12:42 2015 -0700 Committer: Michael Russo Committed: Fri Oct 16 13:12:42 2015 -0700 -- .../asyncevents/AmazonAsyncEventService.java| 40 ++--- .../asyncevents/AsyncIndexProvider.java | 10 +- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 --- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 2 +- .../queue/impl/SNSQueueManagerImpl.java | 6 +- .../queue/impl/SQSQueueManagerImpl.java | 2 +- 14 files changed, 64 insertions(+), 202 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/a09485a3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 95126c6..c198674 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -29,6 +29,7 @@ import java.util.stream.Stream; import com.google.common.base.Optional; import org.apache.usergrid.persistence.index.impl.IndexProducer; +import org.apache.usergrid.persistence.queue.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,10 +57,6 @@ import org.apache.usergrid.persistence.index.IndexLocationStrategy; import org.apache.usergrid.persistence.index.impl.IndexOperationMessage; import org.apache.usergrid.persistence.model.entity.Entity; import org.apache.usergrid.persistence.model.entity.Id; -import org.apache.usergrid.persistence.queue.QueueManager; -import org.apache.usergrid.persistence.queue.QueueManagerFactory; -import org.apache.usergrid.persistence.queue.QueueMessage; -import org.apache.usergrid.persistence.queue.QueueScope; import org.apache.usergrid.persistence.queue.impl.QueueScopeImpl; import com.codahale.metrics.Counter; @@ -89,6 +86,7 @@ public class AmazonAsyncEventService implements AsyncEventService { private final QueueManager queue; private final QueueScope queueScope; private final IndexProcessorFig indexProcessorFig; +private final QueueFig queueFig; private final IndexProducer indexProducer; private final EntityCollectionManagerFactory entityCollectionManagerFactory; private final IndexLocationStrategyFactory indexLocationStrategyFactory; @@ -115,15 +113,16 @@ public class AmazonAsyncEventService implements AsyncEventService { @Inject -public AmazonAsyncEventService( final QueueManagerFactory queueManagerFactory, -final IndexProcessorFig indexProcessorFig, -final IndexProducer indexProducer, -final MetricsFactory metricsFactory, -final EntityCollectionManagerFactory entityCollectionManagerFactory, -final IndexLocationStrategyFactory indexLocationStrategyFactory, -final EntityIndexFactory entityIndexFactory, -final EventBuilder eventBuilder, -final RxTaskScheduler rxTaskScheduler ) { +public AmazonAsyncEventService(final QueueManagerFactory queueManagerFactory, + final IndexProcessorFig indexProcessorFig, + final IndexProducer indexProducer, + final MetricsFactory metricsFactory, + final
usergrid git commit: USERGRID-1044: set default retry count to 0 also, retry count was being used as the total number of attempts
Repository: usergrid Updated Branches: refs/heads/USERGRID-1044 2f307a750 -> 1195ce85f USERGRID-1044: set default retry count to 0 also, retry count was being used as the total number of attempts Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1195ce85 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1195ce85 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1195ce85 Branch: refs/heads/USERGRID-1044 Commit: 1195ce85fefcc8334b38f6e79cc8a2c53ce9ce10 Parents: 2f307a7 Author: Mike DunkerAuthored: Tue Oct 20 13:37:34 2015 -0700 Committer: Mike Dunker Committed: Tue Oct 20 13:37:34 2015 -0700 -- stack/loadtests/README.md | 2 +- .../org/apache/usergrid/enums/ConfigProperties.scala | 2 +- .../apache/usergrid/scenarios/AuditScenarios.scala| 6 +++--- .../scenarios/EntityCollectionScenarios.scala | 14 +++--- stack/loadtests/testConfig.sh | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/1195ce85/stack/loadtests/README.md -- diff --git a/stack/loadtests/README.md b/stack/loadtests/README.md index 802c286..ec34b42 100644 --- a/stack/loadtests/README.md +++ b/stack/loadtests/README.md @@ -106,7 +106,7 @@ Defaults listed are those that are specified by the Usergrid Gatling code, not n * uuidFilename (no default) - UUID filename for non-audit tests * auditUuidFilename (no default) - UUID filename for audit tests * failedUuidFilename (no default) - UUID filename for failed entries while auditing -* retryCount (**5**) - number of retries of operation before giving up +* retryCount (**0**) - number of retries of operation before giving up * purgeUsers (**100**) - number of entities to create at a time during loadEntities (send this many requests, then wait for the responses) * laterThanTimestamp (**0**) - if specified for an audit, will only match entities modified >= this timestamp; can be used for incremental audits * entityProgressCount (**1**) - print to console every time this many requests has been sent (if entityProgressCount = 1, will print on the 1000th, 2000th, 3000th... request) http://git-wip-us.apache.org/repos/asf/usergrid/blob/1195ce85/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala index f74222e..cbb484c 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala @@ -153,7 +153,7 @@ object ConfigProperties { case FailedUuidFilename => "/tmp/dummyFailedUuid.csv" case SandboxCollection => false case PurgeUsers => 100 -case RetryCount => 5 +case RetryCount => 0 case LaterThanTimestamp => 0L case EntityProgressCount => 1L case InjectionList => "rampUsers(10,60)" http://git-wip-us.apache.org/repos/asf/usergrid/blob/1195ce85/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index 4743536..4477338 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -100,10 +100,10 @@ object AuditScenarios { session } .doIf(session => session("validEntity").as[String] == "yes") { - tryMax(Settings.retryCount) { + tryMax(1+Settings.retryCount) { exec(getCollectionsWithoutCursor) }.asLongAs(stringParamExists(SessionVarCursor)) { -tryMax(Settings.retryCount) { +tryMax(1+Settings.retryCount) { exec(getCollectionsWithCursor) } } @@ -252,7 +252,7 @@ object AuditScenarios { .asLongAs(session => session("validEntity").asOption[String].map(validEntity => validEntity != "no").getOrElse[Boolean](true)) { feed(FeederGenerator.collectionCsvFeeder) .doIf(session => session("validEntity").as[String] == "yes") { -tryMax(Settings.retryCount) { +tryMax(1+Settings.retryCount) {
[04/33] usergrid git commit: Renaming to work around case issue.
Renaming to work around case issue. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/d68f4508 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/d68f4508 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/d68f4508 Branch: refs/heads/usergrid-1007-shiro-cache Commit: d68f4508b08063e18c735ee63363e8cb102c3f81 Parents: f19ae08 Author: Dave JohnsonAuthored: Thu Oct 15 10:15:10 2015 -0400 Committer: Dave Johnson Committed: Thu Oct 15 10:15:10 2015 -0400 -- website/content/img/mike_d.JPG | Bin 36443 -> 0 bytes website/content/img/miked.jpg | Bin 0 -> 36443 bytes 2 files changed, 0 insertions(+), 0 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/d68f4508/website/content/img/mike_d.JPG -- diff --git a/website/content/img/mike_d.JPG b/website/content/img/mike_d.JPG deleted file mode 100644 index 8dca2ee..000 Binary files a/website/content/img/mike_d.JPG and /dev/null differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/d68f4508/website/content/img/miked.jpg -- diff --git a/website/content/img/miked.jpg b/website/content/img/miked.jpg new file mode 100644 index 000..8dca2ee Binary files /dev/null and b/website/content/img/miked.jpg differ
[31/33] usergrid git commit: Merge branch 'USERGRID-1048' of https://git-wip-us.apache.org/repos/asf/usergrid
Merge branch 'USERGRID-1048' of https://git-wip-us.apache.org/repos/asf/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/59edea1c Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/59edea1c Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/59edea1c Branch: refs/heads/usergrid-1007-shiro-cache Commit: 59edea1c2a8a2c182daad4ee7f3e42c295984b86 Parents: 5f62e4c 1fe1d1a Author: Shawn FeldmanAuthored: Tue Oct 20 13:13:12 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 13:13:12 2015 -0600 -- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) --
[12/33] usergrid git commit: USERGRID-1044: and another typo
USERGRID-1044: and another typo Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/06e3fa49 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/06e3fa49 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/06e3fa49 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 06e3fa49abb2e1e5f4e7ad187741025499ee22c5 Parents: 4fa61a9 Author: Mike DunkerAuthored: Thu Oct 15 13:33:55 2015 -0700 Committer: Mike Dunker Committed: Thu Oct 15 13:33:55 2015 -0700 -- .../scala/org/apache/usergrid/scenarios/AuditScenarios.scala | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/06e3fa49/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index 390029b..bd0d007 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -166,14 +166,14 @@ object AuditScenarios { if (entityUuid == null || entityUuid.isEmpty) { Settings.incAuditPayloadUuidError() println(s"PAYLOAD UUID MISSING (DIRECT): requestedUuid=$uuid") - } else if (uuid.equalsIgnoreCase(entityUuid)) { + } else if (!uuid.equalsIgnoreCase(entityUuid)) { Settings.incAuditPayloadUuidError() println(s"PAYLOAD UUID MISMATCH (DIRECT): requestedUuid=$uuid returnedUuid=$entityUuid") } if (entityName == null || entityName.isEmpty) { Settings.incAuditPayloadNameError() println(s"PAYLOAD NAME MISSING (DIRECT): requestedName=$reqName") - } else if (reqName.equalsIgnoreCase(entityName)) { + } else if (!reqName.equalsIgnoreCase(entityName)) { Settings.incAuditPayloadNameError() println(s"PAYLOAD NAME MISMATCH (DIRECT): requestedName=$reqName returnedName=$entityName") } @@ -217,14 +217,14 @@ object AuditScenarios { if (entityUuid == null || entityUuid.isEmpty) { Settings.incAuditPayloadUuidError() println(s"PAYLOAD UUID MISSING (QUERY): requestedUuid=$uuid") - } else if (uuid.equalsIgnoreCase(entityUuid)) { + } else if (!uuid.equalsIgnoreCase(entityUuid)) { Settings.incAuditPayloadUuidError() println(s"PAYLOAD UUID MISMATCH (QUERY): requestedUuid=$uuid returnedUuid=$entityUuid") } if (entityName == null || entityName.isEmpty) { Settings.incAuditPayloadNameError() println(s"PAYLOAD NAME MISSING (QUERY): requestedName=$reqName") - } else if (reqName.equalsIgnoreCase(entityName)) { + } else if (!reqName.equalsIgnoreCase(entityName)) { Settings.incAuditPayloadNameError() println(s"PAYLOAD NAME MISMATCH (QUERY): requestedName=$reqName returnedName=$entityName") }
[26/33] usergrid git commit: Merge branch '2.1-release' of https://git-wip-us.apache.org/repos/asf/usergrid
Merge branch '2.1-release' of https://git-wip-us.apache.org/repos/asf/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/a679aea4 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/a679aea4 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/a679aea4 Branch: refs/heads/usergrid-1007-shiro-cache Commit: a679aea4a46f29c60e64bfdf8e484149450c1fea Parents: e7c805f a09485a Author: Shawn FeldmanAuthored: Tue Oct 20 09:17:19 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 09:17:19 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 40 ++--- .../asyncevents/AsyncIndexProvider.java | 10 +- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/IndexProcessorFig.java| 7 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 --- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 8 +- .../queue/impl/SNSQueueManagerImpl.java | 8 +- .../queue/impl/SQSQueueManagerImpl.java | 2 +- .../queue/util/AmazonNotificationUtils.java | 4 +- 16 files changed, 74 insertions(+), 211 deletions(-) --
[28/33] usergrid git commit: Fixes comments and refactors map to be a cleaner read pattern
Fixes comments and refactors map to be a cleaner read pattern Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e50835f1 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e50835f1 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e50835f1 Branch: refs/heads/usergrid-1007-shiro-cache Commit: e50835f1016a9988513a00b64337222957fa7747 Parents: fbb6c82 Author: Todd NineAuthored: Tue Oct 20 09:34:43 2015 -0600 Committer: Todd Nine Committed: Tue Oct 20 09:34:43 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 2 +- .../core/astyanax/CassandraConfig.java | 8 ++--- .../core/astyanax/CassandraConfigImpl.java | 1 + .../map/impl/MapSerializationImpl.java | 37 .../queue/impl/SNSQueueManagerImpl.java | 4 +-- 5 files changed, 14 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 38c2966..6f779b5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -521,7 +521,7 @@ public class AmazonAsyncEventService implements AsyncEventService { final IndexOperationMessage indexOperationMessage; if(message == null){ -logger.error( "Received message with id {} to process, unable to find it, reading with higher consistency level", +logger.warn( "Received message with id {} to process, unable to find it, reading with higher consistency level", messageId); final String highConsistency = esMapPersistence.getStringHighConsistency( messageId.toString() ); http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java index 817aee2..dba3646 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfig.java @@ -34,25 +34,25 @@ public interface CassandraConfig { * Get the currently configured ReadCL * @return */ -public ConsistencyLevel getReadCL(); +ConsistencyLevel getReadCL(); /** * Get the currently configured ReadCL that is more consitent than getReadCL * @return */ -public ConsistencyLevel getConsistentReadCL(); +ConsistencyLevel getConsistentReadCL(); /** * Get the currently configured write CL * @return */ -public ConsistencyLevel getWriteCL(); +ConsistencyLevel getWriteCL(); /** * Return the number of shards that has been set in the property file * @return */ -public int[] getShardSettings(); +int[] getShardSettings(); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/e50835f1/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java -- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java index 17b91c6..7373322 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/CassandraConfigImpl.java @@ -83,6 +83,7 @@ public class CassandraConfigImpl implements CassandraConfig { public ConsistencyLevel getConsistentReadCL() { return consistentCl; } + @Override public ConsistencyLevel getWriteCL() { return writeCl;
[07/33] usergrid git commit: USERGRID-1044: if query audit fails, try direct access
USERGRID-1044: if query audit fails, try direct access Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2757e905 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2757e905 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2757e905 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 2757e905d9a2cf38adf426df6604dd78e8a512ac Parents: b62ad30 Author: Mike DunkerAuthored: Thu Oct 15 09:34:14 2015 -0700 Committer: Mike Dunker Committed: Thu Oct 15 09:34:14 2015 -0700 -- .../usergrid/scenarios/AuditScenarios.scala | 40 ++-- .../org/apache/usergrid/settings/Settings.scala | 19 +++--- 2 files changed, 50 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2757e905/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index aaabf99..905c652 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -131,6 +131,38 @@ object AuditScenarios { session }) + val getCollectionEntityDirect = exec( +http("GET collection entity direct") + .get("/${collectionName}/${uuid}") + .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) + .check(status.is(200),jsonPath("$.count").optional.saveAs("count"),extractAuditEntities(SessionVarCollectionEntities))) + .exec(session => { +val count = session("count").as[String].toInt +val uuid = session("uuid").as[String] +val entityName = session("name").as[String] +val modified = session("modified").as[String].toLong +val collectionName = session(SessionVarCollectionName).as[String] + +if (count < 1) { + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditNotFoundAtAll() + println(s"NOT FOUND AT ALL: $collectionName.$entityName ($uuid)") +} else if (count == 1) { + // found via direct access but not query + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditNotFoundViaQuery() + println(s"NOT FOUND VIA QUERY: $collectionName.$entityName ($uuid)") +} else { + // count > 1 -> invalid + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditBadResponse() + println(s"INVALID RESPONSE (count=$count): $collectionName.$entityName ($uuid)") +} + +session + }) + val getCollectionEntity = exec( http("GET collection entity") .get("/${collectionName}?ql=uuid=${uuid}") @@ -145,20 +177,22 @@ object AuditScenarios { val collectionName = session(SessionVarCollectionName).as[String] if (count < 1) { - Settings.addAuditUuid(uuid, collectionName, entityName, modified) - Settings.incAuditNotFound() - println(s"NOT FOUND: $collectionName.$entityName ($uuid)") + // will check to see whether accessible directly } else if (count > 1) { Settings.addAuditUuid(uuid, collectionName, entityName, modified) Settings.incAuditBadResponse() println(s"INVALID RESPONSE (count=$count): $collectionName.$entityName ($uuid)") } else { + // count == 1 -> success // println(s"FOUND: $collectionName.$entityName ($uuid)") Settings.incAuditSuccess() } session }) + .doIf(session => session("count").as[String].toInt < 1) { +exec(getCollectionEntityDirect) + } .doIf(session => Settings.deleteAfterSuccessfulAudit && session("count").as[String].toInt == 1) { // tryMax(Settings.retryCount) { exec(deleteAuditedEntity) http://git-wip-us.apache.org/repos/asf/usergrid/blob/2757e905/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala index 979fb3f..374440d 100755 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala @@ -429,7 +429,8 @@ object Settings { } private val
[17/33] usergrid git commit: Merge branch 'refs/heads/2.1-release' into USERGRID-1048
Merge branch 'refs/heads/2.1-release' into USERGRID-1048 Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/3e155852 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/3e155852 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/3e155852 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 3e1558524728c96834cfd66d9e53e3f1b6a7d3d6 Parents: 04a3f47 a09485a Author: Todd NineAuthored: Mon Oct 19 13:30:04 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 13:30:04 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 149 ++- .../asyncevents/AsyncIndexProvider.java | 26 ++-- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 -- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 2 +- .../queue/impl/SNSQueueManagerImpl.java | 8 +- 13 files changed, 135 insertions(+), 256 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/3e155852/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index d319ac8,c198674..f8ef5e7 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@@ -97,7 -84,9 +100,8 @@@ public class AmazonAsyncEventService im public static final String QUEUE_NAME = "index"; //keep this short as AWS limits queue name size to 80 chars private final QueueManager queue; -private final QueueScope queueScope; private final IndexProcessorFig indexProcessorFig; + private final QueueFig queueFig; private final IndexProducer indexProducer; private final EntityCollectionManagerFactory entityCollectionManagerFactory; private final IndexLocationStrategyFactory indexLocationStrategyFactory; @@@ -125,33 -113,28 +129,35 @@@ @Inject -public AmazonAsyncEventService(final QueueManagerFactory queueManagerFactory, - final IndexProcessorFig indexProcessorFig, - final IndexProducer indexProducer, - final MetricsFactory metricsFactory, - final EntityCollectionManagerFactory entityCollectionManagerFactory, - final IndexLocationStrategyFactory indexLocationStrategyFactory, - final EntityIndexFactory entityIndexFactory, - final EventBuilder eventBuilder, - final RxTaskScheduler rxTaskScheduler, - QueueFig queueFig) { +public AmazonAsyncEventService( final QueueManagerFactory queueManagerFactory, +final IndexProcessorFig indexProcessorFig, +final IndexProducer indexProducer, +final MetricsFactory metricsFactory, +final EntityCollectionManagerFactory entityCollectionManagerFactory, +final IndexLocationStrategyFactory indexLocationStrategyFactory, +final EntityIndexFactory entityIndexFactory, +final EventBuilder eventBuilder, +final MapManagerFactory mapManagerFactory, ++final QueueFig queueFig, +final RxTaskScheduler rxTaskScheduler ) { this.indexProducer = indexProducer; this.entityCollectionManagerFactory = entityCollectionManagerFactory; this.indexLocationStrategyFactory = indexLocationStrategyFactory; this.entityIndexFactory = entityIndexFactory; this.eventBuilder = eventBuilder; + +final MapScope mapScope = new MapScopeImpl( CpNamingUtils.getManagementApplicationId(), "indexEvents"); + +this.esMapPersistence =
[16/33] usergrid git commit: USERGRID-1044: add optional region header functionality to most requests
USERGRID-1044: add optional region header functionality to most requests Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/963a0841 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/963a0841 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/963a0841 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 963a08417aa66eea567301e2592751d051a1a73c Parents: 06e3fa4 Author: Mike DunkerAuthored: Mon Oct 19 11:07:41 2015 -0700 Committer: Mike Dunker Committed: Mon Oct 19 11:07:41 2015 -0700 -- .../org/apache/usergrid/scenarios/AuditScenarios.scala | 3 +++ .../usergrid/scenarios/EntityCollectionScenarios.scala | 11 +++ 2 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/963a0841/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index bd0d007..be754f4 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -58,6 +58,7 @@ object AuditScenarios { http("GET collections") .get(collectionGetUrl(false)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200),extractAuditEntities(SessionVarCollectionEntities),maybeExtractCursor(SessionVarCursor))) .foreach("${" + SessionVarCollectionEntities + "}", "singleResult") { exec(session => { @@ -75,6 +76,7 @@ object AuditScenarios { http("GET collections") .get(collectionGetUrl(true)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200),extractAuditEntities(SessionVarCollectionEntities),maybeExtractCursor(SessionVarCursor))) .foreach("${" + SessionVarCollectionEntities + "}", "singleResult") { exec(session => { @@ -118,6 +120,7 @@ object AuditScenarios { http("DELETE audited entity") .delete("/${collectionName}/${uuid}") .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(extractEntityUuid(SessionVarDeletedUuid))) .exec(session => { val uuid = session(SessionVarDeletedUuid).as[String] http://git-wip-us.apache.org/repos/asf/usergrid/blob/963a0841/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala index de95920..bc3cf8c 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/EntityCollectionScenarios.scala @@ -73,6 +73,7 @@ object EntityCollectionScenarios { http("GET entities") .get(entityGetUrl(false)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200), maybeExtractCursor(SessionVarCursor)) ) @@ -80,6 +81,7 @@ object EntityCollectionScenarios { http("GET entities") .get(entityGetUrl(true)) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200), maybeExtractCursor(SessionVarCursor)) ) @@ -110,6 +112,7 @@ object EntityCollectionScenarios { http("GET entity by name (anonymous)") .get(randomEntityNameUrl()) .headers(Headers.authAnonymous) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -117,6 +120,7 @@ object EntityCollectionScenarios { http("GET entity by name (token)") .get(randomEntityNameUrl()) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -153,6 +157,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${uuid}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authAnonymous) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -161,6 +166,7 @@ object EntityCollectionScenarios { .get("/" + Settings.collection + "/${uuid}") .queryParamMap(Settings.queryParamMap) .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) .check(status.is(200)) ) @@ -207,6 +213,7 @@ object
[29/33] usergrid git commit: Merge remote-tracking branch 'origin/USERGRID-1048'
Merge remote-tracking branch 'origin/USERGRID-1048' Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5f62e4c1 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5f62e4c1 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5f62e4c1 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 5f62e4c167ec12ec0378d65b162e3db0481f7d07 Parents: b51287c e50835f Author: Shawn FeldmanAuthored: Tue Oct 20 11:43:47 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 11:43:47 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 2 +- .../core/astyanax/CassandraConfig.java | 8 ++--- .../core/astyanax/CassandraConfigImpl.java | 1 + .../map/impl/MapSerializationImpl.java | 37 .../queue/impl/SNSQueueManagerImpl.java | 4 +-- 5 files changed, 14 insertions(+), 38 deletions(-) --
[03/33] usergrid git commit: USERGRID-1044: add usergrid region for auditing a specific region
USERGRID-1044: add usergrid region for auditing a specific region Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/b62ad30c Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/b62ad30c Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/b62ad30c Branch: refs/heads/usergrid-1007-shiro-cache Commit: b62ad30cb9f16de7cb1877877aee6126f541bc72 Parents: 9b2508f Author: Mike DunkerAuthored: Fri Oct 9 16:44:19 2015 -0700 Committer: Mike Dunker Committed: Fri Oct 9 16:44:19 2015 -0700 -- stack/loadtests/runAuditVerifyCollectionEntities.sh | 5 - .../scala/org/apache/usergrid/enums/ConfigProperties.scala| 4 +++- .../src/main/scala/org/apache/usergrid/helpers/Headers.scala | 7 +++ .../scala/org/apache/usergrid/scenarios/AuditScenarios.scala | 1 + .../main/scala/org/apache/usergrid/settings/Settings.scala| 1 + 5 files changed, 16 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/b62ad30c/stack/loadtests/runAuditVerifyCollectionEntities.sh -- diff --git a/stack/loadtests/runAuditVerifyCollectionEntities.sh b/stack/loadtests/runAuditVerifyCollectionEntities.sh index 2e2d76d..fa75505 100755 --- a/stack/loadtests/runAuditVerifyCollectionEntities.sh +++ b/stack/loadtests/runAuditVerifyCollectionEntities.sh @@ -28,16 +28,18 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi #RETRY_COUNT= DELETE_AFTER_SUCCESSFUL_AUDIT=false +AUDIT_REGION= die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)]]" +[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)[AUDIT_REGION]]]" RAMP_USERS="$1" RAMP_TIME="$2" AUDIT_UUID_FILENAME="$3" FAILED_UUID_FILENAME="$4" [ "$#" -ge 5 ] && DELETE_AFTER_SUCCESSFUL_AUDIT="$5" +[ "$#" -ge 6 ] && AUDIT_REGION="$6" shift $# @@ -63,5 +65,6 @@ mvn gatling:execute \ -DfailedUuidFilename=${FAILED_UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ -DdeleteAfterSuccessfulAudit=${DELETE_AFTER_SUCCESSFUL_AUDIT} \ +-DauditRegion=${AUDIT_REGION} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.AuditSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/b62ad30c/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala index 975944a..d825bb6 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala @@ -86,6 +86,7 @@ object ConfigProperties { val InterleavedWorkerFeed = "interleavedWorkerFeed" val NewCsvOnFlush = "newCsvOnFlush" val DeleteAfterSuccessfulAudit = "deleteAfterSuccessfulAudit" + val AuditRegion = "auditRegion"; val Values = Seq(Org,App,AdminUser,AdminPassword,BaseUrl,AuthType,TokenType,SkipSetup,CreateOrg,CreateApp,LoadEntities, ScenarioType,RampUsers,ConstantUsersPerSec,ConstantUsersDuration,UserSeed,AppUser,AppUserPassword,NumEntities, @@ -95,7 +96,7 @@ object ConfigProperties { UuidFilename,AuditUuidFilename,FailedUuidFilename,SandboxCollection,PurgeUsers,RetryCount,LaterThanTimestamp, EntityProgressCount,InjectionList,PrintFailedRequests,GetViaQuery,MultiPropertyPrefix,MultiPropertyCount, MultiPropertySizeInK,EntityNumberProperty,QueryParams,CsvFeedPattern,UnlimitedFeed,FlushCsv,InterleavedWorkerFeed, -NewCsvOnFlush,DeleteAfterSuccessfulAudit) +NewCsvOnFlush,DeleteAfterSuccessfulAudit,AuditRegion) def isValid(str: String): Boolean = { Values.contains(str) @@ -169,6 +170,7 @@ object ConfigProperties { case InterleavedWorkerFeed => false case NewCsvOnFlush => false case DeleteAfterSuccessfulAudit => false +case AuditRegion => "" } } else { null http://git-wip-us.apache.org/repos/asf/usergrid/blob/b62ad30c/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Headers.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Headers.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Headers.scala index
[15/33] usergrid git commit: Fixes serialization tests and verifies full end to end functionality.
Fixes serialization tests and verifies full end to end functionality. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/04a3f47b Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/04a3f47b Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/04a3f47b Branch: refs/heads/usergrid-1007-shiro-cache Commit: 04a3f47bd86ec0674ff487f479327e0f174f0425 Parents: 94a9078 Author: Todd NineAuthored: Mon Oct 19 12:00:56 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 12:00:56 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 70 ++- .../asyncevents/model/AsyncEvent.java | 5 +- .../index/IndexProcessorFig.java| 7 +- .../util/ObjectJsonSerializer.java | 28 +- .../persistence/queue/QueueManager.java | 2 +- .../persistence/queue/guice/QueueModule.java| 1 - .../queue/impl/SNSQueueManagerImpl.java | 515 ++- .../queue/impl/SQSQueueManagerImpl.java | 362 - 8 files changed, 336 insertions(+), 654 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/04a3f47b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index c9f0953..d319ac8 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -29,19 +29,13 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.google.common.base.Optional; - -import org.apache.usergrid.corepersistence.asyncevents.model.ElasticsearchIndexEvent; -import org.apache.usergrid.corepersistence.util.CpNamingUtils; -import org.apache.usergrid.corepersistence.util.ObjectJsonSerializer; -import org.apache.usergrid.exception.NotImplementedException; -import org.apache.usergrid.persistence.index.impl.IndexProducer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.usergrid.corepersistence.asyncevents.model.AsyncEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EdgeDeleteEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EdgeIndexEvent; +import org.apache.usergrid.corepersistence.asyncevents.model.ElasticsearchIndexEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EntityDeleteEvent; import org.apache.usergrid.corepersistence.asyncevents.model.EntityIndexEvent; import org.apache.usergrid.corepersistence.asyncevents.model.InitializeApplicationIndexEvent; @@ -50,6 +44,8 @@ import org.apache.usergrid.corepersistence.index.IndexLocationStrategyFactory; import org.apache.usergrid.corepersistence.index.IndexProcessorFig; import org.apache.usergrid.corepersistence.index.ReplicatedIndexLocationStrategy; import org.apache.usergrid.corepersistence.rx.impl.EdgeScope; +import org.apache.usergrid.corepersistence.util.CpNamingUtils; +import org.apache.usergrid.corepersistence.util.ObjectJsonSerializer; import org.apache.usergrid.persistence.collection.EntityCollectionManager; import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory; import org.apache.usergrid.persistence.collection.serialization.impl.migration.EntityIdScope; @@ -61,6 +57,7 @@ import org.apache.usergrid.persistence.index.EntityIndex; import org.apache.usergrid.persistence.index.EntityIndexFactory; import org.apache.usergrid.persistence.index.IndexLocationStrategy; import org.apache.usergrid.persistence.index.impl.IndexOperationMessage; +import org.apache.usergrid.persistence.index.impl.IndexProducer; import org.apache.usergrid.persistence.map.MapManager; import org.apache.usergrid.persistence.map.MapManagerFactory; import org.apache.usergrid.persistence.map.MapScope; @@ -78,6 +75,7 @@ import com.codahale.metrics.Counter; import com.codahale.metrics.Gauge; import com.codahale.metrics.Histogram; import com.codahale.metrics.Timer; +import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.inject.Inject; import com.google.inject.Singleton; @@ -94,8 +92,6 @@ public class AmazonAsyncEventService implements AsyncEventService { private static final Logger logger = LoggerFactory.getLogger(AmazonAsyncEventService.class); -private static final ObjectJsonSerializer OBJECT_JSON_SERIALIZER =
[21/33] usergrid git commit: Adds comment
Adds comment Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/4013f17e Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/4013f17e Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/4013f17e Branch: refs/heads/usergrid-1007-shiro-cache Commit: 4013f17e434a5eb05f4851d28dba6a3e0bfe8fc8 Parents: 19d30ea Author: Todd NineAuthored: Mon Oct 19 14:10:51 2015 -0600 Committer: Todd Nine Committed: Mon Oct 19 14:10:51 2015 -0600 -- .../corepersistence/asyncevents/AmazonAsyncEventService.java | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/4013f17e/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 67d0dab..ee9054b 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -536,6 +536,10 @@ public class AmazonAsyncEventService implements AsyncEventService { indexOperationMessage = ObjectJsonSerializer.INSTANCE.fromString( message, IndexOperationMessage.class ); } + +//NOTE that we intentionally do NOT delete from the map. We can't know when all regions have consumed the message +//so we'll let compaction on column expiration handle deletion + //read the value from the string Preconditions.checkNotNull( indexOperationMessage, "indexOperationMessage cannot be null" );
[32/33] usergrid git commit: Merge commit 'refs/pull/403/head' of github.com:apache/usergrid
Merge commit 'refs/pull/403/head' of github.com:apache/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1393c2f7 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1393c2f7 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1393c2f7 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 1393c2f76e44150352497f661907801151807806 Parents: 59edea1 2f307a7 Author: Michael RussoAuthored: Tue Oct 20 12:18:48 2015 -0700 Committer: Michael Russo Committed: Tue Oct 20 12:18:48 2015 -0700 -- .../runAuditVerifyCollectionEntities.sh | 11 +- stack/loadtests/runDeleteEntities.sh| 13 +- stack/loadtests/runLoadEntitiesUnlimited.sh | 103 + .../datagenerators/FeederGenerator.scala| 9 +- .../usergrid/enums/ConfigProperties.scala | 15 +- .../apache/usergrid/helpers/Extractors.scala| 24 ++- .../org/apache/usergrid/helpers/Headers.scala | 7 + .../usergrid/scenarios/AuditScenarios.scala | 121 ++- .../scenarios/EntityCollectionScenarios.scala | 38 - .../org/apache/usergrid/settings/Settings.scala | 150 +++ stack/loadtests/testConfig.sh | 3 + 11 files changed, 435 insertions(+), 59 deletions(-) --
[13/33] usergrid git commit: Add sourceRegion to SQS event message based on queue primary region. Remove cached entity manager (unused).
Add sourceRegion to SQS event message based on queue primary region. Remove cached entity manager (unused). Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/a09485a3 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/a09485a3 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/a09485a3 Branch: refs/heads/usergrid-1007-shiro-cache Commit: a09485a3a5ac8b4217b294f4754ea8a70a7ec447 Parents: 2b22c61 Author: Michael RussoAuthored: Fri Oct 16 13:12:42 2015 -0700 Committer: Michael Russo Committed: Fri Oct 16 13:12:42 2015 -0700 -- .../asyncevents/AmazonAsyncEventService.java| 40 ++--- .../asyncevents/AsyncIndexProvider.java | 10 +- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 --- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 2 +- .../queue/impl/SNSQueueManagerImpl.java | 6 +- .../queue/impl/SQSQueueManagerImpl.java | 2 +- 14 files changed, 64 insertions(+), 202 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/a09485a3/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 95126c6..c198674 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -29,6 +29,7 @@ import java.util.stream.Stream; import com.google.common.base.Optional; import org.apache.usergrid.persistence.index.impl.IndexProducer; +import org.apache.usergrid.persistence.queue.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,10 +57,6 @@ import org.apache.usergrid.persistence.index.IndexLocationStrategy; import org.apache.usergrid.persistence.index.impl.IndexOperationMessage; import org.apache.usergrid.persistence.model.entity.Entity; import org.apache.usergrid.persistence.model.entity.Id; -import org.apache.usergrid.persistence.queue.QueueManager; -import org.apache.usergrid.persistence.queue.QueueManagerFactory; -import org.apache.usergrid.persistence.queue.QueueMessage; -import org.apache.usergrid.persistence.queue.QueueScope; import org.apache.usergrid.persistence.queue.impl.QueueScopeImpl; import com.codahale.metrics.Counter; @@ -89,6 +86,7 @@ public class AmazonAsyncEventService implements AsyncEventService { private final QueueManager queue; private final QueueScope queueScope; private final IndexProcessorFig indexProcessorFig; +private final QueueFig queueFig; private final IndexProducer indexProducer; private final EntityCollectionManagerFactory entityCollectionManagerFactory; private final IndexLocationStrategyFactory indexLocationStrategyFactory; @@ -115,15 +113,16 @@ public class AmazonAsyncEventService implements AsyncEventService { @Inject -public AmazonAsyncEventService( final QueueManagerFactory queueManagerFactory, -final IndexProcessorFig indexProcessorFig, -final IndexProducer indexProducer, -final MetricsFactory metricsFactory, -final EntityCollectionManagerFactory entityCollectionManagerFactory, -final IndexLocationStrategyFactory indexLocationStrategyFactory, -final EntityIndexFactory entityIndexFactory, -final EventBuilder eventBuilder, -final RxTaskScheduler rxTaskScheduler ) { +public AmazonAsyncEventService(final QueueManagerFactory queueManagerFactory, + final IndexProcessorFig indexProcessorFig, + final IndexProducer indexProducer, + final MetricsFactory metricsFactory, + final
[19/33] usergrid git commit: USERGRID-1044: add region to unlimited load test plus rename "auditRegion" to "usergridRegion" since it can be used for non-audit purposes
USERGRID-1044: add region to unlimited load test plus rename "auditRegion" to "usergridRegion" since it can be used for non-audit purposes Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2f307a75 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2f307a75 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2f307a75 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 2f307a75066204a894bd68115518e29064ae56cc Parents: 963a084 Author: Mike DunkerAuthored: Mon Oct 19 12:56:22 2015 -0700 Committer: Mike Dunker Committed: Mon Oct 19 12:56:22 2015 -0700 -- .../runAuditVerifyCollectionEntities.sh | 7 +++ stack/loadtests/runLoadEntitiesUnlimited.sh | 4 +++- .../usergrid/enums/ConfigProperties.scala | 6 +++--- .../org/apache/usergrid/helpers/Headers.scala | 4 ++-- .../usergrid/scenarios/AuditScenarios.scala | 10 - .../scenarios/EntityCollectionScenarios.scala | 22 ++-- .../org/apache/usergrid/settings/Settings.scala | 2 +- stack/loadtests/testConfig.sh | 1 + 8 files changed, 29 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/runAuditVerifyCollectionEntities.sh -- diff --git a/stack/loadtests/runAuditVerifyCollectionEntities.sh b/stack/loadtests/runAuditVerifyCollectionEntities.sh index fa75505..695c9ee 100755 --- a/stack/loadtests/runAuditVerifyCollectionEntities.sh +++ b/stack/loadtests/runAuditVerifyCollectionEntities.sh @@ -28,18 +28,17 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi #RETRY_COUNT= DELETE_AFTER_SUCCESSFUL_AUDIT=false -AUDIT_REGION= die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)[AUDIT_REGION]]]" +[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)[USERGRID_REGION]]]" RAMP_USERS="$1" RAMP_TIME="$2" AUDIT_UUID_FILENAME="$3" FAILED_UUID_FILENAME="$4" [ "$#" -ge 5 ] && DELETE_AFTER_SUCCESSFUL_AUDIT="$5" -[ "$#" -ge 6 ] && AUDIT_REGION="$6" +[ "$#" -ge 6 ] && USERGRID_REGION="$6" shift $# @@ -65,6 +64,6 @@ mvn gatling:execute \ -DfailedUuidFilename=${FAILED_UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ -DdeleteAfterSuccessfulAudit=${DELETE_AFTER_SUCCESSFUL_AUDIT} \ --DauditRegion=${AUDIT_REGION} \ +-DusergridRegion=${USERGRID_REGION} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.AuditSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/runLoadEntitiesUnlimited.sh -- diff --git a/stack/loadtests/runLoadEntitiesUnlimited.sh b/stack/loadtests/runLoadEntitiesUnlimited.sh index 9222a57..11ca0a4 100755 --- a/stack/loadtests/runLoadEntitiesUnlimited.sh +++ b/stack/loadtests/runLoadEntitiesUnlimited.sh @@ -44,7 +44,7 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" +[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT [USERGRID_REGION]" RAMP_USERS="$1" RAMP_TIME="$2" @@ -52,6 +52,7 @@ RAMP_TIME="$2" [ "$#" -ge 4 ] && ENTITY_SEED="$4" [ "$#" -ge 5 ] && ENTITY_WORKER_NUM="$5" [ "$#" -ge 6 ] && ENTITY_WORKER_COUNT="$6" +[ "$#" -ge 7 ] && USERGRID_REGION="$6" shift $# @@ -97,5 +98,6 @@ mvn gatling:execute \ -DrampTime=${RAMP_TIME} \ -DuuidFilename=${UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ +-DusergridRegion=${USERGRID_REGION} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.ConfigurableSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala index d825bb6..f74222e 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala +++
[08/33] usergrid git commit: Update the visibility timeout used when taking messages from SQS as it overrides the queue's configured/default timeout. Also change the queue's visibility timeout propert
Update the visibility timeout used when taking messages from SQS as it overrides the queue's configured/default timeout. Also change the queue's visibility timeout property to be exposed as milliseconds for consistency. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2b22c610 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2b22c610 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2b22c610 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 2b22c610ddc3b9f9f08777fe5467713efe2ba553 Parents: 0f589f6 Author: Michael RussoAuthored: Thu Oct 15 10:23:29 2015 -0700 Committer: Michael Russo Committed: Thu Oct 15 10:23:29 2015 -0700 -- .../usergrid/corepersistence/index/IndexProcessorFig.java | 7 +++ .../java/org/apache/usergrid/persistence/queue/QueueFig.java | 6 +++--- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java | 2 +- .../persistence/queue/util/AmazonNotificationUtils.java | 4 +++- 4 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java index 410f162..7d022e5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java @@ -62,11 +62,10 @@ public interface IndexProcessorFig extends GuicyFig { /** * Set the visibility timeout for messages received from the queue. (in milliseconds). - * AWS default is also currently 30 seconds. Received messages will remain 'in flight' until - * they are ack'd(deleted) or this timeout occurs. If the timeout occurs, the messages will become - * visible again for re-processing. + * Received messages will remain 'in flight' until they are ack'd(deleted) or this timeout occurs. + * If the timeout occurs, the messages will become visible again for re-processing. */ -@Default( "3" ) +@Default( "5000" ) // 5 seconds @Key( INDEX_QUEUE_VISIBILITY_TIMEOUT ) int getIndexQueueVisibilityTimeout(); http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java -- diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java index 7f26bcf..0453a9b 100644 --- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java +++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/QueueFig.java @@ -76,10 +76,10 @@ public interface QueueFig extends GuicyFig { int getAsyncQueueSize(); /** - * Set the visibility timeout for faster retries + * Set the visibility timeout (in milliseconds) for faster retries * @return */ @Key( "usergrid.queue.visibilityTimeout" ) -@Default("10") -String getVisibilityTimeout(); +@Default("5000") // 5 seconds +int getVisibilityTimeout(); } http://git-wip-us.apache.org/repos/asf/usergrid/blob/2b22c610/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 a2b5d72..d476f76 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 @@ -351,7 +351,7 @@ public class SNSQueueManagerImpl implements QueueManager { ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(url); receiveMessageRequest.setMaxNumberOfMessages(limit); -receiveMessageRequest.setVisibilityTimeout(transactionTimeout / 1000); +receiveMessageRequest.setVisibilityTimeout(Math.max(1, transactionTimeout / 1000));
[10/33] usergrid git commit: USERGRID-1044: fix direct access on query failure
USERGRID-1044: fix direct access on query failure and log when name/uuid error/mismatch in payload occurs Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/9e813810 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/9e813810 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/9e813810 Branch: refs/heads/usergrid-1007-shiro-cache Commit: 9e813810756a1b48a23b1bac4d7cec6bc326f186 Parents: 2757e90 Author: Mike DunkerAuthored: Thu Oct 15 13:16:04 2015 -0700 Committer: Mike Dunker Committed: Thu Oct 15 13:16:04 2015 -0700 -- .../apache/usergrid/helpers/Extractors.scala| 18 - .../usergrid/scenarios/AuditScenarios.scala | 84 +++- .../scenarios/EntityCollectionScenarios.scala | 6 +- .../org/apache/usergrid/settings/Settings.scala | 19 + 4 files changed, 100 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/9e813810/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala index 8a18053..136a561 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/helpers/Extractors.scala @@ -41,9 +41,9 @@ object Extractors { } /** - * Will extract the uuid from the create response. If the uuid is not present, an empty string will be set + * Will extract the uuid from the response. If the uuid is not present, an empty string will be set */ - def extractCreateUuid(saveAsName: String) = { + def extractEntityUuid(saveAsName: String) = { jsonPath("$.entities[0].uuid").transformOption(extract => { //it may or may not be present. If it is, save it, otherwise save it as an empty string extract.orElse(Some("")) @@ -51,9 +51,19 @@ object Extractors { } /** - * Will extract the modified date from the create response. If the modified field is not present, -1 will be set + * Will extract the name from the response. If the name is not present, an empty string will be set */ - def extractCreateModified(saveAsName: String) = { + def extractEntityName(saveAsName: String) = { +jsonPath("$.entities[0].name").transformOption(extract => { + //it may or may not be present. If it is, save it, otherwise save it as an empty string + extract.orElse(Some("")) +}).saveAs(saveAsName) + } + + /** + * Will extract the modified date from the response. If the modified field is not present, -1 will be set + */ + def extractEntityModified(saveAsName: String) = { jsonPath("$.entities[0].modified").ofType[Long].transformOption(extract => { //it may or may not be present. If it is, save it, otherwise save it as -1 extract.orElse(Some(-1)) http://git-wip-us.apache.org/repos/asf/usergrid/blob/9e813810/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index 905c652..0b798a8 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -32,7 +32,8 @@ object AuditScenarios { //The value for the cursor val SessionVarCursor: String = "cursor" - val SessionVarUuid: String = "entityUuid" + val SessionVarEntityUuid: String = "entityUuid" + val SessionVarEntityName: String = "entityName" val SessionVarDeletedUuid: String = "deletedUuid" val SessionVarCollectionName: String = "collectionName" val SessionVarCollectionEntities: String = "collectionEntities" @@ -117,7 +118,7 @@ object AuditScenarios { http("DELETE audited entity") .delete("/${collectionName}/${uuid}") .headers(Headers.authToken) - .check(extractCreateUuid(SessionVarDeletedUuid))) + .check(extractEntityUuid(SessionVarDeletedUuid))) .exec(session => { val uuid = session(SessionVarDeletedUuid).as[String] @@ -136,28 +137,50 @@ object AuditScenarios { .get("/${collectionName}/${uuid}") .headers(Headers.authToken) .headers(Headers.auditRegionHeaders) - .check(status.is(200),jsonPath("$.count").optional.saveAs("count"),extractAuditEntities(SessionVarCollectionEntities))) + .check() +
[06/33] usergrid git commit: Another try at rename.
Another try at rename. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e7c805f1 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e7c805f1 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e7c805f1 Branch: refs/heads/usergrid-1007-shiro-cache Commit: e7c805f1e055c2bc2ad5ccb61aee9039488ff7a2 Parents: ec2c447 Author: Dave JohnsonAuthored: Thu Oct 15 11:02:49 2015 -0400 Committer: Dave Johnson Committed: Thu Oct 15 11:02:49 2015 -0400 -- website/content/community/index.html | 2 +- website/content/img/mike_d.jpg | Bin 36443 -> 0 bytes website/content/img/miked.jpg| Bin 0 -> 36443 bytes 3 files changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/e7c805f1/website/content/community/index.html -- diff --git a/website/content/community/index.html b/website/content/community/index.html index 1d5e479..6dacd6a 100644 --- a/website/content/community/index.html +++ b/website/content/community/index.html @@ -167,7 +167,7 @@ George Reyes - + Mike Dunker http://git-wip-us.apache.org/repos/asf/usergrid/blob/e7c805f1/website/content/img/mike_d.jpg -- diff --git a/website/content/img/mike_d.jpg b/website/content/img/mike_d.jpg deleted file mode 100644 index 8dca2ee..000 Binary files a/website/content/img/mike_d.jpg and /dev/null differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/e7c805f1/website/content/img/miked.jpg -- diff --git a/website/content/img/miked.jpg b/website/content/img/miked.jpg new file mode 100644 index 000..8dca2ee Binary files /dev/null and b/website/content/img/miked.jpg differ
[25/33] usergrid git commit: Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized.
Add null check back for batch sending of SQS w/proper SQS client. Less logging would occur in the event of batch send when the client is not initialized. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/fbb6c823 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fbb6c823 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fbb6c823 Branch: refs/heads/usergrid-1007-shiro-cache Commit: fbb6c823b7e2a1f5f55ab044942b38d1157970c0 Parents: d8e6572 Author: Michael RussoAuthored: Mon Oct 19 21:28:46 2015 -0700 Committer: Michael Russo Committed: Mon Oct 19 21:28:46 2015 -0700 -- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java| 5 + 1 file changed, 5 insertions(+) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/fbb6c823/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 3c18992..1bb00dc 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 @@ -543,6 +543,11 @@ public class SNSQueueManagerImpl implements QueueManager { @Override public void sendMessages( final List bodies ) throws IOException { +if ( sqsAsync == null ) { +logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); +return; +} + for ( Object body : bodies ) { sendMessage( ( Serializable ) body ); }
[05/33] usergrid git commit: Renaming to work around case issue.
Renaming to work around case issue. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/ec2c4478 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/ec2c4478 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/ec2c4478 Branch: refs/heads/usergrid-1007-shiro-cache Commit: ec2c4478875a8d7be4af3c770c3523d43e656e4f Parents: d68f450 Author: Dave JohnsonAuthored: Thu Oct 15 10:15:52 2015 -0400 Committer: Dave Johnson Committed: Thu Oct 15 10:15:52 2015 -0400 -- website/content/img/mike_d.jpg | Bin 0 -> 36443 bytes website/content/img/miked.jpg | Bin 36443 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/ec2c4478/website/content/img/mike_d.jpg -- diff --git a/website/content/img/mike_d.jpg b/website/content/img/mike_d.jpg new file mode 100644 index 000..8dca2ee Binary files /dev/null and b/website/content/img/mike_d.jpg differ http://git-wip-us.apache.org/repos/asf/usergrid/blob/ec2c4478/website/content/img/miked.jpg -- diff --git a/website/content/img/miked.jpg b/website/content/img/miked.jpg deleted file mode 100644 index 8dca2ee..000 Binary files a/website/content/img/miked.jpg and /dev/null differ
[14/17] usergrid git commit: Merge branch 'jacoco' of https://git-wip-us.apache.org/repos/asf/usergrid
Merge branch 'jacoco' of https://git-wip-us.apache.org/repos/asf/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/14499504 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/14499504 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/14499504 Branch: refs/heads/remove-inmemory-event-service Commit: 14499504908ab81f39cb0c87555b7fc1e016655e Parents: 59edea1 fb69ba3 Author: Shawn FeldmanAuthored: Tue Oct 20 15:33:48 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 15:33:48 2015 -0600 -- stack/Coverage.md| 21 ++ stack/core/pom.xml | 2 +- stack/corepersistence/collection/pom.xml | 50 +++--- stack/corepersistence/common/pom.xml | 16 + stack/corepersistence/graph/pom.xml | 94 ++- stack/corepersistence/map/pom.xml| 16 + stack/corepersistence/model/pom.xml | 16 + stack/corepersistence/pom.xml| 9 +++ stack/corepersistence/queryindex/pom.xml | 38 +++ stack/corepersistence/queue/pom.xml | 16 + stack/pom.xml| 88 - stack/rest/pom.xml | 8 ++- stack/services/pom.xml | 4 +- stack/test-utils/pom.xml | 2 +- stack/tools/pom.xml | 2 +- stack/websocket/pom.xml | 2 +- 16 files changed, 247 insertions(+), 137 deletions(-) --
[01/17] usergrid git commit: USERGRID-1044: support for multi-worker tests without end that can be audited
Repository: usergrid Updated Branches: refs/heads/remove-inmemory-event-service fad8ecdb0 -> af11143ea USERGRID-1044: support for multi-worker tests without end that can be audited Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/a9927a3b Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/a9927a3b Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/a9927a3b Branch: refs/heads/remove-inmemory-event-service Commit: a9927a3baa23bcd30dcacb4255af649c38ed3d90 Parents: 91fa489 Author: Mike DunkerAuthored: Tue Oct 6 14:24:40 2015 -0700 Committer: Mike Dunker Committed: Tue Oct 6 14:24:40 2015 -0700 -- stack/loadtests/runDeleteEntities.sh| 13 ++- stack/loadtests/runLoadEntitiesUnlimited.sh | 101 +++ .../datagenerators/FeederGenerator.scala| 9 +- .../usergrid/enums/ConfigProperties.scala | 11 +- .../apache/usergrid/helpers/Extractors.scala| 10 ++ .../scenarios/EntityCollectionScenarios.scala | 27 +++-- .../org/apache/usergrid/settings/Settings.scala | 94 - stack/loadtests/testConfig.sh | 2 + 8 files changed, 227 insertions(+), 40 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/a9927a3b/stack/loadtests/runDeleteEntities.sh -- diff --git a/stack/loadtests/runDeleteEntities.sh b/stack/loadtests/runDeleteEntities.sh index 2013e89..d0da19b 100755 --- a/stack/loadtests/runDeleteEntities.sh +++ b/stack/loadtests/runDeleteEntities.sh @@ -42,24 +42,27 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [NUM_ENTITIES [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" +[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) ENTITY_PREFIX [NUM_ENTITIES [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" RAMP_USERS="$1" RAMP_TIME="$2" -[ "$#" -ge 3 ] && NUM_ENTITIES="$3" -[ "$#" -ge 4 ] && ENTITY_SEED="$4" -[ "$#" -ge 5 ] && ENTITY_WORKER_NUM="$5" -[ "$#" -ge 6 ] && ENTITY_WORKER_COUNT="$6" +ENTITY_PREFIX="$3" +[ "$#" -ge 4 ] && NUM_ENTITIES="$4" +[ "$#" -ge 5 ] && ENTITY_SEED="$5" +[ "$#" -ge 6 ] && ENTITY_WORKER_NUM="$6" +[ "$#" -ge 7 ] && ENTITY_WORKER_COUNT="$7" shift $# SCENARIO_TYPE=deleteEntities +INTERLEAVED_WORKER_FEED=true #Compile everything mvn compile #Execute the test mvn gatling:execute \ +-DinterleavedWorkerFeed=${INTERLEAVED_WORKER_FEED} \ -DbaseUrl=${URL} \ -DadminUser=${ADMIN_USER} \ -DadminPassword=${ADMIN_PASSWORD} \ http://git-wip-us.apache.org/repos/asf/usergrid/blob/a9927a3b/stack/loadtests/runLoadEntitiesUnlimited.sh -- diff --git a/stack/loadtests/runLoadEntitiesUnlimited.sh b/stack/loadtests/runLoadEntitiesUnlimited.sh new file mode 100755 index 000..9222a57 --- /dev/null +++ b/stack/loadtests/runLoadEntitiesUnlimited.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +. "$DIR/testConfig.sh" + +# from testConfig.sh +#URL= +#ADMIN_USER= +#ADMIN_PASSWORD= +#ENTITY_WORKER_NUM= #may be overridden on command line +#ENTITY_WORKER_COUNT= #may be overridden on command line +#ORG= +#APP= +#AUTH_TYPE= +#TOKEN_TYPE= +#CREATE_ORG= +#CREATE_APP= +#SANDBOX_COLLECTION= +#NUM_ENTITIES= #ignored +#SKIP_SETUP= +#COLLECTION= +#ENTITY_TYPE= +#ENTITY_PREFIX= +#ENTITY_SEED= #may be overridden on command line +#RETRY_COUNT= +#ENTITY_PROGRESS_COUNT= +#CONSTANT_USERS_PER_SEC= +#CONSTANT_USERS_DURATION= +#FLUSH_CSV + +die() { echo "$@" 1>&2 ; exit 1; } + +[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" + +RAMP_USERS="$1" +RAMP_TIME="$2" +[ "$#" -ge 3 ] && UUID_FILENAME="$3" +[ "$#" -ge 4 ] && ENTITY_SEED="$4" +[ "$#" -ge 5 ] && ENTITY_WORKER_NUM="$5" +[ "$#" -ge 6 ] && ENTITY_WORKER_COUNT="$6" +
[13/17] usergrid git commit: Merge commit 'refs/pull/403/head' of github.com:apache/usergrid
Merge commit 'refs/pull/403/head' of github.com:apache/usergrid Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/1393c2f7 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/1393c2f7 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/1393c2f7 Branch: refs/heads/remove-inmemory-event-service Commit: 1393c2f76e44150352497f661907801151807806 Parents: 59edea1 2f307a7 Author: Michael RussoAuthored: Tue Oct 20 12:18:48 2015 -0700 Committer: Michael Russo Committed: Tue Oct 20 12:18:48 2015 -0700 -- .../runAuditVerifyCollectionEntities.sh | 11 +- stack/loadtests/runDeleteEntities.sh| 13 +- stack/loadtests/runLoadEntitiesUnlimited.sh | 103 + .../datagenerators/FeederGenerator.scala| 9 +- .../usergrid/enums/ConfigProperties.scala | 15 +- .../apache/usergrid/helpers/Extractors.scala| 24 ++- .../org/apache/usergrid/helpers/Headers.scala | 7 + .../usergrid/scenarios/AuditScenarios.scala | 121 ++- .../scenarios/EntityCollectionScenarios.scala | 38 - .../org/apache/usergrid/settings/Settings.scala | 150 +++ stack/loadtests/testConfig.sh | 3 + 11 files changed, 435 insertions(+), 59 deletions(-) --
[10/17] usergrid git commit: USERGRID-1044: add region to unlimited load test plus rename "auditRegion" to "usergridRegion" since it can be used for non-audit purposes
USERGRID-1044: add region to unlimited load test plus rename "auditRegion" to "usergridRegion" since it can be used for non-audit purposes Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2f307a75 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2f307a75 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2f307a75 Branch: refs/heads/remove-inmemory-event-service Commit: 2f307a75066204a894bd68115518e29064ae56cc Parents: 963a084 Author: Mike DunkerAuthored: Mon Oct 19 12:56:22 2015 -0700 Committer: Mike Dunker Committed: Mon Oct 19 12:56:22 2015 -0700 -- .../runAuditVerifyCollectionEntities.sh | 7 +++ stack/loadtests/runLoadEntitiesUnlimited.sh | 4 +++- .../usergrid/enums/ConfigProperties.scala | 6 +++--- .../org/apache/usergrid/helpers/Headers.scala | 4 ++-- .../usergrid/scenarios/AuditScenarios.scala | 10 - .../scenarios/EntityCollectionScenarios.scala | 22 ++-- .../org/apache/usergrid/settings/Settings.scala | 2 +- stack/loadtests/testConfig.sh | 1 + 8 files changed, 29 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/runAuditVerifyCollectionEntities.sh -- diff --git a/stack/loadtests/runAuditVerifyCollectionEntities.sh b/stack/loadtests/runAuditVerifyCollectionEntities.sh index fa75505..695c9ee 100755 --- a/stack/loadtests/runAuditVerifyCollectionEntities.sh +++ b/stack/loadtests/runAuditVerifyCollectionEntities.sh @@ -28,18 +28,17 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi #RETRY_COUNT= DELETE_AFTER_SUCCESSFUL_AUDIT=false -AUDIT_REGION= die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)[AUDIT_REGION]]]" +[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)[USERGRID_REGION]]]" RAMP_USERS="$1" RAMP_TIME="$2" AUDIT_UUID_FILENAME="$3" FAILED_UUID_FILENAME="$4" [ "$#" -ge 5 ] && DELETE_AFTER_SUCCESSFUL_AUDIT="$5" -[ "$#" -ge 6 ] && AUDIT_REGION="$6" +[ "$#" -ge 6 ] && USERGRID_REGION="$6" shift $# @@ -65,6 +64,6 @@ mvn gatling:execute \ -DfailedUuidFilename=${FAILED_UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ -DdeleteAfterSuccessfulAudit=${DELETE_AFTER_SUCCESSFUL_AUDIT} \ --DauditRegion=${AUDIT_REGION} \ +-DusergridRegion=${USERGRID_REGION} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.AuditSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/runLoadEntitiesUnlimited.sh -- diff --git a/stack/loadtests/runLoadEntitiesUnlimited.sh b/stack/loadtests/runLoadEntitiesUnlimited.sh index 9222a57..11ca0a4 100755 --- a/stack/loadtests/runLoadEntitiesUnlimited.sh +++ b/stack/loadtests/runLoadEntitiesUnlimited.sh @@ -44,7 +44,7 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT" +[ "$#" -ge 2 ] || die "At least 2 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) [UUID_FILENAME [ENTITY_SEED [ENTITY_WORKER_NUM [ENTITY_WORKER_COUNT [USERGRID_REGION]" RAMP_USERS="$1" RAMP_TIME="$2" @@ -52,6 +52,7 @@ RAMP_TIME="$2" [ "$#" -ge 4 ] && ENTITY_SEED="$4" [ "$#" -ge 5 ] && ENTITY_WORKER_NUM="$5" [ "$#" -ge 6 ] && ENTITY_WORKER_COUNT="$6" +[ "$#" -ge 7 ] && USERGRID_REGION="$6" shift $# @@ -97,5 +98,6 @@ mvn gatling:execute \ -DrampTime=${RAMP_TIME} \ -DuuidFilename=${UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ +-DusergridRegion=${USERGRID_REGION} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.ConfigurableSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/2f307a75/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala index d825bb6..f74222e 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala +++
[04/17] usergrid git commit: USERGRID-1044: if query audit fails, try direct access
USERGRID-1044: if query audit fails, try direct access Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/2757e905 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/2757e905 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/2757e905 Branch: refs/heads/remove-inmemory-event-service Commit: 2757e905d9a2cf38adf426df6604dd78e8a512ac Parents: b62ad30 Author: Mike DunkerAuthored: Thu Oct 15 09:34:14 2015 -0700 Committer: Mike Dunker Committed: Thu Oct 15 09:34:14 2015 -0700 -- .../usergrid/scenarios/AuditScenarios.scala | 40 ++-- .../org/apache/usergrid/settings/Settings.scala | 19 +++--- 2 files changed, 50 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/2757e905/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index aaabf99..905c652 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala @@ -131,6 +131,38 @@ object AuditScenarios { session }) + val getCollectionEntityDirect = exec( +http("GET collection entity direct") + .get("/${collectionName}/${uuid}") + .headers(Headers.authToken) + .headers(Headers.auditRegionHeaders) + .check(status.is(200),jsonPath("$.count").optional.saveAs("count"),extractAuditEntities(SessionVarCollectionEntities))) + .exec(session => { +val count = session("count").as[String].toInt +val uuid = session("uuid").as[String] +val entityName = session("name").as[String] +val modified = session("modified").as[String].toLong +val collectionName = session(SessionVarCollectionName).as[String] + +if (count < 1) { + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditNotFoundAtAll() + println(s"NOT FOUND AT ALL: $collectionName.$entityName ($uuid)") +} else if (count == 1) { + // found via direct access but not query + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditNotFoundViaQuery() + println(s"NOT FOUND VIA QUERY: $collectionName.$entityName ($uuid)") +} else { + // count > 1 -> invalid + Settings.addAuditUuid(uuid, collectionName, entityName, modified) + Settings.incAuditBadResponse() + println(s"INVALID RESPONSE (count=$count): $collectionName.$entityName ($uuid)") +} + +session + }) + val getCollectionEntity = exec( http("GET collection entity") .get("/${collectionName}?ql=uuid=${uuid}") @@ -145,20 +177,22 @@ object AuditScenarios { val collectionName = session(SessionVarCollectionName).as[String] if (count < 1) { - Settings.addAuditUuid(uuid, collectionName, entityName, modified) - Settings.incAuditNotFound() - println(s"NOT FOUND: $collectionName.$entityName ($uuid)") + // will check to see whether accessible directly } else if (count > 1) { Settings.addAuditUuid(uuid, collectionName, entityName, modified) Settings.incAuditBadResponse() println(s"INVALID RESPONSE (count=$count): $collectionName.$entityName ($uuid)") } else { + // count == 1 -> success // println(s"FOUND: $collectionName.$entityName ($uuid)") Settings.incAuditSuccess() } session }) + .doIf(session => session("count").as[String].toInt < 1) { +exec(getCollectionEntityDirect) + } .doIf(session => Settings.deleteAfterSuccessfulAudit && session("count").as[String].toInt == 1) { // tryMax(Settings.retryCount) { exec(deleteAuditedEntity) http://git-wip-us.apache.org/repos/asf/usergrid/blob/2757e905/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala index 979fb3f..374440d 100755 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/settings/Settings.scala @@ -429,7 +429,8 @@ object Settings { } private val
[15/17] usergrid git commit: fix rat check
fix rat check Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/c71133f6 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/c71133f6 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/c71133f6 Branch: refs/heads/remove-inmemory-event-service Commit: c71133f6d4797f5f1d5576082aa40ba009e763f1 Parents: 1449950 Author: Shawn FeldmanAuthored: Tue Oct 20 15:59:16 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 15:59:16 2015 -0600 -- stack/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/c71133f6/stack/pom.xml -- diff --git a/stack/pom.xml b/stack/pom.xml index 2236e22..344502c 100644 --- a/stack/pom.xml +++ b/stack/pom.xml @@ -1568,7 +1568,8 @@ - +**/Coverage.md +**/jacoco/** **/README.md **/CHANGES.txt **/*.json
[02/17] usergrid git commit: USERGRID-1044: add option to delete entity after successful audit
USERGRID-1044: add option to delete entity after successful audit Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/9b2508f7 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/9b2508f7 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/9b2508f7 Branch: refs/heads/remove-inmemory-event-service Commit: 9b2508f7d4d47af9bfd28ba6953072e0aa1eff90 Parents: a9927a3b Author: Mike DunkerAuthored: Thu Oct 8 13:19:28 2015 -0700 Committer: Mike Dunker Committed: Thu Oct 8 13:19:28 2015 -0700 -- .../runAuditVerifyCollectionEntities.sh | 9 +--- .../usergrid/enums/ConfigProperties.scala | 4 +++- .../usergrid/scenarios/AuditScenarios.scala | 23 .../org/apache/usergrid/settings/Settings.scala | 17 +++ 4 files changed, 49 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/9b2508f7/stack/loadtests/runAuditVerifyCollectionEntities.sh -- diff --git a/stack/loadtests/runAuditVerifyCollectionEntities.sh b/stack/loadtests/runAuditVerifyCollectionEntities.sh index 6d963f3..2e2d76d 100755 --- a/stack/loadtests/runAuditVerifyCollectionEntities.sh +++ b/stack/loadtests/runAuditVerifyCollectionEntities.sh @@ -27,17 +27,19 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi #TOKEN_TYPE= #RETRY_COUNT= +DELETE_AFTER_SUCCESSFUL_AUDIT=false + die() { echo "$@" 1>&2 ; exit 1; } -[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME]" +[ "$#" -ge 3 ] || die "At least 3 arguments required, $# provided. Example is $0 RAMP_USERS RAMP_TIME(seconds) AUDIT_UUID_FILENAME [FAILED_UUID_FILENAME [DELETE_AFTER_SUCCESSFUL_AUDIT(true/false)]]" RAMP_USERS="$1" RAMP_TIME="$2" AUDIT_UUID_FILENAME="$3" FAILED_UUID_FILENAME="$4" -[ "$#" -ge 5 ] && LATER_THAN_TIMESTAMP="$5" +[ "$#" -ge 5 ] && DELETE_AFTER_SUCCESSFUL_AUDIT="$5" -shift 4 +shift $# SCENARIO_TYPE=auditVerifyCollectionEntities @@ -60,5 +62,6 @@ mvn gatling:execute \ -DauditUuidFilename=${AUDIT_UUID_FILENAME} \ -DfailedUuidFilename=${FAILED_UUID_FILENAME} \ -DprintFailedRequests=${PRINT_FAILED_REQUESTS} \ +-DdeleteAfterSuccessfulAudit=${DELETE_AFTER_SUCCESSFUL_AUDIT} \ -Dgatling.simulationClass=org.apache.usergrid.simulations.AuditSimulation http://git-wip-us.apache.org/repos/asf/usergrid/blob/9b2508f7/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala index ba09979..975944a 100644 --- a/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala +++ b/stack/loadtests/src/main/scala/org/apache/usergrid/enums/ConfigProperties.scala @@ -85,6 +85,7 @@ object ConfigProperties { val FlushCsv = "flushCsv" val InterleavedWorkerFeed = "interleavedWorkerFeed" val NewCsvOnFlush = "newCsvOnFlush" + val DeleteAfterSuccessfulAudit = "deleteAfterSuccessfulAudit" val Values = Seq(Org,App,AdminUser,AdminPassword,BaseUrl,AuthType,TokenType,SkipSetup,CreateOrg,CreateApp,LoadEntities, ScenarioType,RampUsers,ConstantUsersPerSec,ConstantUsersDuration,UserSeed,AppUser,AppUserPassword,NumEntities, @@ -94,7 +95,7 @@ object ConfigProperties { UuidFilename,AuditUuidFilename,FailedUuidFilename,SandboxCollection,PurgeUsers,RetryCount,LaterThanTimestamp, EntityProgressCount,InjectionList,PrintFailedRequests,GetViaQuery,MultiPropertyPrefix,MultiPropertyCount, MultiPropertySizeInK,EntityNumberProperty,QueryParams,CsvFeedPattern,UnlimitedFeed,FlushCsv,InterleavedWorkerFeed, -NewCsvOnFlush) +NewCsvOnFlush,DeleteAfterSuccessfulAudit) def isValid(str: String): Boolean = { Values.contains(str) @@ -167,6 +168,7 @@ object ConfigProperties { case FlushCsv => 0L case InterleavedWorkerFeed => false case NewCsvOnFlush => false +case DeleteAfterSuccessfulAudit => false } } else { null http://git-wip-us.apache.org/repos/asf/usergrid/blob/9b2508f7/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala -- diff --git a/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala b/stack/loadtests/src/main/scala/org/apache/usergrid/scenarios/AuditScenarios.scala index 3a7121b..836a1fb 100644 ---
[12/17] usergrid git commit: Merge branch 'master' into jacoco
Merge branch 'master' into jacoco Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/fb69ba3e Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/fb69ba3e Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/fb69ba3e Branch: refs/heads/remove-inmemory-event-service Commit: fb69ba3e9052134b55392431ce9dfe6d879ac9d1 Parents: 29f5717 a679aea Author: Dave JohnsonAuthored: Tue Oct 20 13:42:54 2015 -0400 Committer: Dave Johnson Committed: Tue Oct 20 13:42:54 2015 -0400 -- .../asyncevents/AmazonAsyncEventService.java| 40 ++--- .../asyncevents/AsyncIndexProvider.java | 10 +- .../asyncevents/model/AsyncEvent.java | 14 +- .../asyncevents/model/EdgeDeleteEvent.java | 6 +- .../asyncevents/model/EdgeIndexEvent.java | 9 +- .../asyncevents/model/EntityDeleteEvent.java| 8 +- .../asyncevents/model/EntityIndexEvent.java | 6 +- .../model/InitializeApplicationIndexEvent.java | 4 +- .../index/IndexProcessorFig.java| 7 +- .../index/AmazonAsyncEventServiceTest.java | 6 +- .../cache/CachedEntityCollectionManager.java| 147 --- .../EntityCollectionManagerFactoryImpl.java | 6 - .../usergrid/persistence/queue/QueueFig.java| 8 +- .../queue/impl/SNSQueueManagerImpl.java | 8 +- .../queue/impl/SQSQueueManagerImpl.java | 2 +- .../queue/util/AmazonNotificationUtils.java | 4 +- 16 files changed, 74 insertions(+), 211 deletions(-) --
[08/17] usergrid git commit: Add Jacoco to all modules.
Add Jacoco to all modules. Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/0f6f052e Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/0f6f052e Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/0f6f052e Branch: refs/heads/remove-inmemory-event-service Commit: 0f6f052e574183eb8a1b937bbac903d5e0629749 Parents: e7c805f Author: Dave JohnsonAuthored: Mon Oct 19 14:03:53 2015 -0400 Committer: Dave Johnson Committed: Mon Oct 19 14:03:53 2015 -0400 -- stack/core/pom.xml | 2 +- stack/corepersistence/collection/pom.xml | 50 +++--- stack/corepersistence/common/pom.xml | 16 + stack/corepersistence/graph/pom.xml | 16 + stack/corepersistence/map/pom.xml| 16 + stack/corepersistence/model/pom.xml | 16 + stack/corepersistence/queryindex/pom.xml | 10 +++ stack/corepersistence/queue/pom.xml | 16 + stack/pom.xml| 95 ++- stack/rest/pom.xml | 8 ++- stack/services/pom.xml | 4 +- stack/test-utils/pom.xml | 2 +- stack/tools/pom.xml | 2 +- stack/websocket/pom.xml | 2 +- 14 files changed, 191 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/core/pom.xml -- diff --git a/stack/core/pom.xml b/stack/core/pom.xml index 15470ad..e0f8d43 100644 --- a/stack/core/pom.xml +++ b/stack/core/pom.xml @@ -89,7 +89,7 @@ ${usergrid.it.forkCount} ${usergrid.it.threads} true --Dtest.barrier.timestamp=${maven.build.timestamp} -Dtest.clean.storage=true -Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline} +-Dtest.barrier.timestamp=${maven.build.timestamp} -Dtest.clean.storage=true -Xmx${ug.heapmax} -Xms${ug.heapmin} -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec -javaagent:${settings.localRepository}/com/github/stephenc/jamm/0.2.5/jamm-0.2.5.jar ${ug.argline} http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/corepersistence/collection/pom.xml -- diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml index 8d5ca57..62fadf7 100644 --- a/stack/corepersistence/collection/pom.xml +++ b/stack/corepersistence/collection/pom.xml @@ -18,48 +18,16 @@ - - - + +org.apache.maven.plugins +maven-surefire-plugin +${surefire.plugin.version} + + -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec + + + http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/corepersistence/common/pom.xml -- diff --git a/stack/corepersistence/common/pom.xml b/stack/corepersistence/common/pom.xml index 5481573..6e1e81b 100644 --- a/stack/corepersistence/common/pom.xml +++ b/stack/corepersistence/common/pom.xml @@ -12,6 +12,22 @@ common Usergrid Common + + + + + +org.apache.maven.plugins +maven-surefire-plugin +${surefire.plugin.version} + + -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${project.build.directory}/jacoco.exec + + + + + + http://git-wip-us.apache.org/repos/asf/usergrid/blob/0f6f052e/stack/corepersistence/graph/pom.xml -- diff --git a/stack/corepersistence/graph/pom.xml b/stack/corepersistence/graph/pom.xml index 1b02dd4..776380f 100644 --- a/stack/corepersistence/graph/pom.xml +++ b/stack/corepersistence/graph/pom.xml @@ -33,6 +33,22 @@ Usergrid Graph + + + + + +org.apache.maven.plugins +maven-surefire-plugin +${surefire.plugin.version}
[11/23] usergrid git commit: change queue impl
change queue impl Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/4fa6749f Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/4fa6749f Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/4fa6749f Branch: refs/heads/master Commit: 4fa6749f027ece9388725dcdeb875f4bddbf7f5f Parents: 0cc225f Author: Shawn FeldmanAuthored: Fri Oct 16 15:07:36 2015 -0600 Committer: Shawn Feldman Committed: Fri Oct 16 15:07:36 2015 -0600 -- .../persistence/queue/DefaultQueueManager.java | 34 1 file changed, 27 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/4fa6749f/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java -- diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java index 0ef2849..ae0b0aa 100644 --- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java +++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java @@ -30,17 +30,29 @@ import java.util.UUID; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.PriorityBlockingQueue; +import java.util.concurrent.TimeUnit; /** * Default queue manager implementation, uses in memory linked queue */ public class DefaultQueueManager implements QueueManager { -public LinkedBlockingQueue queue = new LinkedBlockingQueue<>(); +public ArrayBlockingQueue queue = new ArrayBlockingQueue<>(1000); @Override -public Observable getMessages(int limit, int transactionTimeout, int waitTime, Class klass) { +publicObservable getMessages(int limit, int transactionTimeout, int waitTime, Class klass) { List returnQueue = new ArrayList<>(); -queue.drainTo(returnQueue,1000); +try { +QueueMessage message=null; +int count = 10; +do { +message = queue.poll(100, TimeUnit.MILLISECONDS); +if (message != null) { +returnQueue.add(message); +} +}while(message!=null && count-->0); +}catch (InterruptedException ie){ +throw new RuntimeException(ie); +} return Observable.from( returnQueue); } @@ -58,17 +70,25 @@ public class DefaultQueueManager implements QueueManager { } @Override -public synchronized void sendMessages(List bodies) throws IOException { +public void sendMessages(List bodies) throws IOException { for(Object body : bodies){ String uuid = UUID.randomUUID().toString(); -queue.add(new QueueMessage(uuid,"handle_"+uuid,body,"putappriate type here")); +try { +queue.put(new QueueMessage(uuid, "handle_" + uuid, body, "put type here")); +}catch (InterruptedException ie){ +throw new RuntimeException(ie); +} } } @Override -public synchronized void sendMessage(Object body) throws IOException { +public void sendMessage(Object body) throws IOException { String uuid = UUID.randomUUID().toString(); -queue.add(new QueueMessage(uuid,"handle_"+uuid,body,"put type here")); +try { +queue.put(new QueueMessage(uuid, "handle_" + uuid, body, "put type here")); +}catch (InterruptedException ie){ +throw new RuntimeException(ie); +} } @Override
[03/23] usergrid git commit: merge master
merge master Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/e17dab4c Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/e17dab4c Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/e17dab4c Branch: refs/heads/master Commit: e17dab4c05f581b984f9e77e59d903fe0e482a1f Parents: f8614a6 91fa489 Author: Shawn FeldmanAuthored: Fri Oct 9 15:36:04 2015 -0600 Committer: Shawn Feldman Committed: Fri Oct 9 15:36:04 2015 -0600 -- README-Docs.md |13 + README.md |10 +- content/bootstrap/bootstrap.min.css | 9 + content/community/index.html|22 +- content/css/bootflat-extensions.css | 356 + content/css/bootflat-square.css |69 + content/css/bootflat.css| 1560 + content/css/font-awesome.min.css| 405 + content/css/usergrid-site.css | 1553 + .../docs/_sources/jersey2skeleton/README.txt| 9 + .../creating-and-managing-notifications.txt | 2 + .../docs/_sources/rest-endpoints/api-docs.txt | 653 +- content/docs/jersey2skeleton/README.html| 303 + .../creating-and-managing-notifications.html| 1 + content/docs/rest-endpoints/api-docs.html | 533 +- content/docs/searchindex.js | 2 +- content/favicon.ico | Bin 0 -> 3989 bytes content/font/FontAwesome.otf| Bin 0 -> 61896 bytes content/font/fontawesome-webfont-eot.eot| Bin 0 -> 37405 bytes content/font/fontawesome-webfont-svg.svg| 399 + content/font/fontawesome-webfont-ttf.ttf| Bin 0 -> 79076 bytes content/font/fontawesome-webfont-woff.woff | Bin 0 -> 43572 bytes content/img/alberto.jpg | Bin 0 -> 16137 bytes content/img/alex.png| Bin 0 -> 40842 bytes content/img/apache_usergrid_favicon.png | Bin 0 -> 10735 bytes content/img/apache_usergrid_logo_white.png | Bin 0 -> 26418 bytes .../img/apache_usergrid_logo_white_small.png| Bin 0 -> 11905 bytes content/img/check_flat/default.png | Bin 0 -> 25851 bytes content/img/dave.jpg| Bin 0 -> 14005 bytes content/img/ed.jpg | Bin 0 -> 20460 bytes content/img/egg-logo.png| Bin 0 -> 9938 bytes content/img/github.png | Bin 0 -> 8936 bytes content/img/grey.png| Bin 0 -> 37896 bytes content/img/intellij.png| Bin 0 -> 9199 bytes content/img/jeff.jpg| Bin 0 -> 13857 bytes content/img/michael_r.jpg | Bin 0 -> 10244 bytes content/img/mike_d.JPG | Bin 0 -> 36443 bytes content/img/nate.jpg| Bin 0 -> 4291 bytes content/img/rod.jpg | Bin 0 -> 40313 bytes content/img/scott.jpg | Bin 0 -> 8555 bytes content/img/shawn.jpg | Bin 0 -> 69304 bytes content/img/stliu.jpg | Bin 0 -> 51303 bytes content/img/strong.jpg | Bin 0 -> 7434 bytes content/img/structure101.png| Bin 0 -> 6475 bytes content/img/sungju.jpg | Bin 0 -> 11440 bytes content/img/tim.jpg | Bin 0 -> 7611 bytes content/img/todd.jpg| Bin 0 -> 18142 bytes content/img/usergrid-logo.pdf | 398 + content/img/usergrid.png| Bin 0 -> 21994 bytes content/img/usergrid_160.png| Bin 0 -> 2126 bytes content/img/usergrid_200.png| Bin 0 -> 6397 bytes content/img/usergrid_300.png| Bin 0 -> 16330 bytes content/img/usergrid_300_transparent.png| Bin 0 -> 16308 bytes content/img/usergrid_400.png| Bin 0 -> 8746 bytes content/img/usergrid_800.png| Bin 0 -> 14452 bytes content/img/usergrid_card.png | Bin 0 -> 23295 bytes content/img/usergrid_logo.png | Bin 0 -> 118086 bytes content/img/usergrid_logo_205_50.png| Bin 0 -> 7058 bytes content/img/usergrid_logo_260_50.png| Bin 0 -> 8682 bytes content/img/usergrid_logo_720.png | Bin 0 -> 27610 bytes content/img/usergrid_logo_720p.png | Bin 0 -> 27608 bytes content/img/usergrid_logo_900_200.png | Bin 0 -> 12273 bytes content/img/usergrid_logo_white.png | Bin 0
[20/23] usergrid git commit: merge
merge Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/68befd2f Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/68befd2f Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/68befd2f Branch: refs/heads/master Commit: 68befd2f04d03dbd3e9370af89c257a8a28112a1 Parents: 00175cc Author: Shawn FeldmanAuthored: Mon Oct 19 15:13:34 2015 -0600 Committer: Shawn Feldman Committed: Mon Oct 19 15:13:34 2015 -0600 -- .../index/IndexProcessorFig.java| 36 ++-- 1 file changed, 11 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/68befd2f/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java index 113b539..8a8c8a5 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java @@ -49,15 +49,15 @@ public interface IndexProcessorFig extends GuicyFig { * Set the amount of time to wait when Elasticsearch rejects a requests before * retrying. This provides simple back pressure. (in milliseconds) */ -@Default( "1000" ) -@Key( FAILURE_REJECTED_RETRY_WAIT_TIME ) +@Default("1000") +@Key(FAILURE_REJECTED_RETRY_WAIT_TIME) long getFailureRetryTime(); /** * Set the read timeout for processing messages in the queue. (in milliseconds) */ -@Default( "1" ) -@Key( INDEX_QUEUE_READ_TIMEOUT ) +@Default("1") +@Key(INDEX_QUEUE_READ_TIMEOUT) int getIndexQueueTimeout(); /** @@ -65,15 +65,15 @@ public interface IndexProcessorFig extends GuicyFig { * Received messages will remain 'in flight' until they are ack'd(deleted) or this timeout occurs. * If the timeout occurs, the messages will become visible again for re-processing. */ -@Default( "5000" ) // 5 seconds -@Key( INDEX_QUEUE_VISIBILITY_TIMEOUT ) +@Default("5000") // 5 seconds +@Key(INDEX_QUEUE_VISIBILITY_TIMEOUT) int getIndexQueueVisibilityTimeout(); /** * The number of worker threads used to read index write requests from the queue. */ -@Default( "16" ) -@Key( ELASTICSEARCH_WORKER_COUNT ) +@Default("16") +@Key(ELASTICSEARCH_WORKER_COUNT) int getWorkerCount(); /** @@ -81,26 +81,12 @@ public interface IndexProcessorFig extends GuicyFig { * Valid values: TEST, LOCAL, SQS, SNS * NOTE: SQS and SNS equate to the same implementation of Amazon queue services. */ -@Default( "LOCAL" ) -@Key( ELASTICSEARCH_QUEUE_IMPL ) +@Default("LOCAL") +@Key(ELASTICSEARCH_QUEUE_IMPL) String getQueueImplementation(); @Default("1000") -@Key("elasticsearch.reindex.flush.interval") -int getUpdateInterval(); - -@Default("100") -@Key("elasticsearch.buffer.time_ms") -int getBufferTime(); - -@Default("1000") -@Key( REINDEX_BUFFER_SIZE ) +@Key(REINDEX_BUFFER_SIZE) int getReindexBufferSize(); -/** - * Flag to resolve the LOCAL queue implementation service synchronously. - */ -@Default("false") -@Key("elasticsearch.queue_impl.resolution") -boolean resolveSynchronously(); }
[05/23] usergrid git commit: remove observable
remove observable Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/32d35e7d Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/32d35e7d Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/32d35e7d Branch: refs/heads/master Commit: 32d35e7d5e605005b3f530e3a1e390d394c29c0a Parents: f6409ce Author: Shawn FeldmanAuthored: Tue Oct 13 10:42:58 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 13 10:42:58 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 109 ++- 1 file changed, 55 insertions(+), 54 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/32d35e7d/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java index 6f41563..0fef974 100644 --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java @@ -259,65 +259,66 @@ public class AmazonAsyncEventService implements AsyncEventService { logger.debug("callEventHandlers with {} message", messages.size()); } -Observable masterObservable = Observable.from(messages).map(message -> { -AsyncEvent event = null; -try { -event = (AsyncEvent) message.getBody(); -} catch (ClassCastException cce) { -logger.error("Failed to deserialize message body", cce); -} - -if (event == null) { -logger.error("AsyncEvent type or event is null!"); -return new IndexEventResult(Optional.fromNullable(message), Optional.absent(), System.currentTimeMillis()); -} - -final AsyncEvent thisEvent = event; -if (logger.isDebugEnabled()) { -logger.debug("Processing {} event", event); -} - -try { -Observable indexoperationObservable; -//merge each operation to a master observable; -if (event instanceof EdgeDeleteEvent) { -indexoperationObservable = handleEdgeDelete(message); -} else if (event instanceof EdgeIndexEvent) { -indexoperationObservable = handleEdgeIndex(message); -} else if (event instanceof EntityDeleteEvent) { -indexoperationObservable = handleEntityDelete(message); -} else if (event instanceof EntityIndexEvent) { -indexoperationObservable = handleEntityIndexUpdate(message); -} else if (event instanceof InitializeApplicationIndexEvent) { -//does not return observable -handleInitializeApplicationIndex(event, message); -indexoperationObservable = Observable.just(new IndexOperationMessage()); -} else { -throw new Exception("Unknown EventType");//TODO: print json instead +List indexEventResults = messages.stream() +.map(message -> { +AsyncEvent event = null; +try { +event = (AsyncEvent) message.getBody(); +} catch (ClassCastException cce) { +logger.error("Failed to deserialize message body", cce); } -//collect all of the -IndexOperationMessage indexOperationMessage = -indexoperationObservable -.collect(() -> new IndexOperationMessage(), (collector, single) -> collector.ingest(single)) -.toBlocking().lastOrDefault(null); +if (event == null) { +logger.error("AsyncEvent type or event is null!"); +return new IndexEventResult(Optional.fromNullable(message), Optional.absent(), System.currentTimeMillis()); +} -if (indexOperationMessage == null || indexOperationMessage.isEmpty()) { -logger.info("Received empty index sequence message:({}), body:({}) ", -message.getMessageId(),message.getStringBody()); +final AsyncEvent thisEvent = event; +if (logger.isDebugEnabled()) { +logger.debug("Processing {} event", event); } -//return
[21/23] usergrid git commit: merge from 1048
merge from 1048 Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/5eed63d4 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/5eed63d4 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/5eed63d4 Branch: refs/heads/master Commit: 5eed63d43999c8f381e2fbcbe7d2c1fdb6b73729 Parents: 68befd2 4013f17 Author: Shawn FeldmanAuthored: Mon Oct 19 15:19:33 2015 -0600 Committer: Shawn Feldman Committed: Mon Oct 19 15:19:33 2015 -0600 -- .../asyncevents/AmazonAsyncEventService.java| 377 .../asyncevents/AsyncEventService.java | 1 + .../asyncevents/AsyncIndexProvider.java | 14 +- .../asyncevents/model/AsyncEvent.java | 8 +- .../model/ElasticsearchIndexEvent.java | 50 ++ .../index/IndexProcessorFig.java| 17 + .../util/ObjectJsonSerializer.java | 92 +++ .../index/AmazonAsyncEventServiceTest.java | 6 +- .../index/AsyncIndexServiceTest.java| 2 +- .../usergrid/persistence/map/MapManager.java| 25 +- .../persistence/map/impl/MapManagerImpl.java| 6 + .../persistence/map/impl/MapSerialization.java | 27 +- .../map/impl/MapSerializationImpl.java | 265 .../index/impl/DeIndexOperation.java| 4 + .../persistence/index/impl/IndexOperation.java | 4 + .../index/impl/IndexOperationMessage.java | 5 + .../persistence/queue/LocalQueueManager.java| 12 +- .../persistence/queue/QueueManager.java | 8 +- .../persistence/queue/guice/QueueModule.java| 1 - .../queue/impl/SNSQueueManagerImpl.java | 615 +++ .../queue/impl/SQSQueueManagerImpl.java | 352 --- .../services/queues/ImportQueueManager.java | 9 +- 22 files changed, 1017 insertions(+), 883 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/5eed63d4/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AmazonAsyncEventService.java -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/5eed63d4/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AsyncIndexProvider.java -- diff --cc stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AsyncIndexProvider.java index 1ad9b86,2bace8d..aafb63a --- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AsyncIndexProvider.java +++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/asyncevents/AsyncIndexProvider.java @@@ -27,7 -27,7 +27,8 @@@ import org.apache.usergrid.persistence. import org.apache.usergrid.persistence.core.metrics.MetricsFactory; import org.apache.usergrid.persistence.index.EntityIndexFactory; import org.apache.usergrid.persistence.index.impl.IndexProducer; +import org.apache.usergrid.persistence.queue.LocalQueueManager; + import org.apache.usergrid.persistence.map.MapManagerFactory; import org.apache.usergrid.persistence.queue.QueueFig; import org.apache.usergrid.persistence.queue.QueueManagerFactory; @@@ -99,16 -103,12 +104,15 @@@ public class AsyncIndexProvider impleme switch (impl) { case LOCAL: -return new InMemoryAsyncEventService(eventBuilder, rxTaskScheduler, indexProducer,indexProcessorFig.resolveSynchronously()); +AmazonAsyncEventService eventService = new AmazonAsyncEventService(scope -> new LocalQueueManager(), indexProcessorFig, indexProducer, metricsFactory, - entityCollectionManagerFactory, indexLocationStrategyFactory, entityIndexFactory, eventBuilder, rxTaskScheduler,queueFig); ++entityCollectionManagerFactory, indexLocationStrategyFactory, entityIndexFactory, eventBuilder,mapManagerFactory, queueFig,rxTaskScheduler); +eventService.MAX_TAKE = 1000; +return eventService; case SQS: - return new AmazonAsyncEventService(queueManagerFactory, indexProcessorFig, indexProducer, metricsFactory, - entityCollectionManagerFactory, indexLocationStrategyFactory,entityIndexFactory, eventBuilder, rxTaskScheduler,queueFig ); + throw new IllegalArgumentException("Configuration value of SQS is no longer allowed. Use SNS instead with only a single region"); case SNS: return new AmazonAsyncEventService(queueManagerFactory, indexProcessorFig, indexProducer, metricsFactory, - entityCollectionManagerFactory, indexLocationStrategyFactory,entityIndexFactory, eventBuilder, rxTaskScheduler, queueFig);
[17/23] usergrid git commit: remove excess interfaces
remove excess interfaces Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/efffe474 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/efffe474 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/efffe474 Branch: refs/heads/master Commit: efffe474bdca1223222f955204301f604dea40b8 Parents: e5e9d02 Author: Shawn FeldmanAuthored: Mon Oct 19 11:38:25 2015 -0600 Committer: Shawn Feldman Committed: Mon Oct 19 11:38:25 2015 -0600 -- .../corepersistence/CpEntityManager.java| 7 +- .../corepersistence/CpEntityManagerFactory.java | 3 +- .../asyncevents/AsyncIndexProvider.java | 7 +- .../usergrid/persistence/EntityManager.java | 5 +- .../persistence/EntityManagerFactory.java | 4 +- .../corepersistence/StaleIndexCleanupTest.java | 5 +- .../persistence/query/IteratingQueryIT.java | 1 + .../usergrid/persistence/index/EntityIndex.java | 20 +++- .../persistence/index/IndexRefreshCommand.java | 50 -- .../persistence/index/guice/IndexModule.java| 1 - .../index/impl/EsEntityIndexFactoryImpl.java| 6 +- .../index/impl/EsEntityIndexImpl.java | 38 ++-- .../index/impl/IndexRefreshCommandImpl.java | 97 --- .../persistence/index/impl/EntityIndexTest.java | 2 +- .../persistence/queue/DefaultQueueManager.java | 98 .../persistence/queue/LocalQueueManager.java| 98 .../queue/impl/QueueManagerFactoryImpl.java | 4 +- .../apns/NotificationsServiceIT.java| 4 +- .../gcm/NotificationsServiceIT.java | 2 - 19 files changed, 170 insertions(+), 282 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/efffe474/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 addd6ef..4b32389 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 @@ -40,7 +40,6 @@ import org.apache.usergrid.corepersistence.service.CollectionService; import org.apache.usergrid.corepersistence.service.ConnectionService; import org.apache.usergrid.persistence.index.EntityIndex; import org.apache.usergrid.persistence.index.IndexLocationStrategy; -import org.apache.usergrid.persistence.index.IndexRefreshCommand; import org.apache.usergrid.persistence.index.utils.*; import org.apache.usergrid.utils.*; import org.apache.usergrid.utils.ClassUtils; @@ -2877,7 +2876,7 @@ public class CpEntityManager implements EntityManager { /** * TODO, these 3 methods are super janky. During refactoring we should clean this model up */ -public IndexRefreshCommand.IndexRefreshCommandInfo refreshIndex() { +public EntityIndex.IndexRefreshCommandInfo refreshIndex() { try { long start = System.currentTimeMillis(); // refresh special indexes without calling EntityManager refresh because stack overflow @@ -2885,7 +2884,7 @@ public class CpEntityManager implements EntityManager { map.put("some prop", "test"); boolean hasFinished = false; Entity refreshEntity = create("refresh", map); -IndexRefreshCommand.IndexRefreshCommandInfo indexRefreshCommandInfo +EntityIndex.IndexRefreshCommandInfo indexRefreshCommandInfo = managerCache.getEntityIndex(applicationScope).refreshAsync().toBlocking().first(); try { for (int i = 0; i < 10; i++) { @@ -2899,6 +2898,7 @@ public class CpEntityManager implements EntityManager { break; } Thread.sleep(200); + indexRefreshCommandInfo = managerCache.getEntityIndex(applicationScope).refreshAsync().toBlocking().first(); } @@ -2908,6 +2908,7 @@ public class CpEntityManager implements EntityManager { }finally { delete(refreshEntity); } +Thread.sleep(200); return indexRefreshCommandInfo; } catch (Exception e) { http://git-wip-us.apache.org/repos/asf/usergrid/blob/efffe474/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java -- diff --git
[13/23] usergrid git commit: Merge branch '2.1-release' of https://git-wip-us.apache.org/repos/asf/usergrid into remove-inmemory-event-service
Merge branch '2.1-release' of https://git-wip-us.apache.org/repos/asf/usergrid into remove-inmemory-event-service Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/9673169d Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/9673169d Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/9673169d Branch: refs/heads/master Commit: 9673169dc7c28167ccf391496afd7faeaaffd321 Parents: b6f8e71 2b22c61 Author: Shawn FeldmanAuthored: Fri Oct 16 15:08:18 2015 -0600 Committer: Shawn Feldman Committed: Fri Oct 16 15:08:18 2015 -0600 -- .../usergrid/corepersistence/index/IndexProcessorFig.java | 7 +++ .../java/org/apache/usergrid/persistence/queue/QueueFig.java | 6 +++--- .../usergrid/persistence/queue/impl/SNSQueueManagerImpl.java | 2 +- .../persistence/queue/util/AmazonNotificationUtils.java | 4 +++- 4 files changed, 10 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/9673169d/stack/core/src/main/java/org/apache/usergrid/corepersistence/index/IndexProcessorFig.java --
Git Push Summary
Repository: usergrid Updated Branches: refs/heads/remove-inmemory-event-service [deleted] af11143ea
[23/23] usergrid git commit: Merge branch 'master' into remove-inmemory-event-service
Merge branch 'master' into remove-inmemory-event-service Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/af11143e Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/af11143e Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/af11143e Branch: refs/heads/master Commit: af11143ead2d1bfc539ca2515b87d548614d52d1 Parents: fad8ecd efa96dc Author: Shawn FeldmanAuthored: Tue Oct 20 16:00:16 2015 -0600 Committer: Shawn Feldman Committed: Tue Oct 20 16:00:16 2015 -0600 -- stack/Coverage.md | 21 +++ stack/core/pom.xml | 2 +- stack/corepersistence/collection/pom.xml| 50 ++- stack/corepersistence/common/pom.xml| 16 ++ stack/corepersistence/graph/pom.xml | 94 +--- stack/corepersistence/map/pom.xml | 16 ++ stack/corepersistence/model/pom.xml | 16 ++ stack/corepersistence/pom.xml | 9 ++ stack/corepersistence/queryindex/pom.xml| 38 +++-- stack/corepersistence/queue/pom.xml | 16 ++ .../runAuditVerifyCollectionEntities.sh | 11 +- stack/loadtests/runDeleteEntities.sh| 13 +- stack/loadtests/runLoadEntitiesUnlimited.sh | 103 + .../datagenerators/FeederGenerator.scala| 9 +- .../usergrid/enums/ConfigProperties.scala | 15 +- .../apache/usergrid/helpers/Extractors.scala| 24 ++- .../org/apache/usergrid/helpers/Headers.scala | 7 + .../usergrid/scenarios/AuditScenarios.scala | 121 ++- .../scenarios/EntityCollectionScenarios.scala | 38 - .../org/apache/usergrid/settings/Settings.scala | 150 +++ stack/loadtests/testConfig.sh | 3 + stack/pom.xml | 91 --- stack/rest/pom.xml | 8 +- stack/services/pom.xml | 4 +- stack/test-utils/pom.xml| 2 +- stack/tools/pom.xml | 2 +- stack/websocket/pom.xml | 2 +- 27 files changed, 684 insertions(+), 197 deletions(-) --
[12/23] usergrid git commit: change queue impl
change queue impl Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/b6f8e711 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/b6f8e711 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/b6f8e711 Branch: refs/heads/master Commit: b6f8e711c7a0eb2334a0b92cd826615d0b413392 Parents: 4fa6749 Author: Shawn FeldmanAuthored: Fri Oct 16 15:08:11 2015 -0600 Committer: Shawn Feldman Committed: Fri Oct 16 15:08:11 2015 -0600 -- .../org/apache/usergrid/persistence/queue/DefaultQueueManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/usergrid/blob/b6f8e711/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java -- diff --git a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java index ae0b0aa..a6bc8cf 100644 --- a/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java +++ b/stack/corepersistence/queue/src/main/java/org/apache/usergrid/persistence/queue/DefaultQueueManager.java @@ -49,7 +49,7 @@ public class DefaultQueueManager implements QueueManager { if (message != null) { returnQueue.add(message); } -}while(message!=null && count-->0); +}while(queue.size()>0 && count-->0); }catch (InterruptedException ie){ throw new RuntimeException(ie); }