move pillowfight to core rather than tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/94bf2998 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/94bf2998 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/94bf2998 Branch: refs/heads/master Commit: 94bf2998df461348102beae2a561445cd333b100 Parents: f51710d Author: Alex Heneveld <[email protected]> Authored: Wed Aug 27 14:26:33 2014 -0400 Committer: Alex Heneveld <[email protected]> Committed: Mon Sep 1 17:07:01 2014 +0100 ---------------------------------------------------------------------- .../nosql/couchbase/CouchbaseClusterImpl.java | 2 + .../entity/nosql/couchbase/pillowfight.yaml | 91 ++++++++++++++++++++ .../launcher/src/test/resources/couchbase.yaml | 4 +- .../src/test/resources/pillowfight.yaml | 91 -------------------- 4 files changed, 95 insertions(+), 93 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/94bf2998/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 dc63e8c..69b038a 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 @@ -363,6 +363,8 @@ public class CouchbaseClusterImpl extends DynamicClusterImpl implements Couchbas public void createBuckets() { //TODO: check for port conflicts if buckets are being created with a port List<Map<String, Object>> bucketsToCreate = getConfig(CREATE_BUCKETS); + if (bucketsToCreate==null) return; + Entity primaryNode = getPrimaryNode(); for (Map<String, Object> bucketMap : bucketsToCreate) { http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/94bf2998/software/nosql/src/main/resources/brooklyn/entity/nosql/couchbase/pillowfight.yaml ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/brooklyn/entity/nosql/couchbase/pillowfight.yaml b/software/nosql/src/main/resources/brooklyn/entity/nosql/couchbase/pillowfight.yaml new file mode 100644 index 0000000..9442725 --- /dev/null +++ b/software/nosql/src/main/resources/brooklyn/entity/nosql/couchbase/pillowfight.yaml @@ -0,0 +1,91 @@ +# +# 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. +# +services: +- type: brooklyn.entity.basic.VanillaSoftwareProcess + name: CBC Pillowfight + checkRunning.command: "" + stop.command: "" + launch.command: | + sudo wget -O/etc/apt/sources.list.d/couchbase.list http://packages.couchbase.com/ubuntu/couchbase-ubuntu1204.list + sudo wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add - + sudo apt-get update + sudo apt-get install -y libcouchbase2-libevent libcouchbase-dev libcouchbase2-bin + brooklyn.initializers: + - type: brooklyn.entity.software.ssh.SshCommandEffector + brooklyn.config: + name: cbcPillowFight + description: runs cbc pillowfight + command: > + cbc pillowfight + `if [ -n "$host" ]; then echo -h $host; fi` + `if [ -n "$bucket" ]; then echo -b $bucket; fi` + `if [ -n "$username" ]; then echo -u $username; fi` + `if [ -n "$password" ]; then echo -p $password; fi` + `if [ -n "$iterations" ]; then echo -i $iterations; fi` + `if [ -n "$numItems" ]; then echo -I $numItems; fi` + `if [ -n "$keyPrefix" ]; then echo -p $keyPrefix; fi` + `if [ -n "$numThreads" ]; then echo -t $numThreads; fi` + `if [ -n "$numInstances" ]; then echo -Q $numInstances; fi` + `if [ -n "$randomSeed" ]; then echo -s $randomSeed; fi` + `if [ -n "$minSize" ]; then echo -m $minSize; fi` + `if [ -n "$maxSize" ]; then echo -M $maxSize; fi` + parameters: + host: + description: list of hosts to connect to + defaultValue: 127.0.0.1:8091 + bucket: + description: bucket to use + defaultValue: default + username: + description: username used for authentication to the cluster + password: + description: password used for authentication to the cluster + iterations: + description: number of iterations to run + defaultValue: 1000 + numItems: + description: number of items to operate on + defaultValue: 1000 + keyPrefix: + description: prefix for keys + numThreads: + description: number of threads to use + defaultValue: 1 + numInstances: + description: number of connection instances to put into the shared connection pool + defaultValue: 1 + randomSeed: + description: random seed + defaultValue: 0 + ratio: + description: "specify SET/GET command ratio (default: 33, i.e. 33% SETs and 67% GETs)" + defaultValue: 33 + minSize: + description: minimum size of payload, i.e. document body + defaultValue: 50 + maxSize: + description: maximum size of payload, i.e. document body + defaultValue: 5120 + +# For CentOS, use the following launch command: +# launch.command: | +# sudo wget -O/etc/yum.repos.d/couchbase.repo http://packages.couchbase.com/rpm/couchbase-centos55-x86_64.repo +# sudo yum check-update +# sudo yum install -y libcouchbase2-libevent libcouchbase-devel libcouchbase2-bin + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/94bf2998/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 index d2ae0ed..14e1e15 100644 --- a/usage/launcher/src/test/resources/couchbase.yaml +++ b/usage/launcher/src/test/resources/couchbase.yaml @@ -18,7 +18,7 @@ # name: Couchbase -location: softlayer:ams01 +location: aws-ec2 services: - type: brooklyn.entity.nosql.couchbase.CouchbaseCluster @@ -26,4 +26,4 @@ services: adminPassword: Password initialSize: 3 -- type: "classpath://pillowfight.yaml" +- type: "classpath://brooklyn/entity/nosql/couchbase/pillowfight.yaml" http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/94bf2998/usage/launcher/src/test/resources/pillowfight.yaml ---------------------------------------------------------------------- diff --git a/usage/launcher/src/test/resources/pillowfight.yaml b/usage/launcher/src/test/resources/pillowfight.yaml deleted file mode 100644 index 9442725..0000000 --- a/usage/launcher/src/test/resources/pillowfight.yaml +++ /dev/null @@ -1,91 +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. -# -services: -- type: brooklyn.entity.basic.VanillaSoftwareProcess - name: CBC Pillowfight - checkRunning.command: "" - stop.command: "" - launch.command: | - sudo wget -O/etc/apt/sources.list.d/couchbase.list http://packages.couchbase.com/ubuntu/couchbase-ubuntu1204.list - sudo wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add - - sudo apt-get update - sudo apt-get install -y libcouchbase2-libevent libcouchbase-dev libcouchbase2-bin - brooklyn.initializers: - - type: brooklyn.entity.software.ssh.SshCommandEffector - brooklyn.config: - name: cbcPillowFight - description: runs cbc pillowfight - command: > - cbc pillowfight - `if [ -n "$host" ]; then echo -h $host; fi` - `if [ -n "$bucket" ]; then echo -b $bucket; fi` - `if [ -n "$username" ]; then echo -u $username; fi` - `if [ -n "$password" ]; then echo -p $password; fi` - `if [ -n "$iterations" ]; then echo -i $iterations; fi` - `if [ -n "$numItems" ]; then echo -I $numItems; fi` - `if [ -n "$keyPrefix" ]; then echo -p $keyPrefix; fi` - `if [ -n "$numThreads" ]; then echo -t $numThreads; fi` - `if [ -n "$numInstances" ]; then echo -Q $numInstances; fi` - `if [ -n "$randomSeed" ]; then echo -s $randomSeed; fi` - `if [ -n "$minSize" ]; then echo -m $minSize; fi` - `if [ -n "$maxSize" ]; then echo -M $maxSize; fi` - parameters: - host: - description: list of hosts to connect to - defaultValue: 127.0.0.1:8091 - bucket: - description: bucket to use - defaultValue: default - username: - description: username used for authentication to the cluster - password: - description: password used for authentication to the cluster - iterations: - description: number of iterations to run - defaultValue: 1000 - numItems: - description: number of items to operate on - defaultValue: 1000 - keyPrefix: - description: prefix for keys - numThreads: - description: number of threads to use - defaultValue: 1 - numInstances: - description: number of connection instances to put into the shared connection pool - defaultValue: 1 - randomSeed: - description: random seed - defaultValue: 0 - ratio: - description: "specify SET/GET command ratio (default: 33, i.e. 33% SETs and 67% GETs)" - defaultValue: 33 - minSize: - description: minimum size of payload, i.e. document body - defaultValue: 50 - maxSize: - description: maximum size of payload, i.e. document body - defaultValue: 5120 - -# For CentOS, use the following launch command: -# launch.command: | -# sudo wget -O/etc/yum.repos.d/couchbase.repo http://packages.couchbase.com/rpm/couchbase-centos55-x86_64.repo -# sudo yum check-update -# sudo yum install -y libcouchbase2-libevent libcouchbase-devel libcouchbase2-bin - \ No newline at end of file
