You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2015/03/29 04:31:28 UTC

[01/11] incubator-brooklyn git commit: Add versions to downstream-parent’s pom

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 584edcb5c -> 4fb2c7027


Add versions to downstream-parent’s pom

- Matching core brookyln’s versions, adds:
  - jsr305 2.01
  - snakeyaml 1.11


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

Branch: refs/heads/master
Commit: ae59970b89193983391820f9350d173e4e5e9cda
Parents: 7b5c754
Author: Aled Sage <al...@gmail.com>
Authored: Fri Mar 6 18:04:50 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:04:54 2015 +0000

----------------------------------------------------------------------
 usage/downstream-parent/pom.xml | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ae59970b/usage/downstream-parent/pom.xml
----------------------------------------------------------------------
diff --git a/usage/downstream-parent/pom.xml b/usage/downstream-parent/pom.xml
index eb9d4f4..fcc1bcf 100644
--- a/usage/downstream-parent/pom.xml
+++ b/usage/downstream-parent/pom.xml
@@ -57,6 +57,8 @@
     <httpclient.version>4.2.5</httpclient.version>
     <commons-lang3.version>3.1</commons-lang3.version>
     <groovy.version>2.3.4</groovy.version>
+    <jsr305.version>2.0.1</jsr305.version>
+    <snakeyaml.version>1.11</snakeyaml.version>
   </properties>
 
   <dependencyManagement>


[09/11] incubator-brooklyn git commit: Couchbase: tests for example yaml blueprints

Posted by he...@apache.org.
Couchbase: tests for example yaml blueprints

- Rename couchbase.yaml to couchbase-cluster.yaml
- Adds CouchbaseBlueprintTest.java
- Adds yaml/test for:
  - couchbase-cluster-singleNode.yaml
  - couchbase-node.yaml
- Updates couchbase yaml so all point at softlayer (except for
  couchbase-replication-w-pillowfight.yaml which spans AWS and
  softlayer)


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

Branch: refs/heads/master
Commit: 51560b92b67535b6155fb2234495f4dc0a7d265f
Parents: aa4b61a
Author: Aled Sage <al...@gmail.com>
Authored: Tue Mar 10 16:47:41 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:41 2015 +0000

----------------------------------------------------------------------
 .../blueprints/CouchbaseBlueprintTest.java      | 69 ++++++++++++++++++++
 .../resources/couchbase-cluster-singleNode.yaml | 36 ++++++++++
 .../src/test/resources/couchbase-cluster.yaml   | 33 ++++++++++
 .../src/test/resources/couchbase-node.yaml      | 26 ++++++++
 .../src/test/resources/couchbase-w-loadgen.yaml |  4 +-
 .../test/resources/couchbase-w-pillowfight.yaml |  2 +-
 .../launcher/src/test/resources/couchbase.yaml  | 32 ---------
 7 files changed, 167 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/51560b92/usage/launcher/src/test/java/brooklyn/launcher/blueprints/CouchbaseBlueprintTest.java
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/java/brooklyn/launcher/blueprints/CouchbaseBlueprintTest.java b/usage/launcher/src/test/java/brooklyn/launcher/blueprints/CouchbaseBlueprintTest.java
new file mode 100644
index 0000000..3450489
--- /dev/null
+++ b/usage/launcher/src/test/java/brooklyn/launcher/blueprints/CouchbaseBlueprintTest.java
@@ -0,0 +1,69 @@
+/*
+ * 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 brooklyn.launcher.blueprints;
+
+import org.testng.annotations.Test;
+
+public class CouchbaseBlueprintTest extends AbstractBlueprintTest {
+
+    @Test(groups={"Live"})
+    public void testCouchbaseNode() throws Exception {
+        runTest("couchbase-node.yaml");
+    }
+
+    @Test(groups={"Live"})
+    public void testCouchbaseCluster() throws Exception {
+        runTest("couchbase-cluster.yaml");
+    }
+
+    @Test(groups={"Live"})
+    public void testCouchbaseClusterSingleNode() throws Exception {
+        runTest("couchbase-cluster-singleNode.yaml");
+    }
+    
+    @Test(groups={"Live"})
+    public void testCouchbaseWithPillowfight() throws Exception {
+        runTest("couchbase-w-pillowfight.yaml");
+    }
+
+    /**
+     * FIXME Failed with "Unable to match required VM template constraints" - caused by NPE:
+     *   Caused by: java.lang.NullPointerException: id
+     *     at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)
+     *     at org.jclouds.softlayer.domain.OperatingSystem.<init>(OperatingSystem.java:106)
+     *     at org.jclouds.softlayer.domain.OperatingSystem$Builder.build(OperatingSystem.java:87)
+     *     at org.jclouds.softlayer.domain.ContainerVirtualGuestConfiguration$4.apply(ContainerVirtualGuestConfiguration.java:209)
+     *     at org.jclouds.softlayer.domain.ContainerVirtualGuestConfiguration$4.apply(ContainerVirtualGuestConfiguration.java:206)
+     * This blueprint uses {minRam: 16384, minCores: 4}.
+     * Suspect this is already fixed by Andrea Turli in latest jclouds.
+     */
+    @Test(groups={"Live", "WIP"})
+    public void testCouchbaseWithLoadgen() throws Exception {
+        runTest("couchbase-w-loadgen.yaml");
+    }
+
+    /**
+     * FIXME Failed with "Unable to match required VM template constraints" - caused by NPE
+     * (see error described at {@link #testCouchbaseWithLoadgen()}.
+     */
+    @Test(groups={"Live", "WIP"})
+    public void testCouchbaseReplicationWithPillowfight() throws Exception {
+        runTest("couchbase-replication-w-pillowfight.yaml");
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/51560b92/usage/launcher/src/test/resources/couchbase-cluster-singleNode.yaml
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/resources/couchbase-cluster-singleNode.yaml b/usage/launcher/src/test/resources/couchbase-cluster-singleNode.yaml
new file mode 100644
index 0000000..f40c779
--- /dev/null
+++ b/usage/launcher/src/test/resources/couchbase-cluster-singleNode.yaml
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+name: Couchbase One Bucket
+
+location: softlayer:wdc01
+
+services:
+- type: brooklyn.entity.nosql.couchbase.CouchbaseCluster
+  initialSize: 1
+  intialQuorumSize: 1
+  adminUsername: Administrator
+  adminPassword: Password
+  createBuckets:
+  - bucket: default
+    bucket-port: 11211
+    bucket-replica: 0
+  - bucket: my_bucket_2
+    bucket-port: 11222
+    bucket-replica: 0
+    
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/51560b92/usage/launcher/src/test/resources/couchbase-cluster.yaml
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/resources/couchbase-cluster.yaml b/usage/launcher/src/test/resources/couchbase-cluster.yaml
new file mode 100644
index 0000000..b85884b
--- /dev/null
+++ b/usage/launcher/src/test/resources/couchbase-cluster.yaml
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+name: Couchbase One Bucket
+
+location: softlayer:wdc01
+
+services:
+- type: brooklyn.entity.nosql.couchbase.CouchbaseCluster
+  initialSize: 3
+  intialQuorumSize: 2
+  adminUsername: Administrator
+  adminPassword: Password
+  createBuckets:
+  - bucket: default
+    bucket-port: 11211
+  - bucket: my_bucket_2
+    bucket-port: 11222

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/51560b92/usage/launcher/src/test/resources/couchbase-node.yaml
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/resources/couchbase-node.yaml b/usage/launcher/src/test/resources/couchbase-node.yaml
new file mode 100644
index 0000000..63a6348
--- /dev/null
+++ b/usage/launcher/src/test/resources/couchbase-node.yaml
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+name: Couchbase Node
+
+location: softlayer:wdc01
+
+services:
+- type: brooklyn.entity.nosql.couchbase.CouchbaseNode
+  adminUsername: Administrator
+  adminPassword: Password

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/51560b92/usage/launcher/src/test/resources/couchbase-w-loadgen.yaml
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/resources/couchbase-w-loadgen.yaml b/usage/launcher/src/test/resources/couchbase-w-loadgen.yaml
index 10daa61..70ed435 100644
--- a/usage/launcher/src/test/resources/couchbase-w-loadgen.yaml
+++ b/usage/launcher/src/test/resources/couchbase-w-loadgen.yaml
@@ -18,6 +18,8 @@
 #
 name: Couchbase with Elastic Load Generator
 
+location: softlayer:wdc01
+
 services:
 
 - type: brooklyn.entity.nosql.couchbase.CouchbaseCluster
@@ -50,5 +52,3 @@ services:
       brooklyn.example.couchbase.nodes: $brooklyn:formatString("'%s'",
         component("cb-cluster").attributeWhenReady("couchbase.cluster.node.addresses"))
   initialSize: 2
-
-location: aws-ec2:us-east-1

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/51560b92/usage/launcher/src/test/resources/couchbase-w-pillowfight.yaml
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/resources/couchbase-w-pillowfight.yaml b/usage/launcher/src/test/resources/couchbase-w-pillowfight.yaml
index 3cc2851..2ee46ee 100644
--- a/usage/launcher/src/test/resources/couchbase-w-pillowfight.yaml
+++ b/usage/launcher/src/test/resources/couchbase-w-pillowfight.yaml
@@ -18,7 +18,7 @@
 #
 name: Couchbase w Pillow Fight
 
-location: aws-ec2
+location: softlayer:wdc01
 
 services:
 - type: brooklyn.entity.nosql.couchbase.CouchbaseCluster

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/51560b92/usage/launcher/src/test/resources/couchbase.yaml
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/resources/couchbase.yaml b/usage/launcher/src/test/resources/couchbase.yaml
deleted file mode 100644
index 11b1b09..0000000
--- a/usage/launcher/src/test/resources/couchbase.yaml
+++ /dev/null
@@ -1,32 +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.
-#
-name: Couchbase One Bucket
-
-location: softlayer:wdc01
-
-services:
-- type: brooklyn.entity.nosql.couchbase.CouchbaseCluster
-  initialSize: 3
-  adminUsername: Administrator
-  adminPassword: Password
-  createBuckets:
-  - bucket: default
-    bucket-port: 11211
-  - bucket: my_bucket_2
-    bucket-port: 11222
\ No newline at end of file


[05/11] incubator-brooklyn git commit: Tidy SoftwareProcess.preRestart

Posted by he...@apache.org.
Tidy SoftwareProcess.preRestart

- Fixes restarting of the software process of BrooklynNode
- Adds test for BrooklynNode restart


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

Branch: refs/heads/master
Commit: 32b47a927a810de535124e4fd73b9a343e8b4f53
Parents: 8b3ecd7
Author: Aled Sage <al...@gmail.com>
Authored: Tue Mar 10 13:46:54 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:40 2015 +0000

----------------------------------------------------------------------
 .../basic/SoftwareProcessDriverLifecycleEffectorTasks.java  | 9 ++++-----
 .../java/brooklyn/entity/basic/SoftwareProcessImpl.java     | 9 ++++++---
 2 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/32b47a92/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessDriverLifecycleEffectorTasks.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessDriverLifecycleEffectorTasks.java b/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessDriverLifecycleEffectorTasks.java
index df706fd..a315e84 100644
--- a/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessDriverLifecycleEffectorTasks.java
+++ b/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessDriverLifecycleEffectorTasks.java
@@ -48,12 +48,11 @@ public class SoftwareProcessDriverLifecycleEffectorTasks extends MachineLifecycl
     
     public void restart(ConfigBag parameters) {
         RestartMachineMode isRestartMachine = parameters.get(RestartSoftwareParameters.RESTART_MACHINE_TYPED);
-        if (isRestartMachine==null) isRestartMachine=RestartMachineMode.AUTO;
+        if (isRestartMachine==null) 
+            isRestartMachine=RestartMachineMode.AUTO;
+        if (isRestartMachine==RestartMachineMode.AUTO) 
+            isRestartMachine = getDefaultRestartStopsMachine() ? RestartMachineMode.TRUE : RestartMachineMode.FALSE; 
 
-        if (isRestartMachine==RestartMachineMode.AUTO) {
-            isRestartMachine = getDefaultRestartStopsMachine() ? RestartMachineMode.TRUE : RestartMachineMode.FALSE;
-        }
-        
         if (isRestartMachine==RestartMachineMode.TRUE) {
             log.debug("restart of "+entity()+" requested be applied at machine level");
             super.restart(parameters);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/32b47a92/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java b/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
index f05d0fb..3ce61f1 100644
--- a/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
+++ b/software/base/src/main/java/brooklyn/entity/basic/SoftwareProcessImpl.java
@@ -176,9 +176,9 @@ public abstract class SoftwareProcessImpl extends AbstractEntity implements Soft
         }
     }
     
-      /**
-       * Called before driver.start; guarantees the driver will exist, and locations will have been set.
-       */
+    /**
+     * Called before driver.start; guarantees the driver will exist, and locations will have been set.
+     */
     protected void preStart() {
     }
     
@@ -271,6 +271,9 @@ public abstract class SoftwareProcessImpl extends AbstractEntity implements Soft
     protected void postStop() {
     }
 
+    /**
+     * Called before driver.restart; guarantees the driver will exist, and locations will have been set.
+     */
     protected void preRestart() {
     }
 


[10/11] incubator-brooklyn git commit: downstream parent pom: include test-jar

Posted by he...@apache.org.
downstream parent pom: include test-jar


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

Branch: refs/heads/master
Commit: b3ac1f82721786223c02441bb4dcb6d9e3dfcbf0
Parents: 51560b9
Author: Aled Sage <al...@gmail.com>
Authored: Mon Mar 16 15:45:31 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:41 2015 +0000

----------------------------------------------------------------------
 usage/downstream-parent/pom.xml | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b3ac1f82/usage/downstream-parent/pom.xml
----------------------------------------------------------------------
diff --git a/usage/downstream-parent/pom.xml b/usage/downstream-parent/pom.xml
index fcc1bcf..b499cd8 100644
--- a/usage/downstream-parent/pom.xml
+++ b/usage/downstream-parent/pom.xml
@@ -378,6 +378,34 @@
   </build>
 
   <profiles>
+  
+    <profile>
+      <id>Tests</id>
+      <activation>
+        <file> <exists>${basedir}/src/test</exists> </file>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-jar-plugin</artifactId>
+            <inherited>true</inherited>
+            <executions>
+              <execution>
+                <id>test-jar-creation</id>
+                <goals>
+                  <goal>test-jar</goal>
+                </goals>
+                <configuration>
+                  <forceCreation>true</forceCreation>
+                  <archive combine.self="override" />
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  
     <!-- run Integration tests with -PIntegration -->
     <profile>
       <id>Integration</id>


[04/11] incubator-brooklyn git commit: Avoid err if unmanage entity twice

Posted by he...@apache.org.
Avoid err if unmanage entity twice

- BrooklynNode unmanages itself on stop, and the BrooklynCluster
  (extends DynamicCluster) also unmanaged its members when shrinking.
- This was causing an error in EntityManagementSupport.onManagementStopped
  when checking if the value of mangaementContext was as expected.


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

Branch: refs/heads/master
Commit: 8b3ecd7a643d8621d1ee79022593c804374174d5
Parents: ae59970
Author: Aled Sage <al...@gmail.com>
Authored: Tue Mar 10 13:41:11 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:40 2015 +0000

----------------------------------------------------------------------
 .../management/internal/EntityManagementSupport.java   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8b3ecd7a/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java b/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
index cdf21dc..7b59c83 100644
--- a/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
+++ b/core/src/main/java/brooklyn/management/internal/EntityManagementSupport.java
@@ -153,7 +153,7 @@ public class EntityManagementSupport {
     }
     
     public void onRebind(ManagementTransitionInfo info) {
-        nonDeploymentManagementContext.setMode(NonDeploymentManagementContext.NonDeploymentManagementContextMode.MANAGEMENT_REBINDING);
+        nonDeploymentManagementContext.setMode(NonDeploymentManagementContextMode.MANAGEMENT_REBINDING);
     }
     
     public void onManagementStarting(ManagementTransitionInfo info) {
@@ -177,7 +177,7 @@ public class EntityManagementSupport {
                 }
                 
                 this.managementContext = info.getManagementContext();
-                nonDeploymentManagementContext.setMode(NonDeploymentManagementContext.NonDeploymentManagementContextMode.MANAGEMENT_STARTING);
+                nonDeploymentManagementContext.setMode(NonDeploymentManagementContextMode.MANAGEMENT_STARTING);
                 
                 if (!isReadOnly()) {
                     nonDeploymentManagementContext.getSubscriptionManager().setDelegate((AbstractSubscriptionManager) managementContext.getSubscriptionManager());
@@ -230,7 +230,7 @@ public class EntityManagementSupport {
                     return;
                 }
                 
-                nonDeploymentManagementContext.setMode(NonDeploymentManagementContext.NonDeploymentManagementContextMode.MANAGEMENT_STARTED);
+                nonDeploymentManagementContext.setMode(NonDeploymentManagementContextMode.MANAGEMENT_STARTED);
                 
                 /*
                  * - set derived/inherited config values
@@ -291,7 +291,7 @@ public class EntityManagementSupport {
                 nonDeploymentManagementContext = new NonDeploymentManagementContext(entity, NonDeploymentManagementContextMode.MANAGEMENT_STOPPING);
             } else {
                 // already stopped? or not started?
-                nonDeploymentManagementContext.setMode(NonDeploymentManagementContext.NonDeploymentManagementContextMode.MANAGEMENT_STOPPING);
+                nonDeploymentManagementContext.setMode(NonDeploymentManagementContextMode.MANAGEMENT_STOPPING);
             }
         }
         // TODO custom stopping activities
@@ -315,6 +315,9 @@ public class EntityManagementSupport {
     
     public void onManagementStopped(ManagementTransitionInfo info) {
         synchronized (this) {
+            if (managementContext == null && nonDeploymentManagementContext.getMode() == NonDeploymentManagementContextMode.MANAGEMENT_STOPPED) {
+                return;
+            }
             if (managementContext != info.getManagementContext()) {
                 throw new IllegalStateException("Has different management context: "+managementContext+"; expected "+info.getManagementContext());
             }
@@ -331,7 +334,7 @@ public class EntityManagementSupport {
         
         synchronized (this) {
             managementContext = null;
-            nonDeploymentManagementContext.setMode(NonDeploymentManagementContext.NonDeploymentManagementContextMode.MANAGEMENT_STOPPED);
+            nonDeploymentManagementContext.setMode(NonDeploymentManagementContextMode.MANAGEMENT_STOPPED);
         }
     }
 


[11/11] incubator-brooklyn git commit: This closes #547

Posted by he...@apache.org.
This closes #547


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

Branch: refs/heads/master
Commit: 4fb2c702712b53111eb288803511764ceb778240
Parents: 584edcb ee3c578
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Sat Mar 28 21:31:18 2015 -0500
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Sat Mar 28 21:31:18 2015 -0500

----------------------------------------------------------------------
 camp/README.md                                  |  2 +-
 .../internal/EntityManagementSupport.java       | 13 ++-
 .../persister/XmlMementoSerializerTest.java     | 24 +++--
 ...wareProcessDriverLifecycleEffectorTasks.java |  9 +-
 .../entity/basic/SoftwareProcessImpl.java       |  9 +-
 .../entity/brooklynnode/BrooklynCluster.java    | 19 ++--
 .../BrooklynClusterIntegrationTest.java         | 96 ++++++++++++++++++++
 .../nosql/couchbase/CouchbaseCluster.java       |  1 +
 .../nosql/couchbase/CouchbaseClusterImpl.java   | 25 ++++-
 .../quickstart/src/brooklyn-sample/README.md    |  2 +-
 .../test/resources/example-with-function.yaml   |  2 +-
 .../src/test/resources/java-web-app-simple.yaml |  2 +-
 .../test/resources/test-app-with-enricher.yaml  |  2 +-
 .../test/resources/test-app-with-policy.yaml    |  2 +-
 .../test-cluster-with-member-spec.yaml          |  2 +-
 .../resources/test-entity-basic-template.yaml   |  2 +-
 .../test-entity-reference-map-template.yaml     |  2 +-
 .../resources/test-entity-with-enricher.yaml    |  2 +-
 .../resources/test-entity-with-init-config.yaml |  2 +-
 .../test/resources/test-entity-with-policy.yaml |  2 +-
 .../resources/test-propagating-enricher.yaml    |  2 +-
 .../resources/test-referencing-enrichers.yaml   |  2 +-
 .../resources/test-referencing-entities.yaml    |  2 +-
 .../resources/test-referencing-policies.yaml    |  2 +-
 usage/downstream-parent/pom.xml                 | 30 ++++++
 .../blueprints/CouchbaseBlueprintTest.java      | 69 ++++++++++++++
 .../resources/couchbase-cluster-singleNode.yaml | 36 ++++++++
 .../src/test/resources/couchbase-cluster.yaml   | 33 +++++++
 .../src/test/resources/couchbase-node.yaml      | 26 ++++++
 .../src/test/resources/couchbase-w-loadgen.yaml |  4 +-
 .../test/resources/couchbase-w-pillowfight.yaml |  2 +-
 .../launcher/src/test/resources/couchbase.yaml  | 32 -------
 .../src/test/resources/mongo-scripts.yaml       |  2 +-
 33 files changed, 375 insertions(+), 87 deletions(-)
----------------------------------------------------------------------



[06/11] incubator-brooklyn git commit: XmlMementoSerializerTest: destroy mgmt at end

Posted by he...@apache.org.
XmlMementoSerializerTest: destroy mgmt at end


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

Branch: refs/heads/master
Commit: ee3c578b01feaf6fde613e93cc9dccb5630a61a7
Parents: cf49a6e
Author: Aled Sage <al...@gmail.com>
Authored: Thu Mar 19 16:02:07 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:41 2015 +0000

----------------------------------------------------------------------
 .../persister/XmlMementoSerializerTest.java     | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ee3c578b/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java b/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
index a57c9eb..316c549 100644
--- a/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
+++ b/core/src/test/java/brooklyn/entity/rebind/persister/XmlMementoSerializerTest.java
@@ -198,16 +198,20 @@ public class XmlMementoSerializerTest {
     @Test
     public void testEntitySpecFromOsgi() throws Exception {
         ManagementContext mgmt = LocalManagementContextForTests.builder(true).disableOsgi(false).build();
-        CatalogItem<?, ?> ci = OsgiVersionMoreEntityTest.addMoreEntityV1(mgmt, "1.0");
-        
-        EntitySpec<DynamicCluster> spec = EntitySpec.create(DynamicCluster.class)
-            .configure(DynamicCluster.INITIAL_SIZE, 1)
-            .configure(DynamicCluster.MEMBER_SPEC, CatalogTestUtils.createEssentialEntitySpec(mgmt, ci));
-
-        serializer.setLookupContext(new LookupContextImpl(mgmt,
-            ImmutableList.<Entity>of(), ImmutableList.<Location>of(), ImmutableList.<Policy>of(),
-            ImmutableList.<Enricher>of(), ImmutableList.<Feed>of(), ImmutableList.<CatalogItem<?,?>>of(), true));
-        assertSerializeAndDeserialize(spec);
+        try {
+            CatalogItem<?, ?> ci = OsgiVersionMoreEntityTest.addMoreEntityV1(mgmt, "1.0");
+            
+            EntitySpec<DynamicCluster> spec = EntitySpec.create(DynamicCluster.class)
+                .configure(DynamicCluster.INITIAL_SIZE, 1)
+                .configure(DynamicCluster.MEMBER_SPEC, CatalogTestUtils.createEssentialEntitySpec(mgmt, ci));
+    
+            serializer.setLookupContext(new LookupContextImpl(mgmt,
+                ImmutableList.<Entity>of(), ImmutableList.<Location>of(), ImmutableList.<Policy>of(),
+                ImmutableList.<Enricher>of(), ImmutableList.<Feed>of(), ImmutableList.<CatalogItem<?,?>>of(), true));
+            assertSerializeAndDeserialize(spec);
+        } finally {
+            Entities.destroyAllCatching(mgmt);
+        }
     }
 
     @Test


[03/11] incubator-brooklyn git commit: BrooklynCluster: add memberSpec + test

Posted by he...@apache.org.
BrooklynCluster: add memberSpec + test

- Before memberSpec was added, it would fail if you asked for a
  BrooklynCluster without supplying a memberSpec yourself.


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

Branch: refs/heads/master
Commit: e9ab67b3e248ea4968b059e852d317b97df8c718
Parents: 32b47a9
Author: Aled Sage <al...@gmail.com>
Authored: Tue Mar 10 13:48:01 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:40 2015 +0000

----------------------------------------------------------------------
 .../entity/brooklynnode/BrooklynCluster.java    | 19 ++--
 .../BrooklynClusterIntegrationTest.java         | 96 ++++++++++++++++++++
 2 files changed, 108 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e9ab67b3/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynCluster.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynCluster.java b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynCluster.java
index 7b5c095..65a7202 100644
--- a/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynCluster.java
+++ b/software/base/src/main/java/brooklyn/entity/brooklynnode/BrooklynCluster.java
@@ -26,16 +26,21 @@ import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.brooklynnode.effector.BrooklynNodeUpgradeEffectorBody;
 import brooklyn.entity.effector.Effectors;
 import brooklyn.entity.group.DynamicCluster;
+import brooklyn.entity.proxying.EntitySpec;
 import brooklyn.entity.proxying.ImplementedBy;
 import brooklyn.event.AttributeSensor;
 import brooklyn.event.basic.Sensors;
 
 @ImplementedBy(BrooklynClusterImpl.class)
 public interface BrooklynCluster extends DynamicCluster {
-    public static final AttributeSensor<BrooklynNode> MASTER_NODE = Sensors.newSensor(
+    
+    ConfigKey<EntitySpec<?>> MEMBER_SPEC = ConfigKeys.newConfigKeyWithDefault(DynamicCluster.MEMBER_SPEC, 
+            EntitySpec.create(BrooklynNode.class));
+    
+    AttributeSensor<BrooklynNode> MASTER_NODE = Sensors.newSensor(
             BrooklynNode.class, "brooklyncluster.master", "Pointer to the child node with MASTER state in the cluster");
 
-    public interface SelectMasterEffector {
+    interface SelectMasterEffector {
         ConfigKey<String> NEW_MASTER_ID = ConfigKeys.newStringConfigKey(
                 "brooklyncluster.new_master_id", "The ID of the node to become master", null);
         Effector<Void> SELECT_MASTER = Effectors.effector(Void.class, "selectMaster")
@@ -44,11 +49,11 @@ public interface BrooklynCluster extends DynamicCluster {
                 .buildAbstract();
     }
 
-    public static final Effector<Void> SELECT_MASTER = SelectMasterEffector.SELECT_MASTER;
+    Effector<Void> SELECT_MASTER = SelectMasterEffector.SELECT_MASTER;
 
-    public interface UpgradeClusterEffector {
-        public static final ConfigKey<String> DOWNLOAD_URL = BrooklynNode.DOWNLOAD_URL.getConfigKey();
-        public static final ConfigKey<Map<String,Object>> EXTRA_CONFIG = BrooklynNodeUpgradeEffectorBody.EXTRA_CONFIG;
+    interface UpgradeClusterEffector {
+        ConfigKey<String> DOWNLOAD_URL = BrooklynNode.DOWNLOAD_URL.getConfigKey();
+        ConfigKey<Map<String,Object>> EXTRA_CONFIG = BrooklynNodeUpgradeEffectorBody.EXTRA_CONFIG;
 
         Effector<Void> UPGRADE_CLUSTER = Effectors.effector(Void.class, "upgradeCluster")
                 .description("Upgrade the cluster with new distribution version, "
@@ -60,6 +65,6 @@ public interface BrooklynCluster extends DynamicCluster {
                 .buildAbstract();
     }
 
-    public static final Effector<Void> UPGRADE_CLUSTER = UpgradeClusterEffector.UPGRADE_CLUSTER;
+    Effector<Void> UPGRADE_CLUSTER = UpgradeClusterEffector.UPGRADE_CLUSTER;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e9ab67b3/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynClusterIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynClusterIntegrationTest.java b/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynClusterIntegrationTest.java
new file mode 100644
index 0000000..d623a38
--- /dev/null
+++ b/software/base/src/test/java/brooklyn/entity/brooklynnode/BrooklynClusterIntegrationTest.java
@@ -0,0 +1,96 @@
+/*
+ * 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 brooklyn.entity.brooklynnode;
+
+import java.io.File;
+import java.util.List;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import brooklyn.entity.BrooklynAppUnitTestSupport;
+import brooklyn.entity.Entity;
+import brooklyn.entity.brooklynnode.BrooklynNode.ExistingFileBehaviour;
+import brooklyn.entity.proxying.EntitySpec;
+import brooklyn.location.basic.LocalhostMachineProvisioningLocation;
+import brooklyn.test.EntityTestUtils;
+import brooklyn.util.javalang.JavaClassNames;
+import brooklyn.util.net.Networking;
+import brooklyn.util.os.Os;
+
+import com.google.common.base.Predicates;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+
+public class BrooklynClusterIntegrationTest extends BrooklynAppUnitTestSupport {
+
+    private static final Logger LOG = LoggerFactory.getLogger(BrooklynNodeIntegrationTest.class);
+
+    private File pseudoBrooklynPropertiesFile;
+    private File pseudoBrooklynCatalogFile;
+    private File persistenceDir;
+    private LocalhostMachineProvisioningLocation loc;
+    private List<LocalhostMachineProvisioningLocation> locs;
+
+    @BeforeMethod(alwaysRun=true)
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+        pseudoBrooklynPropertiesFile = Os.newTempFile("brooklynnode-test", ".properties");
+        pseudoBrooklynPropertiesFile.delete();
+
+        pseudoBrooklynCatalogFile = Os.newTempFile("brooklynnode-test", ".catalog");
+        pseudoBrooklynCatalogFile.delete();
+
+        loc = app.newLocalhostProvisioningLocation();
+        locs = ImmutableList.of(loc);
+    }
+
+    @AfterMethod(alwaysRun=true)
+    @Override
+    public void tearDown() throws Exception {
+        try {
+            super.tearDown();
+        } finally {
+            if (pseudoBrooklynPropertiesFile != null) pseudoBrooklynPropertiesFile.delete();
+            if (pseudoBrooklynCatalogFile != null) pseudoBrooklynCatalogFile.delete();
+            if (persistenceDir != null) Os.deleteRecursively(persistenceDir);
+        }
+    }
+
+    @Test(groups="Integration")
+    public void testCanStartAndStop() throws Exception {
+        BrooklynCluster cluster = app.createAndManageChild(EntitySpec.create(BrooklynCluster.class)
+                .configure(BrooklynCluster.INITIAL_SIZE, 1)
+                .configure(BrooklynNode.WEB_CONSOLE_BIND_ADDRESS, Networking.ANY_NIC)
+                .configure(BrooklynNode.ON_EXISTING_PROPERTIES_FILE, ExistingFileBehaviour.DO_NOT_USE));
+        app.start(locs);
+        Entity brooklynNode = Iterables.find(cluster.getMembers(), Predicates.instanceOf(BrooklynNode.class));
+        LOG.info("started "+app+" containing "+cluster+" for "+JavaClassNames.niceClassAndMethod());
+
+        EntityTestUtils.assertAttributeEqualsEventually(cluster, BrooklynNode.SERVICE_UP, true);
+        EntityTestUtils.assertAttributeEqualsEventually(brooklynNode, BrooklynNode.SERVICE_UP, true);
+
+        cluster.stop();
+        EntityTestUtils.assertAttributeEquals(cluster, BrooklynNode.SERVICE_UP, false);
+    }    
+}


[02/11] incubator-brooklyn git commit: Couchbase: change default bucket-ramsize to 100

Posted by he...@apache.org.
Couchbase: change default bucket-ramsize to 100

- with 200, tests that created a bucket were failing on softlayer.
  Decreasing it to 100 (which is the minimum) let them pass


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

Branch: refs/heads/master
Commit: c76b9de9245d6a8debee54f4539c8390aeec59ac
Parents: e9ab67b
Author: Aled Sage <al...@gmail.com>
Authored: Tue Mar 10 16:22:35 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:40 2015 +0000

----------------------------------------------------------------------
 .../java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c76b9de9/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
index 8d26896..ca12a89 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
@@ -502,7 +502,7 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements Couchbas
             String bucketType = bucketMap.containsKey("bucket-type") ? (String) bucketMap.get("bucket-type") : "couchbase";
             // default bucket must be on this port; other buckets can (must) specify their own (unique) port
             Integer bucketPort = bucketMap.containsKey("bucket-port") ? (Integer) bucketMap.get("bucket-port") : 11211;
-            Integer bucketRamSize = bucketMap.containsKey("bucket-ramsize") ? (Integer) bucketMap.get("bucket-ramsize") : 200;
+            Integer bucketRamSize = bucketMap.containsKey("bucket-ramsize") ? (Integer) bucketMap.get("bucket-ramsize") : 100;
             Integer bucketReplica = bucketMap.containsKey("bucket-replica") ? (Integer) bucketMap.get("bucket-replica") : 1;
 
             createBucket(primaryNode, bucketName, bucketType, bucketPort, bucketRamSize, bucketReplica);


[07/11] incubator-brooklyn git commit: Couchbase: fix upQuorumCheck config so serializable

Posted by he...@apache.org.
Couchbase: fix upQuorumCheck config so serializable


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

Branch: refs/heads/master
Commit: aa4b61a73d2850c6003ed974d2bacedf9e0feb6f
Parents: c76b9de
Author: Aled Sage <al...@gmail.com>
Authored: Tue Mar 10 16:23:14 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:41 2015 +0000

----------------------------------------------------------------------
 .../nosql/couchbase/CouchbaseCluster.java       |  1 +
 .../nosql/couchbase/CouchbaseClusterImpl.java   | 23 ++++++++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/aa4b61a7/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
index fb52650..69cab58 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseCluster.java
@@ -130,4 +130,5 @@ public interface CouchbaseCluster extends DynamicCluster {
     ConfigKey<List<Map<String,Object>>> REPLICATION = ConfigKeys.newConfigKey(new TypeToken<List<Map<String,Object>>>() {}, 
             "couchbase.cluster.replicationConfiguration", "List of replication rules to configure, each rule including target (id of another cluster) and mode (unidirectional or bidirectional)");
 
+    int getQuorumSize();
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/aa4b61a7/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
index ca12a89..dcdafb6 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/couchbase/CouchbaseClusterImpl.java
@@ -376,8 +376,8 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements Couchbas
         return EntitySpec.create(CouchbaseNode.class);
     }
 
-
-    protected int getQuorumSize() {
+    @Override
+    public int getQuorumSize() {
         Integer quorumSize = getConfig(CouchbaseCluster.INITIAL_QUORUM_SIZE);
         if (quorumSize != null && quorumSize > 0)
             return quorumSize;
@@ -411,7 +411,10 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements Couchbas
                 }
             }).build());
         
-        if (getConfigRaw(UP_QUORUM_CHECK, false).isAbsent()) {
+        if (config().getLocalRaw(UP_QUORUM_CHECK).isAbsent()) {
+            // TODO Only leaving CouchbaseQuorumCheck here in case it is contained in persisted state.
+            // If so, need a transformer and then to delete it
+            @Deprecated
             class CouchbaseQuorumCheck implements QuorumCheck {
                 @Override
                 public boolean isQuorate(int sizeHealthy, int totalSize) {
@@ -420,11 +423,23 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements Couchbas
                     return true;
                 }
             }
-            setConfig(UP_QUORUM_CHECK, new CouchbaseQuorumCheck());
+            config().set(UP_QUORUM_CHECK, new CouchbaseClusterImpl.CouchbaseQuorumCheck(this));
         }
         super.initEnrichers();
     }
     
+    static class CouchbaseQuorumCheck implements QuorumCheck {
+        private final CouchbaseCluster cluster;
+        CouchbaseQuorumCheck(CouchbaseCluster cluster) {
+            this.cluster = cluster;
+        }
+        @Override
+        public boolean isQuorate(int sizeHealthy, int totalSize) {
+            // check members count passed in AND the sensor  
+            if (sizeHealthy < cluster.getQuorumSize()) return false;
+            return true;
+        }
+    }
     protected void addServers(Set<Entity> serversToAdd) {
         Preconditions.checkNotNull(serversToAdd);
         for (Entity s : serversToAdd) {


[08/11] incubator-brooklyn git commit: Use url brooklyn.incubator.apache.org instead of brooklyn.io

Posted by he...@apache.org.
Use url brooklyn.incubator.apache.org instead of brooklyn.io


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

Branch: refs/heads/master
Commit: cf49a6ed581080ab554bf927eb6d449a226cbb6e
Parents: b3ac1f8
Author: Aled Sage <al...@gmail.com>
Authored: Mon Mar 16 16:11:56 2015 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Mar 26 10:09:41 2015 +0000

----------------------------------------------------------------------
 camp/README.md                                                     | 2 +-
 usage/archetypes/quickstart/src/brooklyn-sample/README.md          | 2 +-
 usage/camp/src/test/resources/example-with-function.yaml           | 2 +-
 usage/camp/src/test/resources/java-web-app-simple.yaml             | 2 +-
 usage/camp/src/test/resources/test-app-with-enricher.yaml          | 2 +-
 usage/camp/src/test/resources/test-app-with-policy.yaml            | 2 +-
 usage/camp/src/test/resources/test-cluster-with-member-spec.yaml   | 2 +-
 usage/camp/src/test/resources/test-entity-basic-template.yaml      | 2 +-
 .../src/test/resources/test-entity-reference-map-template.yaml     | 2 +-
 usage/camp/src/test/resources/test-entity-with-enricher.yaml       | 2 +-
 usage/camp/src/test/resources/test-entity-with-init-config.yaml    | 2 +-
 usage/camp/src/test/resources/test-entity-with-policy.yaml         | 2 +-
 usage/camp/src/test/resources/test-propagating-enricher.yaml       | 2 +-
 usage/camp/src/test/resources/test-referencing-enrichers.yaml      | 2 +-
 usage/camp/src/test/resources/test-referencing-entities.yaml       | 2 +-
 usage/camp/src/test/resources/test-referencing-policies.yaml       | 2 +-
 usage/launcher/src/test/resources/mongo-scripts.yaml               | 2 +-
 17 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/camp/README.md
----------------------------------------------------------------------
diff --git a/camp/README.md b/camp/README.md
index a2d4a2f..225e18e 100644
--- a/camp/README.md
+++ b/camp/README.md
@@ -13,7 +13,7 @@ The projects in this directory are designed so they could be used to build
 other CAMP servers not based on Brooklyn, if desired.
 
 These projects are part of the Apache Software Foundation Brooklyn project
-(brooklyn.io) and released under the Apache License 2.0.
+(https://brooklyn.incubator.apache.org) and released under the Apache License 2.0.
 
 ----
 Licensed to the Apache Software Foundation (ASF) under one 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/archetypes/quickstart/src/brooklyn-sample/README.md
----------------------------------------------------------------------
diff --git a/usage/archetypes/quickstart/src/brooklyn-sample/README.md b/usage/archetypes/quickstart/src/brooklyn-sample/README.md
index 7498796..b40df41 100644
--- a/usage/archetypes/quickstart/src/brooklyn-sample/README.md
+++ b/usage/archetypes/quickstart/src/brooklyn-sample/README.md
@@ -65,7 +65,7 @@ deployment depending on what the application needs.
 
 For more information consider:
 
-* Visiting the Apache Brooklyn home page at  http://brooklyn.io/
+* Visiting the Apache Brooklyn home page at https://brooklyn.incubator.apache.org
 * Finding us on IRC #brooklyncentral or email (click "Community" at the site above) 
 * Forking the project at  http://github.com/apache/incubator-brooklyn/
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/example-with-function.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/example-with-function.yaml b/usage/camp/src/test/resources/example-with-function.yaml
index b2f8be2..ebc26d7 100644
--- a/usage/camp/src/test/resources/example-with-function.yaml
+++ b/usage/camp/src/test/resources/example-with-function.yaml
@@ -19,7 +19,7 @@
 name: example-with-function
 description: |
   Tests a variety of simple functional expressions
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 location: localhost
 services:
 - serviceType: brooklyn.entity.webapp.jboss.JBoss7Server

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/java-web-app-simple.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/java-web-app-simple.yaml b/usage/camp/src/test/resources/java-web-app-simple.yaml
index 35057fb..7cde93a 100644
--- a/usage/camp/src/test/resources/java-web-app-simple.yaml
+++ b/usage/camp/src/test/resources/java-web-app-simple.yaml
@@ -18,7 +18,7 @@
 #
 name: sample-single-jboss
 description: Single JBoss using Brooklyn
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 location: localhost
 services:
 - serviceType: brooklyn.entity.webapp.jboss.JBoss7Server

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-app-with-enricher.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-app-with-enricher.yaml b/usage/camp/src/test/resources/test-app-with-enricher.yaml
index 7c73057..edbade3 100644
--- a/usage/camp/src/test/resources/test-app-with-enricher.yaml
+++ b/usage/camp/src/test/resources/test-app-with-enricher.yaml
@@ -18,7 +18,7 @@
 #
 name: test-app-with-enricher
 description: TestEntity with Enricher at application-level using Brooklyn
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.entity.basic.BasicEntity
   id: be1

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-app-with-policy.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-app-with-policy.yaml b/usage/camp/src/test/resources/test-app-with-policy.yaml
index 06fbaf1..f390136 100644
--- a/usage/camp/src/test/resources/test-app-with-policy.yaml
+++ b/usage/camp/src/test/resources/test-app-with-policy.yaml
@@ -18,7 +18,7 @@
 #
 name: test-app-with-policy
 description: TestEntity with Policy at application-level using Brooklyn
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.entity.basic.BasicEntity
   name: testentity

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml b/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml
index 7c09ef0..ce4e8ff 100644
--- a/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml
+++ b/usage/camp/src/test/resources/test-cluster-with-member-spec.yaml
@@ -18,7 +18,7 @@
 #
 name: test-app-with-enricher
 description: Cluster of TestEntitys with member spec
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 location: localhost
 services:
 - serviceType: brooklyn.entity.group.DynamicCluster

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-entity-basic-template.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-entity-basic-template.yaml b/usage/camp/src/test/resources/test-entity-basic-template.yaml
index af9031f..db88d23 100644
--- a/usage/camp/src/test/resources/test-entity-basic-template.yaml
+++ b/usage/camp/src/test/resources/test-entity-basic-template.yaml
@@ -17,7 +17,7 @@
 #
 name: test-entity-basic-template
 description: TestEntity with templated brooklyn.config and additional config (such as services)
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.test.entity.TestEntity
   name: testentity

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-entity-reference-map-template.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-entity-reference-map-template.yaml b/usage/camp/src/test/resources/test-entity-reference-map-template.yaml
index b724cd7..f03abbd 100644
--- a/usage/camp/src/test/resources/test-entity-reference-map-template.yaml
+++ b/usage/camp/src/test/resources/test-entity-reference-map-template.yaml
@@ -17,7 +17,7 @@
 #
 name: test-entity-reference-map-template
 description: TestEntity with templated brooklyn.config and additional config (such as services)
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.entity.basic.BasicEntity
   id: one

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-entity-with-enricher.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-entity-with-enricher.yaml b/usage/camp/src/test/resources/test-entity-with-enricher.yaml
index 531de9d..fd0ae1e 100644
--- a/usage/camp/src/test/resources/test-entity-with-enricher.yaml
+++ b/usage/camp/src/test/resources/test-entity-with-enricher.yaml
@@ -18,7 +18,7 @@
 #
 name: test-entity-with-enricher
 description: TestEntity with Enricher at entity-level using Brooklyn
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.entity.basic.BasicEntity
   name: testentity

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-entity-with-init-config.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-entity-with-init-config.yaml b/usage/camp/src/test/resources/test-entity-with-init-config.yaml
index 1e57e24..91167b0 100644
--- a/usage/camp/src/test/resources/test-entity-with-init-config.yaml
+++ b/usage/camp/src/test/resources/test-entity-with-init-config.yaml
@@ -18,7 +18,7 @@
 #
 name: test-entity-with-init-config
 description: Creates a TestEntityWithInitConfig entity that references a 2nd test entity during its init()
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.test.entity.TestEntity
   id: te1

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-entity-with-policy.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-entity-with-policy.yaml b/usage/camp/src/test/resources/test-entity-with-policy.yaml
index 639bf24..84b0c9a 100644
--- a/usage/camp/src/test/resources/test-entity-with-policy.yaml
+++ b/usage/camp/src/test/resources/test-entity-with-policy.yaml
@@ -18,7 +18,7 @@
 #
 name: test-entity-with-policy
 description: TestEntity with Policy at entity-level using Brooklyn
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.entity.basic.BasicEntity
   name: testentity

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-propagating-enricher.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-propagating-enricher.yaml b/usage/camp/src/test/resources/test-propagating-enricher.yaml
index 3ebf28d..7dfd1f1 100644
--- a/usage/camp/src/test/resources/test-propagating-enricher.yaml
+++ b/usage/camp/src/test/resources/test-propagating-enricher.yaml
@@ -18,7 +18,7 @@
 #
 name: test-propagating-enricher
 description: TestEntity with Propagating Enricher at application-level using Brooklyn
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 services:
 - serviceType: brooklyn.test.entity.TestEntity
   id: te1

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-referencing-enrichers.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-referencing-enrichers.yaml b/usage/camp/src/test/resources/test-referencing-enrichers.yaml
index 7b2d318..4bfc2da 100644
--- a/usage/camp/src/test/resources/test-referencing-enrichers.yaml
+++ b/usage/camp/src/test/resources/test-referencing-enrichers.yaml
@@ -38,7 +38,7 @@
 #    (g1 enricher) (g2 enricher) 
 name: test-referencing-enrichers
 description: Test multi-layer application with each entity having an enricher referencing all other entities
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 id: app1
 brooklyn.enrichers:
   - enricherType: io.brooklyn.camp.brooklyn.TestReferencingEnricher

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-referencing-entities.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-referencing-entities.yaml b/usage/camp/src/test/resources/test-referencing-entities.yaml
index 7a5dfec..e37d851 100644
--- a/usage/camp/src/test/resources/test-referencing-entities.yaml
+++ b/usage/camp/src/test/resources/test-referencing-entities.yaml
@@ -34,7 +34,7 @@
 #       gchild1   gchild2       
 name: test-referencing-entities
 description: Test multi-layer application with each entity referencing all other entities
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 id: app1
 brooklyn.config:
   test.reference.app: $brooklyn:component("app1")

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/camp/src/test/resources/test-referencing-policies.yaml
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/resources/test-referencing-policies.yaml b/usage/camp/src/test/resources/test-referencing-policies.yaml
index 0b6e975..35f0233 100644
--- a/usage/camp/src/test/resources/test-referencing-policies.yaml
+++ b/usage/camp/src/test/resources/test-referencing-policies.yaml
@@ -38,7 +38,7 @@
 #     (g1 policy)   (g2 policy) 
 name: test-referencing-policies
 description: Test multi-layer application with each entity having a policy referencing all other entities
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 id: app1
 brooklyn.policies:
   - policyType: io.brooklyn.camp.brooklyn.TestReferencingPolicy

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cf49a6ed/usage/launcher/src/test/resources/mongo-scripts.yaml
----------------------------------------------------------------------
diff --git a/usage/launcher/src/test/resources/mongo-scripts.yaml b/usage/launcher/src/test/resources/mongo-scripts.yaml
index beff0ca..0115d71 100644
--- a/usage/launcher/src/test/resources/mongo-scripts.yaml
+++ b/usage/launcher/src/test/resources/mongo-scripts.yaml
@@ -18,7 +18,7 @@
 #
 name: Mongo Demo app
 description: MongoDB sharded deployment with MongoDB (javascript) client
-origin: http://brooklyn.io
+origin: https://github.com/apache/incubator-brooklyn
 location: localhost
 services:
 - serviceType: brooklyn.entity.nosql.mongodb.sharding.MongoDBShardedDeployment