usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [31/50] [abbrv] git commit: Fix allowed destroy signal and bugs
Date Mon, 07 Jul 2014 18:16:48 GMT
Fix allowed destroy signal and bugs


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

Branch: refs/heads/two-dot-o
Commit: a735c5ff3a467cb4421f9aabb6c4490a73cbcafb
Parents: 61596df
Author: Furkan Bicak <bicak.cs@safehaus.org>
Authored: Sat Jun 28 19:53:12 2014 +0300
Committer: Furkan Bicak <bicak.cs@safehaus.org>
Committed: Sat Jun 28 19:53:12 2014 +0300

----------------------------------------------------------------------
 .../usergrid/chop/stack/SetupStackState.java    | 33 +++++++++++++-------
 chop/webapp/pom.xml                             |  3 +-
 .../webapp/coordinator/StackCoordinator.java    |  2 +-
 .../coordinator/rest/DestroyResource.java       |  4 +--
 .../rest/RunnerRegistryResource.java            | 11 +++----
 5 files changed, 30 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a735c5ff/chop/stack/src/main/java/org/apache/usergrid/chop/stack/SetupStackState.java
----------------------------------------------------------------------
diff --git a/chop/stack/src/main/java/org/apache/usergrid/chop/stack/SetupStackState.java
b/chop/stack/src/main/java/org/apache/usergrid/chop/stack/SetupStackState.java
index 4015d2c..3e6fdba 100644
--- a/chop/stack/src/main/java/org/apache/usergrid/chop/stack/SetupStackState.java
+++ b/chop/stack/src/main/java/org/apache/usergrid/chop/stack/SetupStackState.java
@@ -40,53 +40,62 @@ public enum SetupStackState {
     // Running ==> (Complete signal) ==> SetUp
     // Running ==> (Destroy signal) ==> Destroying
     // Running ==> (Stop signal) ==> Stopped
-    Running( 7, new SetupStackSignal[] { SetupStackSignal.STOP, SetupStackSignal.DESTROY,
SetupStackSignal.COMPLETE }, new Integer[] { 6, 4, 0 },
+    Running( 7, new SetupStackSignal[] { SetupStackSignal.STOP, SetupStackSignal.DESTROY,
SetupStackSignal.COMPLETE },
+            new Integer[] { 6, 4, 0 },
             "Running tests on stack.",
             "%s signal rejected. When Running only STOP, DESTROY and COMPLETE signal(s) which
cause to transition into " +
                     "Stopped, Destroying and SetUp state(s) respectively" ),
 
     // Stopped ==> (reset signal) ==> SetUp
-    Stopped( 6, new SetupStackSignal[] { SetupStackSignal.RESET, SetupStackSignal.DESTROY
}, new Integer[] { 0, 4 },
+    Stopped( 6, new SetupStackSignal[] { SetupStackSignal.RESET, SetupStackSignal.DESTROY
},
+            new Integer[] { 0, 4 },
             "Tests are stopped while running, please reset first.",
             "%s signal rejected. When Stopped only RESET and DESTROY signal(s) which cause
to transition into " +
                     "SetUp, Destroying state(s) respectively" ),
 
+    // JarNotFound ==> (setup signal) ==> SettingUp
     // JarNotFound ==> (deploy signal) ==> NotSetUp
-    JarNotFound( 5, new SetupStackSignal[] { SetupStackSignal.DEPLOY, SetupStackSignal.SETUP
}, new Integer[] { 3, 1 },
+    JarNotFound( 5, new SetupStackSignal[] { SetupStackSignal.DEPLOY, SetupStackSignal.SETUP
},
+            new Integer[] { 3, 1 },
             "No runner jars found with given parameters, deploy first.",
             "%s signal rejected. When JarNotFound only DEPLOY and SETUP signal(s) which cause
to transition into " +
                     "NotSetUp and SettingUp state(s) respectively" ),
 
     // Destroying ==> (Complete signal) ==> NotSetUp
-    Destroying( 4, new SetupStackSignal[] { SetupStackSignal.COMPLETE }, new Integer[] {
3 },
+    Destroying( 4, new SetupStackSignal[] { SetupStackSignal.COMPLETE },
+            new Integer[] { 3 },
             "Currently being destroyed. Wait until it is finished to set up again.",
             "%s signal rejected. When Destroying only COMPLETE signal(s) can be sent which
cause to " +
                     "transition into NotSetUp state(s) respectively" ),
 
-    // NotSetUp ==> (setup signal) ==> NotSetUp
+    // NotSetUp ==> (deploy signal) ==> NotSetUp
     // NotSetUp ==> (setup signal) ==> SettingUp
-    NotSetUp( 3, new SetupStackSignal[] { SetupStackSignal.SETUP, SetupStackSignal.DEPLOY
}, new Integer[] { 1, 3 },
+    NotSetUp( 3, new SetupStackSignal[] { SetupStackSignal.SETUP, SetupStackSignal.DEPLOY
},
+            new Integer[] { 1, 3 },
             "Jar is deployed but no stack set up with it.",
             "%s signal rejected. When NotSetUp only SETUP and DEPLOY signal(s) which cause
to transition into " +
                     "SettingUp and NotSetUp state(s) respectively" ),
 
     // SetupFailed ==> (setup deploy) ==> NotSetUp
     // SetupFailed ==> (setup signal) ==> SettingUp
-    SetupFailed( 2, new SetupStackSignal[] { SetupStackSignal.SETUP, SetupStackSignal.DEPLOY
}, new Integer[] { 1, 3 },
+    SetupFailed( 2, new SetupStackSignal[] { SetupStackSignal.SETUP, SetupStackSignal.DEPLOY
},
+            new Integer[] { 1, 3 },
             "Stack was registered, however its setup failed. Call setup again to restart.",
             "%s signal rejected. When SetupFailed only SETUP and DEPLOY signal(s) which cause
to transition into " +
                     "SettingUp and NotSetUp state(s) respectively" ),
 
+    // SettingUp ==> (Fail signal) ==> SetupFailed
     // SettingUp ==> (Complete signal) ==> SetUp
-    SettingUp( 1, new SetupStackSignal[] { SetupStackSignal.COMPLETE, SetupStackSignal.FAIL
-            , SetupStackSignal.DESTROY}, new Integer[] { 0, 2, 4 },
+    SettingUp( 1, new SetupStackSignal[] { SetupStackSignal.COMPLETE, SetupStackSignal.FAIL},
+            new Integer[] { 0, 2 },
             "Setting up the stack right now.",
-            "%s signal rejected. When SettingUp only COMPLETE, FAIL and DESTROY signal(s)
can be sent which " +
-                    "cause to transition into SetUp, SetupFailed and Destroying state(s)
respectively" ),
+            "%s signal rejected. When SettingUp only COMPLETE and FAIL signal(s) can be sent
which " +
+                    "cause to transition into SetUp and SetupFailed state(s) respectively"
),
 
     // SetUp ==> (start signal) ==> Running
     // SetUp ==> (destroy signal) ==> NotSetUp
-    SetUp( 0, new SetupStackSignal[] { SetupStackSignal.DESTROY, SetupStackSignal.START },
new Integer[] { 4, 7 },
+    SetUp( 0, new SetupStackSignal[] { SetupStackSignal.DESTROY, SetupStackSignal.START },
+            new Integer[] { 4, 7 },
             "Stack is set up and ready to start the tests.",
             "%s signal rejected. When SetUp only DESTROY and SetUp signal(s) which cause
to transition into " +
                     "NotSetUp and SetUp state(s) respectively" );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a735c5ff/chop/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/chop/webapp/pom.xml b/chop/webapp/pom.xml
index caef3aa..f50a82e 100644
--- a/chop/webapp/pom.xml
+++ b/chop/webapp/pom.xml
@@ -19,6 +19,7 @@
     <properties>
       <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
       <wagon.version>2.6</wagon.version>
+      <shade.plugin.version>2.2</shade.plugin.version>
       <wagon.plugin.version>1.0-beta-5</wagon.plugin.version>
       <webapp-shaded-jar>${project.artifactId}-${project.version}-shaded.${project.packaging}</webapp-shaded-jar>
       <wagon.webapp.copy.file>${project.build.directory}/${webapp-shaded-jar}</wagon.webapp.copy.file>
@@ -170,7 +171,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
-        <version>2.2</version>
+        <version>${shade.plugin.version}</version>
         <executions>
           <execution>
             <phase>package</phase>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a735c5ff/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/StackCoordinator.java
----------------------------------------------------------------------
diff --git a/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/StackCoordinator.java
b/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/StackCoordinator.java
index bdc5231..9e38227 100644
--- a/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/StackCoordinator.java
+++ b/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/StackCoordinator.java
@@ -173,7 +173,7 @@ public class StackCoordinator {
         }
 
         synchronized ( coordinatedStack ) {
-            if ( coordinatedStack.getSetupState().accepts( SetupStackSignal.DESTROY ) ) {
+            if ( ! coordinatedStack.getSetupState().accepts( SetupStackSignal.DESTROY ) )
{
                 LOG.info( "Stack is in {} state, will not destroy.", coordinatedStack.getSetupState().toString()
);
                 return;
             }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a735c5ff/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/DestroyResource.java
----------------------------------------------------------------------
diff --git a/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/DestroyResource.java
b/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/DestroyResource.java
index ff1ff21..e87126a 100644
--- a/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/DestroyResource.java
+++ b/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/DestroyResource.java
@@ -111,9 +111,7 @@ public class DestroyResource extends TestableResource implements RestParams
{
                            .build();
         }
 
-        /** SetupStackState.SetUp or SetupStackState.SettingUp
-         * or SetupStackState.Running or SetupStackState.Stopped */
-
+        LOG.debug( "Stack is {}, destroying... ", status.toString() );
         // Unregister runners first
         String moduleId = BasicModule.createId( groupId, artifactId, version );
         Collection<Runner> runners = runnerCoordinator.getRunners( user, commitId,
moduleId );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/a735c5ff/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/RunnerRegistryResource.java
----------------------------------------------------------------------
diff --git a/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/RunnerRegistryResource.java
b/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/RunnerRegistryResource.java
index 2704efa..781a2b3 100644
--- a/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/RunnerRegistryResource.java
+++ b/chop/webapp/src/main/java/org/apache/usergrid/chop/webapp/coordinator/rest/RunnerRegistryResource.java
@@ -210,12 +210,11 @@ public class RunnerRegistryResource extends TestableResource implements
RestPara
             @QueryParam( MODULE_VERSION ) String version,
             @QueryParam( COMMIT_ID ) String commitId
     ) {
-
-        LOG.info( "USERNAME: {}", username );
-        LOG.info( "MODULE_GROUPID: {}", groupId );
-        LOG.info( "MODULE_ARTIFACTID: {}", artifactId );
-        LOG.info( "MODULE_VERSION: {}", version );
-        LOG.info( "COMMIT_ID: {}", commitId );
+        LOG.debug( "USERNAME: {}", username );
+        LOG.debug( "MODULE_GROUPID: {}", groupId );
+        LOG.debug( "MODULE_ARTIFACTID: {}", artifactId );
+        LOG.debug( "MODULE_VERSION: {}", version );
+        LOG.debug( "COMMIT_ID: {}", commitId );
 
         CoordinatedStack stack = stackCoordinator.findCoordinatedStack( commitId, artifactId,
groupId, version, username );
         if ( stack.getSetupState().accepts( SetupStackSignal.COMPLETE ) ) {


Mime
View raw message