You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2014/08/20 20:32:07 UTC

[1/7] git commit: Add retry logic to awscluster's NodeRegistry script.

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 3416ac0b8 -> ac0ca5de0


Add retry logic to awscluster's NodeRegistry script.


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

Branch: refs/heads/two-dot-o
Commit: 61b21ecc5b455643fe3af476ac54b8bf999f3b2e
Parents: 3416ac0
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Aug 18 15:59:26 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Aug 18 15:59:26 2014 -0400

----------------------------------------------------------------------
 .../awscluster/src/main/groovy/NodeRegistry.groovy | 17 ++++++++++++-----
 .../src/main/groovy/configure_cassandra.groovy     | 10 +---------
 2 files changed, 13 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/61b21ecc/stack/awscluster/src/main/groovy/NodeRegistry.groovy
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/groovy/NodeRegistry.groovy b/stack/awscluster/src/main/groovy/NodeRegistry.groovy
index f6394c2..7389073 100644
--- a/stack/awscluster/src/main/groovy/NodeRegistry.groovy
+++ b/stack/awscluster/src/main/groovy/NodeRegistry.groovy
@@ -36,11 +36,18 @@ class NodeRegistry {
 
 
     NodeRegistry() {
-        // creates domain or no-op if it already exists
-        creds = new BasicAWSCredentials(accessKey, secretKey)
-        sdbClient = new AmazonSimpleDBClient(creds)
-
-        sdbClient.createDomain(new CreateDomainRequest(domain))
+        while ( true ) {
+            try {
+                // creates domain or no-op if it already exists
+                creds = new BasicAWSCredentials(accessKey, secretKey)
+                sdbClient = new AmazonSimpleDBClient(creds)
+                sdbClient.createDomain(new CreateDomainRequest(domain))
+
+            } catch ( Exception e ) {
+                continue
+            }
+            break
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/61b21ecc/stack/awscluster/src/main/groovy/configure_cassandra.groovy
----------------------------------------------------------------------
diff --git a/stack/awscluster/src/main/groovy/configure_cassandra.groovy b/stack/awscluster/src/main/groovy/configure_cassandra.groovy
index 161b1c8..9e5ded2 100644
--- a/stack/awscluster/src/main/groovy/configure_cassandra.groovy
+++ b/stack/awscluster/src/main/groovy/configure_cassandra.groovy
@@ -34,15 +34,7 @@ int cassNumServers = ((String)System.getenv().get("CASSANDRA_NUM_SERVERS")).toIn
 
 // build seed list by listing all Cassandra nodes found in SimpleDB domain with our stackName
 
-NodeRegistry registry = null
-while ( registry == null ) {
-    try {
-        registry = new NodeRegistry()
-    } catch ( Exception e ) {
-        Thread.sleep(2000);
-        continue;
-    }
-}
+NodeRegistry registry = new NodeRegistry();
 
 def selectResult = registry.searchNode('cassandra')
 def seeds = ""


[4/7] git commit: Fix to ES refresh index logic fixes one of the MUUserResourceIT tests (USERGRID-209).

Posted by sn...@apache.org.
Fix to ES refresh index logic fixes one of the MUUserResourceIT tests (USERGRID-209).


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

Branch: refs/heads/two-dot-o
Commit: 648becf6a1e89e061f7fd14a3ae45ad0333315fa
Parents: 25fbf0d
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Aug 20 10:31:32 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Aug 20 10:31:32 2014 -0400

----------------------------------------------------------------------
 .../corepersistence/CpEntityManager.java        |  7 +++---
 .../corepersistence/CpEntityManagerFactory.java | 19 ++++++++++++++--
 .../rest/management/users/MUUserResourceIT.java | 24 ++++++++++++--------
 3 files changed, 34 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/648becf6/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 7795550..b216294 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
@@ -2789,14 +2789,13 @@ public class CpEntityManager implements EntityManager {
     @Override
     public void refreshIndex() {
 
-        // refresh system indexes 
+        // refresh factory indexes
         emf.refreshIndex();
 
         // refresh this Entity Manager's application's index
         IndexScope indexScope = new IndexScopeImpl( 
-                appScope.getApplication(), 
-                appScope.getApplication(), 
-                "dummy" );
+                appScope.getApplication(), appScope.getApplication(), "dummy" );
+
         EntityIndex ei = managerCache.getEntityIndex( indexScope );
         ei.refresh();
     }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/648becf6/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 502d08c..2863842 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -537,9 +537,24 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
 
     public void refreshIndex() {
+
+        // refresh factory's indexes, will refresh all three index scopes
         managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_APPS_INDEX_SCOPE ).refresh();
-        managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_ORGS_INDEX_SCOPE ).refresh();
-        managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_PROPS_INDEX_SCOPE ).refresh();
+
+        // these are unecessary because of above call
+        //managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_ORGS_INDEX_SCOPE ).refresh();
+        //managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_PROPS_INDEX_SCOPE ).refresh();
+
+        // refresh special indexes without calling EntityManager refresh because stack overflow 
+        IndexScope mscope = new IndexScopeImpl( 
+                new SimpleId( getManagementAppId(), "application"), 
+                new SimpleId( getManagementAppId(), "application"), "dummy");
+        managerCache.getEntityIndex( mscope ).refresh();
+
+        IndexScope dscope = new IndexScopeImpl( 
+                new SimpleId( getDefaultAppId(), "application"), 
+                new SimpleId( getDefaultAppId(), "application"), "dummy");
+        managerCache.getEntityIndex( dscope ).refresh();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/648becf6/stack/rest/src/test/java/org/apache/usergrid/rest/management/users/MUUserResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/users/MUUserResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/users/MUUserResourceIT.java
index bcf3b51..928e50f 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/users/MUUserResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/users/MUUserResourceIT.java
@@ -112,7 +112,7 @@ public class MUUserResourceIT extends AbstractRestIT {
 
 
     @Test
-    @Ignore // Because JSP is broken in test setup, possibly due to JSTL classloader issue
+    //@Ignore // Because JSP is broken in test setup, possibly due to JSTL classloader issue
     // see also: https://issues.apache.org/jira/browse/USERGRID-209 
     public void testUnconfirmedAdminLogin() throws Exception {
 
@@ -140,8 +140,8 @@ public class MUUserResourceIT extends AbstractRestIT {
             String passwd = "testpassword";
             OrganizationOwnerInfo orgOwner;
 
-            orgOwner = setup.getMgmtSvc()
-                            .createOwnerAndOrganization( orgName, userName, appName, email, passwd, false, false );
+            orgOwner = setup.getMgmtSvc().createOwnerAndOrganization( 
+                    orgName, userName, appName, email, passwd, false, false );
             assertNotNull( orgOwner );
             String returnedUsername = orgOwner.getOwner().getUsername();
             assertEquals( userName, returnedUsername );
@@ -155,8 +155,10 @@ public class MUUserResourceIT extends AbstractRestIT {
             // -------------------------------------------
             JsonNode node;
             try {
-                node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
-                        .queryParam( "username", userName ).queryParam( "password", passwd )
+                node = mapper.readTree( resource().path( "/management/token" )
+                        .queryParam( "grant_type", "password" )
+                        .queryParam( "username", userName )
+                        .queryParam( "password", passwd )
                         .accept( MediaType.APPLICATION_JSON ).get( String.class ));
 
                 fail( "Unconfirmed users should not be authorized to authenticate." );
@@ -185,8 +187,8 @@ public class MUUserResourceIT extends AbstractRestIT {
             String token = getTokenFromMessage( confirmation );
             LOG.info( token );
 
-            ActivationState state =
-                    setup.getMgmtSvc().handleConfirmationTokenForAdminUser( orgOwner.getOwner().getUuid(), token );
+            ActivationState state = setup.getMgmtSvc().handleConfirmationTokenForAdminUser( 
+                    orgOwner.getOwner().getUuid(), token );
             assertEquals( ActivationState.ACTIVATED, state );
 
             Message activation = inbox.get( 1 );
@@ -195,13 +197,15 @@ public class MUUserResourceIT extends AbstractRestIT {
             client = new MockImapClient( "mockserver.com", "test-user-46", "somepassword" );
             client.processMail();
 
-        refreshIndex(context.getOrgName(), context.getAppName());
+            refreshIndex(orgName, appName);
 
             // Attempt to authenticate again but this time should pass
             // -------------------------------------------
 
-            node = mapper.readTree( resource().path( "/management/token" ).queryParam( "grant_type", "password" )
-                    .queryParam( "username", userName ).queryParam( "password", passwd )
+            node = mapper.readTree( resource().path( "/management/token" )
+                    .queryParam( "grant_type", "password" )
+                    .queryParam( "username", userName )
+                    .queryParam( "password", passwd )
                     .accept( MediaType.APPLICATION_JSON ).get( String.class ));
 
             assertNotNull( node );


[7/7] git commit: Better settings for running Core, Services and REST tests in two-dot-o branch.

Posted by sn...@apache.org.
Better settings for running Core, Services and REST tests in two-dot-o branch.


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

Branch: refs/heads/two-dot-o
Commit: ac0ca5de0c4bdae9b1c62a44c0bda94292432d69
Parents: 7bf22d6
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Aug 20 14:23:17 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Aug 20 14:23:17 2014 -0400

----------------------------------------------------------------------
 .../core/src/test/resources/usergrid-custom-test.properties  | 6 +++---
 .../rest/src/test/resources/usergrid-custom-test.properties  | 8 ++++----
 .../src/test/resources/usergrid-custom-test.properties       | 6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ac0ca5de/stack/core/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/core/src/test/resources/usergrid-custom-test.properties b/stack/core/src/test/resources/usergrid-custom-test.properties
index 71ed1d4..9af6f91 100644
--- a/stack/core/src/test/resources/usergrid-custom-test.properties
+++ b/stack/core/src/test/resources/usergrid-custom-test.properties
@@ -16,7 +16,7 @@
 # with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml) 
 cassandra.startup=embedded
 elasticsearch.startup=embedded
-cassandra.timeout=5000
+cassandra.timeout=2000
 cassandra.connections=1000
-hystrix.threadpool.graph_user.coreSize=100
-hystrix.threadpool.graph_async.coreSize=100
+hystrix.threadpool.graph_user.coreSize=200
+hystrix.threadpool.graph_async.coreSize=200

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ac0ca5de/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-custom-test.properties b/stack/rest/src/test/resources/usergrid-custom-test.properties
index d8643b3..8d39006 100644
--- a/stack/rest/src/test/resources/usergrid-custom-test.properties
+++ b/stack/rest/src/test/resources/usergrid-custom-test.properties
@@ -15,16 +15,16 @@
 # these settings allow tests to run and consistently pass on 16GB MacBook Pro 
 # with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml) 
 tomcat.startup=embedded
-tomcat.threads=500
+tomcat.threads=200
 
 cassandra.startup=forked
 cassandra.timeout=2000
-cassandra.connections=1500
+cassandra.connections=800
 
 elasticsearch.startup=forked
 
-hystrix.threadpool.graph_user.coreSize=50
-hystrix.threadpool.graph_async.coreSize=50
+hystrix.threadpool.graph_user.coreSize=1200
+hystrix.threadpool.graph_async.coreSize=1200
 
 # needed to enable refresh and properties end-points used in tests
 usergrid.test=true

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ac0ca5de/stack/services/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/services/src/test/resources/usergrid-custom-test.properties b/stack/services/src/test/resources/usergrid-custom-test.properties
index 7f141f8..71c7acc 100644
--- a/stack/services/src/test/resources/usergrid-custom-test.properties
+++ b/stack/services/src/test/resources/usergrid-custom-test.properties
@@ -16,7 +16,7 @@
 # with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml) 
 cassandra.startup=embedded
 elasticsearch.startup=embedded
-cassandra.timeout=5000
+cassandra.timeout=2000
 cassandra.connections=1000
-hystrix.threadpool.graph_user.coreSize=100
-hystrix.threadpool.graph_async.coreSize=100
+hystrix.threadpool.graph_user.coreSize=200
+hystrix.threadpool.graph_async.coreSize=200


[5/7] git commit: Clean up some Tomcat dependencies, also fix formatting in web.xml.

Posted by sn...@apache.org.
Clean up some Tomcat dependencies, also fix formatting in web.xml.


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

Branch: refs/heads/two-dot-o
Commit: aa5f24d16e2ddfa3c4d93891c16d3c35d518631f
Parents: 648becf
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Aug 20 14:22:19 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Aug 20 14:22:19 2014 -0400

----------------------------------------------------------------------
 stack/rest/pom.xml                         |  2 --
 stack/rest/src/main/webapp/WEB-INF/web.xml | 34 ++++++++++++-------------
 stack/test-utils/pom.xml                   |  5 ----
 3 files changed, 17 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aa5f24d1/stack/rest/pom.xml
----------------------------------------------------------------------
diff --git a/stack/rest/pom.xml b/stack/rest/pom.xml
index b780709..adaf848 100644
--- a/stack/rest/pom.xml
+++ b/stack/rest/pom.xml
@@ -265,7 +265,6 @@
 
         <!-- SUN, Javax Package, and Other Com Dependencies -->
 
-
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
@@ -277,7 +276,6 @@
             <artifactId>jstl</artifactId>
         </dependency>
 
-
         <dependency>
             <groupId>com.sun.jersey.contribs</groupId>
             <artifactId>jersey-multipart</artifactId>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aa5f24d1/stack/rest/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/webapp/WEB-INF/web.xml b/stack/rest/src/main/webapp/WEB-INF/web.xml
index 80019a6..92753de 100644
--- a/stack/rest/src/main/webapp/WEB-INF/web.xml
+++ b/stack/rest/src/main/webapp/WEB-INF/web.xml
@@ -17,50 +17,50 @@
 -->
 <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
 
-  <display-name>Usergrid REST API Server</display-name>
+    <display-name>Usergrid REST API Server</display-name>
 
-  <context-param>
+    <context-param>
         <param-name>contextConfigLocation</param-name>
         <param-value>classpath:usergrid-rest-deploy-context.xml</param-value>
     </context-param>
 
-  <listener>
+    <listener>
         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener>
   
-  <listener>
+    <listener>
         <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
     </listener>
 
-  <filter>
+    <filter>
         <filter-name>swaggerFilter</filter-name>
         <filter-class>org.apache.usergrid.rest.SwaggerServlet</filter-class>
     </filter>
 
-  <filter-mapping>
+    <filter-mapping>
         <filter-name>swaggerFilter</filter-name>
         <url-pattern>/resources.json</url-pattern>
     </filter-mapping>
-  <filter-mapping>
+    <filter-mapping>
         <filter-name>swaggerFilter</filter-name>
         <url-pattern>/applications.json</url-pattern>
     </filter-mapping>
-  <filter-mapping>
+    <filter-mapping>
         <filter-name>swaggerFilter</filter-name>
         <url-pattern>/management.json</url-pattern>
     </filter-mapping>
 
-  <!--  filter for setting default accept and Content-Type as application/json when undefined by client -->
-  <filter>
+    <!--  filter for setting default accept and Content-Type as application/json when undefined by client -->
+    <filter>
         <filter-name>contentTypeFilter</filter-name>
         <filter-class>org.apache.usergrid.rest.filters.ContentTypeFilter</filter-class>
     </filter>
-  <filter-mapping>
+    <filter-mapping>
         <filter-name>contentTypeFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
-  `
-  <filter>
+    `
+    <filter>
         <filter-name>shiroFilter</filter-name>
         <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
         <init-param>
@@ -68,12 +68,12 @@
             <param-value>true</param-value>
         </init-param>
     </filter>
-  <filter-mapping>
+    <filter-mapping>
         <filter-name>shiroFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
 	
-  <filter>
+    <filter>
         <filter-name>Usergrid REST API Server</filter-name>
         <filter-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</filter-class>
         <init-param>
@@ -114,12 +114,12 @@
         </init-param>
     </filter>
 
-  <filter-mapping>
+    <filter-mapping>
         <filter-name>Usergrid REST API Server</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
 
-  <jsp-config>
+    <jsp-config>
         <taglib>
             <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
             <taglib-location>c.tld</taglib-location>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/aa5f24d1/stack/test-utils/pom.xml
----------------------------------------------------------------------
diff --git a/stack/test-utils/pom.xml b/stack/test-utils/pom.xml
index 96ca346..a548b1e 100644
--- a/stack/test-utils/pom.xml
+++ b/stack/test-utils/pom.xml
@@ -250,11 +250,6 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.tomcat</groupId>
-            <artifactId>tomcat-catalina</artifactId>
-        </dependency>
-
-        <dependency>
             <groupId>org.apache.tomcat.embed</groupId>
             <artifactId>tomcat-embed-core</artifactId>
         </dependency>


[2/7] git commit: Make Tomcat threads configurable (in REST tests).

Posted by sn...@apache.org.
Make Tomcat threads configurable (in REST tests).


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

Branch: refs/heads/two-dot-o
Commit: f0822b7c5b5c473cd43ba40d860809573570c616
Parents: 61b21ec
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Aug 18 15:59:57 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Aug 18 15:59:57 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/usergrid/rest/TomcatResource.java   |  4 +++-
 .../src/test/resources/usergrid-custom-test.properties  | 12 ++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f0822b7c/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatResource.java b/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatResource.java
index 645370b..8f16f8d 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatResource.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/TomcatResource.java
@@ -191,10 +191,12 @@ public class TomcatResource extends ExternalResource {
 
             port = AvailablePortFinder.getNextAvailable( 9998 + RandomUtils.nextInt(10)  );
 
+            String threads = (String)properties.get("tomcat.threads");
+
             tomcat = new Tomcat();
             tomcat.setBaseDir( dataDir.getAbsolutePath() );
             tomcat.setPort( port );
-            tomcat.getConnector().setAttribute("maxThreads", "1500");
+            tomcat.getConnector().setAttribute("maxThreads", "2000");
             tomcat.addWebapp( "/", new File( getWebAppsPath() ).getAbsolutePath() );
 
             log.info("-----------------------------------------------------------------");

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/f0822b7c/stack/rest/src/test/resources/usergrid-custom-test.properties
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/resources/usergrid-custom-test.properties b/stack/rest/src/test/resources/usergrid-custom-test.properties
index 901952f..d8643b3 100644
--- a/stack/rest/src/test/resources/usergrid-custom-test.properties
+++ b/stack/rest/src/test/resources/usergrid-custom-test.properties
@@ -15,12 +15,16 @@
 # these settings allow tests to run and consistently pass on 16GB MacBook Pro 
 # with ug.heapmax=5000m and ug.heapmin=3000m (set in Maven settings.xml) 
 tomcat.startup=embedded
+tomcat.threads=500
+
 cassandra.startup=forked
+cassandra.timeout=2000
+cassandra.connections=1500
+
 elasticsearch.startup=forked
-cassandra.timeout=5000
-cassandra.connections=600
-hystrix.threadpool.graph_user.coreSize=30
-hystrix.threadpool.graph_async.coreSize=30
+
+hystrix.threadpool.graph_user.coreSize=50
+hystrix.threadpool.graph_async.coreSize=50
 
 # needed to enable refresh and properties end-points used in tests
 usergrid.test=true


[3/7] git commit: Fix PagingEntriesTest by adding better ES index refresh logic.

Posted by sn...@apache.org.
Fix PagingEntriesTest by adding better ES index refresh logic.


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

Branch: refs/heads/two-dot-o
Commit: 25fbf0d15a1318229b9c70bbfcd7bc052ebd3cbb
Parents: f0822b7
Author: Dave Johnson <dm...@apigee.com>
Authored: Mon Aug 18 16:00:25 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Mon Aug 18 16:00:25 2014 -0400

----------------------------------------------------------------------
 .../apache/usergrid/corepersistence/CpEntityManagerFactory.java  | 2 ++
 .../java/org/apache/usergrid/rest/test/RefreshIndexResource.java | 4 +++-
 .../applications/collection/activities/PagingEntitiesTest.java   | 2 +-
 .../apache/usergrid/rest/management/ManagementResourceIT.java    | 2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/25fbf0d1/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 8d7d882..502d08c 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -538,6 +538,8 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
     public void refreshIndex() {
         managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_APPS_INDEX_SCOPE ).refresh();
+        managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_ORGS_INDEX_SCOPE ).refresh();
+        managerCache.getEntityIndex( CpEntityManagerFactory.SYSTEM_PROPS_INDEX_SCOPE ).refresh();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/25fbf0d1/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
index 10b3b97..27da7c2 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
@@ -76,8 +76,10 @@ public class RefreshIndexResource extends AbstractContextResource {
                 em.refreshIndex();
             } 
 
-            // refresh the system app
+            // refresh the system apps
             emf.refreshIndex();
+            emf.getEntityManager( emf.getDefaultAppId() );
+            emf.getEntityManager( emf.getManagementAppId() );
 
         } catch (Exception e) {
             logger.error("Error in refresh", e);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/25fbf0d1/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/activities/PagingEntitiesTest.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/activities/PagingEntitiesTest.java b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/activities/PagingEntitiesTest.java
index effc618..ab9f0f0 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/activities/PagingEntitiesTest.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/applications/collection/activities/PagingEntitiesTest.java
@@ -52,7 +52,7 @@ public class PagingEntitiesTest extends AbstractRestIT {
         CustomCollection activities = context.collection( "activities" );
 
         long created = 0;
-        int maxSize = 1500;
+        int maxSize = 100;
         long[] verifyCreated = new long[maxSize];
         Map actor = hashMap( "displayName", "Erin" );
         Map props = new HashMap();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/25fbf0d1/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
index 827bac3..af02c65 100644
--- a/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
+++ b/stack/rest/src/test/java/org/apache/usergrid/rest/management/ManagementResourceIT.java
@@ -277,7 +277,9 @@ public class ManagementResourceIT extends AbstractRestIT {
         int i = 0;
         for ( String user : followers ) {
             createUser( user );
+            refreshIndex("test-organization", "test-app");
             follow( user, leader );
+            refreshIndex("test-organization", "test-app");
         }
         userFeed = getUserFeed( lastUser );
         assertTrue( userFeed.size() == 1 );


[6/7] git commit: Fix to ES index refresh logic.

Posted by sn...@apache.org.
Fix to ES index refresh logic.


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

Branch: refs/heads/two-dot-o
Commit: 7bf22d65a633406d868840b5d122a382a741d9c2
Parents: aa5f24d
Author: Dave Johnson <dm...@apigee.com>
Authored: Wed Aug 20 14:22:46 2014 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Wed Aug 20 14:22:46 2014 -0400

----------------------------------------------------------------------
 .../usergrid/corepersistence/CpEntityManagerFactory.java     | 8 ++++----
 .../org/apache/usergrid/rest/test/RefreshIndexResource.java  | 8 +++-----
 2 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7bf22d65/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
----------------------------------------------------------------------
diff --git a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
index 2863842..f9fe945 100644
--- a/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
+++ b/stack/core/src/main/java/org/apache/usergrid/corepersistence/CpEntityManagerFactory.java
@@ -547,13 +547,13 @@ public class CpEntityManagerFactory implements EntityManagerFactory, Application
 
         // refresh special indexes without calling EntityManager refresh because stack overflow 
         IndexScope mscope = new IndexScopeImpl( 
-                new SimpleId( getManagementAppId(), "application"), 
-                new SimpleId( getManagementAppId(), "application"), "dummy");
+            new SimpleId( getManagementAppId(), "application"), 
+            new SimpleId( getManagementAppId(), "application"), "dummy");
         managerCache.getEntityIndex( mscope ).refresh();
 
         IndexScope dscope = new IndexScopeImpl( 
-                new SimpleId( getDefaultAppId(), "application"), 
-                new SimpleId( getDefaultAppId(), "application"), "dummy");
+            new SimpleId( getDefaultAppId(), "application"), 
+            new SimpleId( getDefaultAppId(), "application"), "dummy");
         managerCache.getEntityIndex( dscope ).refresh();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/7bf22d65/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
----------------------------------------------------------------------
diff --git a/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java b/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
index 27da7c2..4d0adb7 100644
--- a/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
+++ b/stack/rest/src/main/java/org/apache/usergrid/rest/test/RefreshIndexResource.java
@@ -63,6 +63,9 @@ public class RefreshIndexResource extends AbstractContextResource {
                 throw new UnsupportedOperationException();
             }
 
+            // refresh the system apps or app lookup below may fail
+            emf.refreshIndex();
+
             UUID appId;
             if ( orgName != null && appName != null ) {
                 appId = emf.lookupApplication( orgName + "/" + appName );
@@ -76,11 +79,6 @@ public class RefreshIndexResource extends AbstractContextResource {
                 em.refreshIndex();
             } 
 
-            // refresh the system apps
-            emf.refreshIndex();
-            emf.getEntityManager( emf.getDefaultAppId() );
-            emf.getEntityManager( emf.getManagementAppId() );
-
         } catch (Exception e) {
             logger.error("Error in refresh", e);
             return Response.serverError().build();