You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by to...@apache.org on 2010/12/20 23:55:37 UTC

svn commit: r1051311 - in /incubator/whirr/trunk: ./ cli/src/main/java/org/apache/whirr/cli/command/ core/src/main/java/org/apache/whirr/service/ core/src/test/java/org/apache/whirr/service/ services/cassandra/src/test/resources/ services/cdh/src/test/...

Author: tomwhite
Date: Mon Dec 20 22:55:36 2010
New Revision: 1051311

URL: http://svn.apache.org/viewvc?rev=1051311&view=rev
Log:
WHIRR-157. Remove service name property.

Modified:
    incubator/whirr/trunk/CHANGES.txt
    incubator/whirr/trunk/cli/src/main/java/org/apache/whirr/cli/command/AbstractClusterSpecCommand.java
    incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ServiceFactory.java
    incubator/whirr/trunk/core/src/test/java/org/apache/whirr/service/ServiceFactoryTest.java
    incubator/whirr/trunk/services/cassandra/src/test/resources/whirr-cassandra-test.properties
    incubator/whirr/trunk/services/cdh/src/test/resources/whirr-hadoop-test.properties
    incubator/whirr/trunk/services/hadoop/src/test/resources/whirr-hadoop-test.properties
    incubator/whirr/trunk/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties
    incubator/whirr/trunk/src/site/confluence/configuration-guide.confluence
    incubator/whirr/trunk/src/site/confluence/faq.confluence
    incubator/whirr/trunk/src/site/confluence/quick-start-guide.confluence

Modified: incubator/whirr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/CHANGES.txt?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/CHANGES.txt (original)
+++ incubator/whirr/trunk/CHANGES.txt Mon Dec 20 22:55:36 2010
@@ -49,6 +49,8 @@ Trunk (unreleased changes)
     WHIRR-156. Cli script doesn't launch post-modularization. (Andrei Savu and
     tomwhite via tomwhite)
 
+    WHIRR-157. Remove service name property. (tomwhite)
+
 Release 0.2.0 - 2010-11-04
 
   NEW FEATURES

Modified: incubator/whirr/trunk/cli/src/main/java/org/apache/whirr/cli/command/AbstractClusterSpecCommand.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/cli/src/main/java/org/apache/whirr/cli/command/AbstractClusterSpecCommand.java?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/cli/src/main/java/org/apache/whirr/cli/command/AbstractClusterSpecCommand.java (original)
+++ incubator/whirr/trunk/cli/src/main/java/org/apache/whirr/cli/command/AbstractClusterSpecCommand.java Mon Dec 20 22:55:36 2010
@@ -90,7 +90,7 @@ public abstract class AbstractClusterSpe
       config.addConfiguration(defaults);
     }
 
-    for (Property required : EnumSet.of(SERVICE_NAME, CLUSTER_NAME, IDENTITY)) {
+    for (Property required : EnumSet.of(CLUSTER_NAME, IDENTITY)) {
       if (config.getString(required.getConfigName()) == null) {
         throw new IllegalArgumentException(String.format("Option '%s' not set.",
             required.getSimpleName()));

Modified: incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ServiceFactory.java?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ServiceFactory.java (original)
+++ incubator/whirr/trunk/core/src/main/java/org/apache/whirr/service/ServiceFactory.java Mon Dec 20 22:55:36 2010
@@ -40,6 +40,9 @@ public class ServiceFactory {
    * name.
    */
   public Service create(String serviceName) {
+    if (serviceName == null) {
+      return new Service();
+    }
     for (Service service : serviceLoader) {
       if (service.getName().equals(serviceName)) {
         return service;

Modified: incubator/whirr/trunk/core/src/test/java/org/apache/whirr/service/ServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/core/src/test/java/org/apache/whirr/service/ServiceFactoryTest.java?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/core/src/test/java/org/apache/whirr/service/ServiceFactoryTest.java (original)
+++ incubator/whirr/trunk/core/src/test/java/org/apache/whirr/service/ServiceFactoryTest.java Mon Dec 20 22:55:36 2010
@@ -44,4 +44,11 @@ public class ServiceFactoryTest {
     Service service = factory.create("test-service");
     assertThat(service, instanceOf(TestService.class));
   }
+
+  @Test
+  public void testServiceFactoryWithNullServiceName() throws IOException {
+    ServiceFactory factory = new ServiceFactory();
+    Service service = factory.create(null);
+    assertThat(service, instanceOf(Service.class));
+  }
 }

Modified: incubator/whirr/trunk/services/cassandra/src/test/resources/whirr-cassandra-test.properties
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/cassandra/src/test/resources/whirr-cassandra-test.properties?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/services/cassandra/src/test/resources/whirr-cassandra-test.properties (original)
+++ incubator/whirr/trunk/services/cassandra/src/test/resources/whirr-cassandra-test.properties Mon Dec 20 22:55:36 2010
@@ -15,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-whirr.service-name=cassandra
 whirr.cluster-name=cassandraclustertest
 whirr.instance-templates=2 cassandra
 whirr.provider=ec2

Modified: incubator/whirr/trunk/services/cdh/src/test/resources/whirr-hadoop-test.properties
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/cdh/src/test/resources/whirr-hadoop-test.properties?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/services/cdh/src/test/resources/whirr-hadoop-test.properties (original)
+++ incubator/whirr/trunk/services/cdh/src/test/resources/whirr-hadoop-test.properties Mon Dec 20 22:55:36 2010
@@ -15,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-whirr.service-name=hadoop
 whirr.cluster-name=cdhclustertest
 whirr.instance-templates=1 jt+nn,1 dn+tt
 whirr.provider=ec2

Modified: incubator/whirr/trunk/services/hadoop/src/test/resources/whirr-hadoop-test.properties
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/hadoop/src/test/resources/whirr-hadoop-test.properties?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/services/hadoop/src/test/resources/whirr-hadoop-test.properties (original)
+++ incubator/whirr/trunk/services/hadoop/src/test/resources/whirr-hadoop-test.properties Mon Dec 20 22:55:36 2010
@@ -15,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-whirr.service-name=hadoop
 whirr.cluster-name=hadoopclustertest
 whirr.instance-templates=1 jt+nn,1 dn+tt
 whirr.provider=ec2

Modified: incubator/whirr/trunk/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties (original)
+++ incubator/whirr/trunk/services/zookeeper/src/test/resources/whirr-zookeeper-test.properties Mon Dec 20 22:55:36 2010
@@ -15,7 +15,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-whirr.service-name=zookeeper
 whirr.cluster-name=zkclustertest
 whirr.instance-templates=2 zk
 whirr.provider=ec2

Modified: incubator/whirr/trunk/src/site/confluence/configuration-guide.confluence
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/src/site/confluence/configuration-guide.confluence?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/src/site/confluence/configuration-guide.confluence (original)
+++ incubator/whirr/trunk/src/site/confluence/configuration-guide.confluence Mon Dec 20 22:55:36 2010
@@ -4,9 +4,9 @@ Whirr is configured using a properties f
 
 || Name || Command line option || Default || Description ||
 | {{whirr.config}} | {{\--config}} | none | A filename of a properties file containing properties in this table. Note that Whirr properties specified in this file all have a {{whirr.}} prefix. |
-| {{whirr.service-name}} | {{\--service-name}} | none | The name of the service to use. E.g. {{hadoop}}. |
+| {{whirr.service-name}} | {{\--service-name}} | The default service for launching clusters | The name of the service to use. You only need to set this if you want to use a non-standard service launcher. |
 | {{whirr.cluster-name}} | {{\--cluster-name}} | none | The name of the cluster to operate on. E.g. {{hadoopcluster}}. The cluster name is used to tag the instances in some cloud-specific way. For example, in Amazon it is used to form the security group name. |
-| {{whirr.instance-templates}} | {{\--instance-templates}} | none | The number of instances to launch for each set of roles. E.g. {{1 nn+jt,10 dn+tt}} means one instance with the roles {{nn}} (namenode) and {{jt}} (jobtracker), and ten instances each with the roles {{dn}} (datanode) and {{tt}} (tasktracker). |
+| {{whirr.instance-templates}} | {{\--instance-templates}} | none | The number of instances to launch for each set of roles in a service. E.g. {{1 nn+jt,10 dn+tt}} means one instance with the roles {{nn}} (namenode) and {{jt}} (jobtracker), and ten instances each with the roles {{dn}} (datanode) and {{tt}} (tasktracker). |
 | {{whirr.provider}} | {{\--provider}} | {{ec2}} | The name of the cloud provider. See the [table below|#cloud-provider-config] for possible provider names.|
 | {{whirr.identity}} | {{\--identity}} | none | The cloud identity. See the [table below|#cloud-provider-config] for how this maps to the credentials for your provider. |
 | {{whirr.credential}} | {{\--credential}} | none | The cloud credential. See the [table below|#cloud-provider-config] for how this maps to the credentials for your provider. |

Modified: incubator/whirr/trunk/src/site/confluence/faq.confluence
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/src/site/confluence/faq.confluence?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/src/site/confluence/faq.confluence (original)
+++ incubator/whirr/trunk/src/site/confluence/faq.confluence Mon Dec 20 22:55:36 2010
@@ -130,7 +130,6 @@ setting the {{whirr.hadoop-install-runur
 properties. Here is a sample configuration:
 
 {code}
-whirr.service-name=hadoop
 whirr.cluster-name=myhadoopcluster
 whirr.instance-templates=1 jt+nn,1 dn+tt
 whirr.provider=ec2
@@ -144,12 +143,9 @@ whirr.hadoop-configure-runurl=cloudera/c
 {anchor:other-services}
 h2. How do I run a ZooKeeper cluster?
 
-The {{service-name}} property determines the service to run, for ZooKeeper it
-should be set to {{zookeeper}}. Here is a sample ZooKeeper configuration for
-running a three-node ensemble:
+Here is a sample ZooKeeper configuration for running a three-node ensemble:
 
 {code}
-whirr.service-name=zookeeper
 whirr.cluster-name=myzkcluster
 whirr.instance-templates=3 zk
 whirr.provider=ec2
@@ -160,12 +156,9 @@ whirr.private-key-file=${sys:user.home}/
 
 h2. How do I run a Cassandra cluster?
 
-The {{service-name}} property determines the service to run, for Cassandra it
-should be set to {{cassandra}}. Here is a sample Cassandra configuration for
-running a three-node cluster:
+Here is a sample Cassandra configuration for running a three-node cluster:
 
 {code}
-whirr.service-name=cassandra
 whirr.cluster-name=mycassandracluster
 whirr.instance-templates=3 cassandra
 whirr.provider=ec2

Modified: incubator/whirr/trunk/src/site/confluence/quick-start-guide.confluence
URL: http://svn.apache.org/viewvc/incubator/whirr/trunk/src/site/confluence/quick-start-guide.confluence?rev=1051311&r1=1051310&r2=1051311&view=diff
==============================================================================
--- incubator/whirr/trunk/src/site/confluence/quick-start-guide.confluence (original)
+++ incubator/whirr/trunk/src/site/confluence/quick-start-guide.confluence Mon Dec 20 22:55:36 2010
@@ -34,7 +34,6 @@ a further machine for a datanode and tas
 other services in the [FAQ|faq#other-services].
 
 {code}
-whirr.service-name=hadoop
 whirr.cluster-name=myhadoopcluster
 whirr.instance-templates=1 jt+nn,1 dn+tt
 whirr.provider=ec2
@@ -127,7 +126,6 @@ for properties is not reflected in the c
 
 {code}
 % bin/whirr launch-cluster \
-    --service-name=hadoop \
     --cluster-name=myhadoopcluster \
     --instance-templates='1 jt+nn,1 dn+tt' \
     --provider=ec2 \