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 2014/07/25 18:45:41 UTC
[4/8] Deleted whirr/hadoop
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/examples/webapps/hello-world-hadoop/src/main/webapp/hadoop-wordcount.jsp
----------------------------------------------------------------------
diff --git a/examples/webapps/hello-world-hadoop/src/main/webapp/hadoop-wordcount.jsp b/examples/webapps/hello-world-hadoop/src/main/webapp/hadoop-wordcount.jsp
deleted file mode 100644
index c5ac296..0000000
--- a/examples/webapps/hello-world-hadoop/src/main/webapp/hadoop-wordcount.jsp
+++ /dev/null
@@ -1,121 +0,0 @@
-<%@ page language="java" import="java.sql.*"%>
-
-<html>
-<!--
- 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.
--->
-<head>
-<title>Sample Application Database JSP Page</title>
-</head>
-<body bgcolor=white>
-
-<table border="0">
-<tr>
-<td align=center>
-<img src="images/bridge-small.png">
-</td>
-<td>
-<h1>Sample Brooklyn Deployed WebApp (Hadoop JSP)</h1>
-This is the output of a JSP page that is part of the Hello, World application,
-deployed by brooklyn, to show <b>a hadoop map-reduce task run<b>.
-</td>
-</tr>
-</table>
-
-<%
-String hadoopConfigUrl=System.getProperty("brooklyn.example.hadoop.site.xml.url");
-String hadoopConfigContents=System.getProperty("brooklyn.example.hadoop.site.xml.contents");
-if (hadoopConfigUrl==null && hadoopConfigContents==null) {
-%>
- <p>There is no hadoop included as part of this example. Set brooklyn.example.hadoop.site.xml.url
- or brooklyn.example.hadoop.site.xml.contents to proceed.</p>
-<% } else { /* begin hadoop-enabled block */
-
-try {
- org.apache.hadoop.conf.Configuration conf = new org.apache.hadoop.conf.Configuration();
- conf.setClassLoader(brooklyn.demo.webapp.hello.HadoopWordCount.class.getClassLoader());
- if (hadoopConfigUrl!=null) conf.addResource(new java.net.URL(hadoopConfigUrl));
- if (hadoopConfigContents!=null) conf.addResource(new java.io.ByteArrayInputStream(hadoopConfigContents.getBytes()));
- org.apache.hadoop.fs.FileSystem fsClient = org.apache.hadoop.fs.FileSystem.get(conf);
- if (fsClient==null) throw new NullPointerException("Can't access fsClient");
-
- org.apache.hadoop.mapreduce.Job job = brooklyn.demo.webapp.hello.HadoopWordCount.makeJob(conf);
- String jar = brooklyn.demo.webapp.hello.SerializeHelloWorldHadoopJar.getJarName();
- if (jar!=null) { ((org.apache.hadoop.mapred.JobConf)job.getConfiguration()).setJar(jar); }
- else { %><b>JAR not available. Map-Reduce submission will likely fail.</b><% }
- org.apache.hadoop.fs.FileStatus[] files = fsClient.listStatus(new org.apache.hadoop.fs.Path("chats"));
- if (files==null) files = new org.apache.hadoop.fs.FileStatus[0];
- for (org.apache.hadoop.fs.FileStatus f: files) {
- org.apache.hadoop.mapreduce.lib.input.FileInputFormat.addInputPath(job, f.getPath());
- }
-
- org.apache.hadoop.fs.Path outp = new org.apache.hadoop.fs.Path("out-"+((int)(Math.random()*10000)));
- org.apache.hadoop.mapreduce.lib.output.FileOutputFormat.setOutputPath(job, outp);
-
- %> <p>Running Map-Reduce... <%
- out.flush();
-
- boolean result = job.waitForCompletion(true);
-
- %> finished: <%
- if (!result) {
- %> <b>Job failed.</b> Consult the logs for more information.</p> <%
- } else {
- %> <b>Success.</b> </p> <%
- }
-
- %> <p>Output from map reduce is as follows:</p> <%
-
- files = fsClient.listStatus(outp);
- if (files==null) files = new org.apache.hadoop.fs.FileStatus[0];
- for (org.apache.hadoop.fs.FileStatus f: files) {
- try {
- if (!f.isDir() && f.getLen()>0) {
- %>
- <%= f.getPath() %>:<br/>
- <pre><%= brooklyn.demo.webapp.hello.DemoUtils.stringFromInputStream(fsClient.open(f.getPath())) %></pre>
- <%
- }
- } catch (Exception e) {
- %> Error: <%= e %><%
- }
- }
- if (files.length==0) {
- %>
- <i>No output.</i> </li>
- <%
- }
-
- fsClient.delete(outp, true);
-
-} catch (Exception e) {
-%>
- <b>Error connecting to Hadoop.</b><br/>
- ERROR: <%= e %><br/>
- <pre> <%= brooklyn.demo.webapp.hello.DemoUtils.getStackTrace(e) %></pre>
-<%
-}
-}
-%>
-
- <br/>
- <p>Click <a href="hadoop-chat.jsp">here</a> to view the chat room.</p>
- <p>Click <a href="index.html">here</a> to go back to the main page.</p>
-
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/examples/webapps/hello-world-hadoop/src/main/webapp/images/bridge-small.png
----------------------------------------------------------------------
diff --git a/examples/webapps/hello-world-hadoop/src/main/webapp/images/bridge-small.png b/examples/webapps/hello-world-hadoop/src/main/webapp/images/bridge-small.png
deleted file mode 100644
index 4149c3c..0000000
Binary files a/examples/webapps/hello-world-hadoop/src/main/webapp/images/bridge-small.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/examples/webapps/hello-world-hadoop/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/examples/webapps/hello-world-hadoop/src/main/webapp/index.html b/examples/webapps/hello-world-hadoop/src/main/webapp/index.html
deleted file mode 100644
index 354aea4..0000000
--- a/examples/webapps/hello-world-hadoop/src/main/webapp/index.html
+++ /dev/null
@@ -1,45 +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.
--->
-
-<html>
-<head>
-<title>Sample "Hello, World" Application</title>
-</head>
-<body bgcolor=white>
-
-<table border="0">
-<tr>
-<td>
-<img src="images/bridge-small.png">
-</td>
-<td>
-<h1>Sample Brooklyn Deployed "Hello, World" Application</h1>
-<p>This is the home page for a sample application used to illustrate
-how web applications can be deployed to multi-cloud environments using Brooklyn.
-</td>
-</tr>
-</table>
-
-<p>
-See the available illustrations <a href="available.jsp">here</a>.
-</p>
-
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/examples/webapps/pom.xml
----------------------------------------------------------------------
diff --git a/examples/webapps/pom.xml b/examples/webapps/pom.xml
index c327394..d06ed98 100644
--- a/examples/webapps/pom.xml
+++ b/examples/webapps/pom.xml
@@ -41,7 +41,5 @@
<modules>
<module>hello-world-webapp</module>
<module>hello-world-sql</module>
- <module>hello-world-hadoop-jar</module>
- <module>hello-world-hadoop</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 19b3259..bf33198 100644
--- a/pom.xml
+++ b/pom.xml
@@ -116,7 +116,6 @@
<logback.version>1.0.7</logback.version>
<testng.version>6.8</testng.version>
<mockito.version>1.9.5</mockito.version>
- <whirr.version>0.8.1</whirr.version>
<slf4j.version>1.6.6</slf4j.version> <!-- used for java.util.logging jul-to-slf4j interception -->
<xstream.version>1.4.7</xstream.version>
<jackson.version>1.9.13</jackson.version> <!-- codehaus jackson, used by brooklyn rest server -->
@@ -807,8 +806,6 @@
<module>software/nosql</module>
<module>software/database</module>
<module>software/monitoring</module>
- <module>systems/whirr/base</module>
- <module>systems/whirr/hadoop</module>
</modules>
</profile>
<profile>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/pom.xml
----------------------------------------------------------------------
diff --git a/systems/whirr/base/pom.xml b/systems/whirr/base/pom.xml
deleted file mode 100644
index 00c9693..0000000
--- a/systems/whirr/base/pom.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>brooklyn-systems-whirr</artifactId>
- <packaging>jar</packaging>
- <name>Brooklyn Whirr Base Entities</name>
- <description>
- Brooklyn entities for Whirr integration, as base classes for systems deployed via Apache Whirr
- </description>
-
- <parent>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-parent</artifactId>
- <version>0.7.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-core</artifactId>
- </dependency>
- <dependency>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-locations-jclouds</artifactId>
- <version>${brooklyn.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.whirr</groupId>
- <artifactId>whirr-core</artifactId>
- <version>${whirr.version}</version>
- <exclusions>
- <!-- exclude the versions whirr pulls in, in favour of our versions -->
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-allblobstore</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-scriptbuilder</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds.api</groupId>
- <artifactId>byon</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-joda</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-netty</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-enterprise</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-sshj</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-jsch</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-allcompute</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>${jclouds.groupId}.driver</groupId>
- <artifactId>jclouds-joda</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>${jclouds.groupId}.driver</groupId>
- <artifactId>jclouds-netty</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>${jclouds.groupId}.driver</groupId>
- <artifactId>jclouds-enterprise</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.whirr</groupId>
- <artifactId>whirr-cli</artifactId>
- <version>${whirr.version}</version>
- <scope>test</scope>
- <!-- you need the whirr services you actually use! cli pulls in all of them, which we want for tests -->
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <!-- solr pulls v1.6 of this in. used to break things. might be okay now (now using logback). -->
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </exclusion>
- <!-- Issue 469: these conflict with the servlet-api jar from brooklyn-rest -->
- <exclusion>
- <artifactId>servlet-api</artifactId>
- <groupId>org.mortbay.jetty</groupId>
- </exclusion>
- <exclusion>
- <artifactId>servlet-api</artifactId>
- <groupId>javax.servlet</groupId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>brooklyn-test-support</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-core</artifactId>
- <version>${project.version}</version>
- <classifier>tests</classifier>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.whirr</groupId>
- <artifactId>whirr-elasticsearch</artifactId>
- <version>${whirr.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrCluster.java
----------------------------------------------------------------------
diff --git a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrCluster.java b/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrCluster.java
deleted file mode 100644
index fe42591..0000000
--- a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrCluster.java
+++ /dev/null
@@ -1,70 +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.
- */
-package brooklyn.extras.whirr.core;
-
-import java.util.Collection;
-
-import org.apache.whirr.Cluster;
-import org.apache.whirr.ClusterController;
-import org.apache.whirr.ClusterSpec;
-
-import brooklyn.entity.Entity;
-import brooklyn.entity.proxying.ImplementedBy;
-import brooklyn.entity.trait.Startable;
-import brooklyn.event.basic.BasicAttributeSensor;
-import brooklyn.event.basic.BasicConfigKey;
-import brooklyn.location.Location;
-import brooklyn.util.flags.SetFromFlag;
-
-import com.google.common.annotations.Beta;
-import com.google.common.annotations.VisibleForTesting;
-
-/**
- * Generic entity that can be used to deploy clusters that are
- * managed by Apache Whirr.
- *
- */
-@ImplementedBy(WhirrClusterImpl.class)
-public interface WhirrCluster extends Entity, Startable {
-
- @SetFromFlag("recipe")
- public static final BasicConfigKey<String> RECIPE = new BasicConfigKey<String>(
- String.class, "whirr.recipe", "Apache Whirr cluster recipe");
-
- public static final BasicAttributeSensor<String> CLUSTER_NAME = new BasicAttributeSensor<String>(
- String.class, "whirr.cluster.name", "Name of the Whirr cluster");
-
- /**
- * Apache Whirr can only start and manage a cluster in a single location
- *
- * @param locations
- */
- @Override
- void start(Collection<? extends Location> locations);
-
- @Beta
- public ClusterSpec getClusterSpec();
-
- @Beta
- public Cluster getCluster();
-
- @Beta
- @VisibleForTesting
- public ClusterController getController();
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrClusterImpl.java
----------------------------------------------------------------------
diff --git a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrClusterImpl.java b/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrClusterImpl.java
deleted file mode 100644
index 56206fb..0000000
--- a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrClusterImpl.java
+++ /dev/null
@@ -1,249 +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.
- */
-package brooklyn.extras.whirr.core;
-
-import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
-import static com.google.common.collect.Iterables.getOnlyElement;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.Collection;
-import java.util.Map;
-
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.whirr.Cluster;
-import org.apache.whirr.ClusterController;
-import org.apache.whirr.ClusterControllerFactory;
-import org.apache.whirr.ClusterSpec;
-import org.jclouds.scriptbuilder.domain.OsFamily;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import brooklyn.entity.Entity;
-import brooklyn.entity.basic.AbstractEntity;
-import brooklyn.entity.basic.Entities;
-import brooklyn.entity.proxying.EntitySpec;
-import brooklyn.location.Location;
-import brooklyn.location.MachineLocation;
-import brooklyn.location.basic.LocalhostMachineProvisioningLocation;
-import brooklyn.location.basic.LocationConfigUtils;
-import brooklyn.location.jclouds.JcloudsLocation;
-import brooklyn.location.jclouds.JcloudsLocationConfig;
-import brooklyn.util.exceptions.Exceptions;
-
-/**
- * Generic entity that can be used to deploy clusters that are
- * managed by Apache Whirr.
- *
- */
-public class WhirrClusterImpl extends AbstractEntity implements WhirrCluster {
-
- public static final Logger log = LoggerFactory.getLogger(WhirrClusterImpl.class);
-
- protected ClusterController _controller = null;
- protected ClusterSpec clusterSpec = null;
- protected Cluster cluster = null;
-
- protected Location location = null;
-
- /**
- * General entity initialisation
- */
- public WhirrClusterImpl() {
- }
- public WhirrClusterImpl(Map flags) {
- super(flags);
- }
- public WhirrClusterImpl(Entity parent) {
- super(parent);
- }
- public WhirrClusterImpl(Map flags, Entity parent) {
- super(flags, parent);
- }
-
- @Override
- public ClusterSpec getClusterSpec() {
- return clusterSpec;
- }
-
- @Override
- public Cluster getCluster() {
- return cluster;
- }
-
- /**
- * Apache Whirr can only start and manage a cluster in a single location
- *
- * @param locations
- */
- @Override
- public void start(Collection<? extends Location> locations) {
- location = getOnlyElement(locations);
- try {
- startInLocation(location);
- } catch (Exception e) {
- throw Exceptions.propagate(e);
- }
- }
-
- protected void startInLocation(Location location) throws Exception {
- if (location instanceof LocalhostMachineProvisioningLocation) {
- startInLocation((LocalhostMachineProvisioningLocation)location);
- } else if (location instanceof JcloudsLocation) {
- startInLocation((JcloudsLocation)location);
- } else if (location instanceof MachineLocation) {
- startInLocation((MachineLocation)location);
- } else {
- throw new IllegalArgumentException("Unsupported location "+location+", when starting "+this);
- }
- }
-
- /**
- * Start a cluster as specified in the recipe on localhost
- *
- * @param location corresponding to localhost
- * @throws ConfigurationException
- */
- protected void startInLocation(LocalhostMachineProvisioningLocation location) throws Exception {
-
- PropertiesConfiguration config = new PropertiesConfiguration();
- config.load(new StringReader(getConfig(RECIPE)));
-
- StringBuilder nodes = new StringBuilder();
- nodes.append("nodes:\n");
- for (int i=0; i<10; i++) {
- String mid = (i==0?"":(""+(i+1)));
- nodes.append(" - id: localhost"+mid+"\n");
- nodes.append(" name: local machine "+mid+"\n");
- nodes.append(" hostname: 127.0.0.1\n");
- nodes.append(" os_arch: "+System.getProperty("os.arch")+"\n");
- nodes.append(" os_family: "+OsFamily.UNIX+"\n");
- nodes.append(" os_description: "+System.getProperty("os.name")+"\n");
- nodes.append(" os_version: "+System.getProperty("os.version")+"\n");
- nodes.append(" group: whirr\n");
- nodes.append(" tags:\n");
- nodes.append(" - local\n");
- nodes.append(" username: "+System.getProperty("user.name")+"\n"); //NOTE: needs passwordless sudo!!!
- nodes.append(" credential_url: file://"+System.getProperty("user.home")+"/.ssh/id_rsa\n");
- }
-
- //provide the BYON nodes to whirr
- config.setProperty("jclouds.byon.nodes", nodes.toString());
- config.setProperty(ClusterSpec.Property.LOCATION_ID.getConfigName(), "byon");
-
- clusterSpec = new ClusterSpec(config);
-
- clusterSpec.setServiceName("byon");
- clusterSpec.setProvider("byon");
- clusterSpec.setIdentity("notused");
- clusterSpec.setCredential("notused");
-
- log.info("Starting cluster with roles " + config.getProperty("whirr.instance-templates")
- + " in location " + location);
-
- startWithClusterSpec(clusterSpec,config);
- }
-
- /**
- * Start a cluster as specified in the recipe in a given location
- *
- * @param location jclouds location spec
- * @throws ConfigurationException
- */
- protected void startInLocation(JcloudsLocation location) throws Exception {
- PropertiesConfiguration config = new PropertiesConfiguration();
- config.load(new StringReader(getConfig(RECIPE)));
-
- customizeClusterSpecConfiguration(location, config);
-
- clusterSpec = new ClusterSpec(config);
- clusterSpec.setProvider(location.getProvider());
- clusterSpec.setIdentity(location.getIdentity());
- clusterSpec.setCredential(location.getCredential());
- // TODO inherit key data?
- clusterSpec.setPrivateKey(LocationConfigUtils.getPrivateKeyData(location.getAllConfigBag()));
- clusterSpec.setPublicKey(LocationConfigUtils.getPublicKeyData(location.getAllConfigBag()));
- // TODO: also add security groups when supported in the Whirr trunk
-
- startWithClusterSpec(clusterSpec, config);
- }
-
- protected void customizeClusterSpecConfiguration(JcloudsLocation location, PropertiesConfiguration config) {
- if (groovyTruth(location.getRegion()))
- config.setProperty(ClusterSpec.Property.LOCATION_ID.getConfigName(), location.getRegion());
- if (groovyTruth(location.getConfig(JcloudsLocationConfig.IMAGE_ID)))
- config.setProperty(ClusterSpec.Property.IMAGE_ID.getConfigName(), location.getConfig(JcloudsLocationConfig.IMAGE_ID));
- }
-
- @Override
- public synchronized ClusterController getController() {
- if (_controller==null) {
- String serviceName = (clusterSpec != null) ? clusterSpec.getServiceName() : null;
- _controller = new ClusterControllerFactory().create(serviceName);
- }
- return _controller;
- }
-
- void startWithClusterSpec(ClusterSpec clusterSpec, PropertiesConfiguration config) throws IOException, InterruptedException {
- log.info("Starting cluster "+this+" with roles " + config.getProperty("whirr.instance-templates")
- + " in location " + location);
- if (log.isDebugEnabled()) log.debug("Cluster "+this+" using recipe:\n"+getConfig(RECIPE));
-
- cluster = getController().launchCluster(clusterSpec);
-
- for (Cluster.Instance instance : cluster.getInstances()) {
- log.info("Creating group for instance " + instance.getId());
- WhirrInstance rolesGroup =
- addChild(EntitySpec.create(WhirrInstance.class).
- displayName("Instance:" + instance.getId()).
- configure("instance", instance));
- Entities.manage(rolesGroup);
-
- for (String role: instance.getRoles()) {
- log.info("Creating entity for '" + role + "' on instance " + instance.getId());
- Entities.manage(rolesGroup.addChild(EntitySpec.create(WhirrRole.class).
- displayName("Role:" + role).
- configure("role", role)));
- }
- addGroup(rolesGroup);
- }
-
- setAttribute(CLUSTER_NAME, clusterSpec.getClusterName());
- setAttribute(SERVICE_UP, true);
- }
-
- public void stop() {
- if (clusterSpec != null) {
- try {
- getController().destroyCluster(clusterSpec);
- } catch (Exception e) {
- throw Exceptions.propagate(e);
- }
- }
- clusterSpec = null;
- cluster = null;
- }
-
- public void restart() {
- // TODO better would be to restart the software instances, not the machines ?
- stop();
- start(getLocations());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstance.java
----------------------------------------------------------------------
diff --git a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstance.java b/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstance.java
deleted file mode 100644
index 632ba29..0000000
--- a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstance.java
+++ /dev/null
@@ -1,46 +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.
- */
-package brooklyn.extras.whirr.core;
-
-import org.apache.whirr.Cluster;
-
-import brooklyn.config.ConfigKey;
-import brooklyn.entity.basic.AbstractGroup;
-import brooklyn.entity.basic.Attributes;
-import brooklyn.entity.basic.ConfigKeys;
-import brooklyn.entity.proxying.ImplementedBy;
-import brooklyn.event.AttributeSensor;
-import brooklyn.event.basic.BasicConfigKey;
-import brooklyn.util.flags.SetFromFlag;
-
-@ImplementedBy(WhirrInstanceImpl.class)
-public interface WhirrInstance extends AbstractGroup {
-
- @SetFromFlag("role")
- public static final ConfigKey<String> ROLE = ConfigKeys.newStringConfigKey(
- "whirr.instance.role", "Apache Whirr instance role", null);
-
- @SetFromFlag("instance")
- public static final ConfigKey<Cluster.Instance> INSTANCE = new BasicConfigKey<Cluster.Instance>(
- Cluster.Instance.class, "whirr.instance.instance", "Apache Whirr instance Cluster.Instance");
-
- public static final AttributeSensor<String> HOSTNAME = Attributes.HOSTNAME;
-
- public String getRole();
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstanceImpl.java
----------------------------------------------------------------------
diff --git a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstanceImpl.java b/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstanceImpl.java
deleted file mode 100644
index 5203e4c..0000000
--- a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrInstanceImpl.java
+++ /dev/null
@@ -1,65 +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.
- */
-package brooklyn.extras.whirr.core;
-
-import java.io.IOException;
-
-import org.apache.whirr.Cluster;
-
-import brooklyn.config.ConfigKey;
-import brooklyn.entity.basic.AbstractGroupImpl;
-import brooklyn.entity.basic.Attributes;
-import brooklyn.entity.basic.ConfigKeys;
-import brooklyn.entity.trait.Changeable;
-import brooklyn.event.AttributeSensor;
-import brooklyn.util.exceptions.Exceptions;
-import brooklyn.util.flags.SetFromFlag;
-
-public class WhirrInstanceImpl extends AbstractGroupImpl implements WhirrInstance {
-
- @SetFromFlag("role")
- public static final ConfigKey<String> ROLE = ConfigKeys.newStringConfigKey("whirr.instance.role", "Apache Whirr instance role");
-
- @SetFromFlag("instance")
- public static final ConfigKey<Cluster.Instance> INSTANCE = ConfigKeys.newConfigKey(Cluster.Instance.class, "whirr.instance.instance", "Apache Whirr instance Cluster.Instance");
-
- public static final AttributeSensor<String> HOSTNAME = Attributes.HOSTNAME;
-
- public WhirrInstanceImpl() {
- super();
- }
-
- @Override
- public void init() {
- setAttribute(Changeable.GROUP_SIZE, 0);
- Cluster.Instance instance = getConfig(INSTANCE);
- if (instance != null) {
- try {
- setAttribute(HOSTNAME, instance.getPublicHostName());
- } catch (IOException e) {
- throw Exceptions.propagate(e);
- }
- }
- }
-
- @Override
- public String getRole() {
- return getConfig(ROLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRole.java
----------------------------------------------------------------------
diff --git a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRole.java b/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRole.java
deleted file mode 100644
index 5bde0f3..0000000
--- a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRole.java
+++ /dev/null
@@ -1,34 +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.
- */
-package brooklyn.extras.whirr.core;
-
-import brooklyn.entity.Entity;
-import brooklyn.entity.proxying.ImplementedBy;
-import brooklyn.event.basic.BasicConfigKey;
-import brooklyn.util.flags.SetFromFlag;
-
-@ImplementedBy(WhirrRoleImpl.class)
-public interface WhirrRole extends Entity {
-
- @SetFromFlag("role")
- public static final BasicConfigKey<String> ROLE = new BasicConfigKey<String>(
- String.class, "whirr.instance.role", "Apache Whirr instance role");
-
- public String getRole();
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRoleImpl.java
----------------------------------------------------------------------
diff --git a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRoleImpl.java b/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRoleImpl.java
deleted file mode 100644
index d915069..0000000
--- a/systems/whirr/base/src/main/java/brooklyn/extras/whirr/core/WhirrRoleImpl.java
+++ /dev/null
@@ -1,29 +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.
- */
-package brooklyn.extras.whirr.core;
-
-import brooklyn.entity.basic.AbstractEntity;
-
-public class WhirrRoleImpl extends AbstractEntity implements WhirrRole {
-
- @Override
- public String getRole() {
- return getConfig(ROLE);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/base/src/test/java/brooklyn/extras/whirr/core/WhirrClusterTest.java
----------------------------------------------------------------------
diff --git a/systems/whirr/base/src/test/java/brooklyn/extras/whirr/core/WhirrClusterTest.java b/systems/whirr/base/src/test/java/brooklyn/extras/whirr/core/WhirrClusterTest.java
deleted file mode 100644
index 96efcf7..0000000
--- a/systems/whirr/base/src/test/java/brooklyn/extras/whirr/core/WhirrClusterTest.java
+++ /dev/null
@@ -1,52 +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.
- */
-package brooklyn.extras.whirr.core;
-
-import org.testng.Assert;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import brooklyn.entity.basic.ApplicationBuilder;
-import brooklyn.entity.basic.Entities;
-import brooklyn.entity.proxying.EntitySpec;
-import brooklyn.test.entity.TestApplication;
-
-public class WhirrClusterTest {
-
- private TestApplication app;
- private WhirrCluster entity;
-
- @BeforeMethod(alwaysRun=true)
- public void setUp() throws Exception {
- app = ApplicationBuilder.newManagedApp(TestApplication.class);
- entity = app.createAndManageChild(EntitySpec.create(WhirrCluster.class));
- }
-
- @AfterMethod(alwaysRun=true)
- public void tearDown() throws Exception {
- if (app != null) Entities.destroyAll(app.getManagementContext());
- }
-
- @Test
- public void testControllerInitialized() {
- Assert.assertNotNull(entity.getController());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/hadoop/pom.xml
----------------------------------------------------------------------
diff --git a/systems/whirr/hadoop/pom.xml b/systems/whirr/hadoop/pom.xml
deleted file mode 100644
index 414b2f7..0000000
--- a/systems/whirr/hadoop/pom.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>brooklyn-systems-hadoop</artifactId>
- <packaging>jar</packaging>
- <name>Brooklyn Hadoop System Entities</name>
- <description>
- Brooklyn entities for Hadoop systems deployed using Whirr
- </description>
-
- <parent>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-parent</artifactId>
- <version>0.7.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
- <relativePath>../../../pom.xml</relativePath>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-systems-whirr</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.whirr</groupId>
- <artifactId>whirr-hadoop</artifactId>
- <version>${whirr.version}</version>
- </dependency>
-
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>brooklyn-test-support</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-core</artifactId>
- <version>${project.version}</version>
- <classifier>tests</classifier>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopCluster.java
----------------------------------------------------------------------
diff --git a/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopCluster.java b/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopCluster.java
deleted file mode 100644
index 08fde01..0000000
--- a/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopCluster.java
+++ /dev/null
@@ -1,63 +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.
- */
-package brooklyn.extras.whirr.hadoop;
-
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import brooklyn.entity.proxying.ImplementedBy;
-import brooklyn.event.basic.BasicAttributeSensor;
-import brooklyn.event.basic.BasicConfigKey;
-import brooklyn.extras.whirr.core.WhirrCluster;
-import brooklyn.util.flags.SetFromFlag;
-
-@ImplementedBy(WhirrHadoopClusterImpl.class)
-public interface WhirrHadoopCluster extends WhirrCluster {
-
- public static final Logger log = LoggerFactory.getLogger(WhirrHadoopCluster.class);
-
- @SetFromFlag("name")
- public static final BasicConfigKey<String> NAME = new BasicConfigKey<String>(
- String.class, "whirr.hadoop.name", "The name of the Hadoop cluster");
-
- @SetFromFlag("size")
- public static final BasicConfigKey<Integer> SIZE = new BasicConfigKey<Integer>(
- Integer.class, "whirr.hadoop.size", "The size of the Hadoop cluster (including a dedicated machine for the namenode)", 2);
-
- @SetFromFlag("memory")
- public static final BasicConfigKey<Integer> MEMORY = new BasicConfigKey<Integer>(
- Integer.class, "whirr.hadoop.memory", "The minimum amount of memory to use for each node (in megabytes)", 1024);
-
- public static final BasicAttributeSensor<String> NAME_NODE_URL = new BasicAttributeSensor<String>(
- String.class, "whirr.hadoop.namenodeUrl", "URL for the Hadoop name node in this cluster (hdfs://...)");
-
- public static final BasicAttributeSensor<String> JOB_TRACKER_HOST_PORT = new BasicAttributeSensor<String>(
- String.class, "whirr.hadoop.jobtrackerHostPort", "Hadoop Jobtracker host and port");
-
- public static final BasicAttributeSensor<String> SOCKS_SERVER = new BasicAttributeSensor<String>(
- String.class, "whirr.hadoop.socks.server", "Local SOCKS server connection details");
-
- public void generateWhirrClusterRecipe();
-
- public List<String> getUserRecipeLines();
-
- public void addRecipeLine(String line);
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterImpl.java
----------------------------------------------------------------------
diff --git a/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterImpl.java b/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterImpl.java
deleted file mode 100644
index 2cff6b8..0000000
--- a/systems/whirr/hadoop/src/main/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterImpl.java
+++ /dev/null
@@ -1,135 +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.
- */
-package brooklyn.extras.whirr.hadoop;
-
-import static brooklyn.util.JavaGroovyEquivalents.elvis;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.whirr.RolePredicates;
-import org.apache.whirr.service.hadoop.HadoopProxy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import brooklyn.entity.Entity;
-import brooklyn.extras.whirr.core.WhirrClusterImpl;
-import brooklyn.location.Location;
-import brooklyn.util.collections.MutableMap;
-import brooklyn.util.exceptions.Exceptions;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-
-public class WhirrHadoopClusterImpl extends WhirrClusterImpl implements WhirrHadoopCluster {
-
- public static final Logger log = LoggerFactory.getLogger(WhirrHadoopClusterImpl.class);
-
- protected HadoopProxy proxy = null;
-
- protected final List<String> userRecipeLines = Collections.synchronizedList(Lists.<String>newArrayList());
-
- public WhirrHadoopClusterImpl() {
- super();
- }
-
- public WhirrHadoopClusterImpl(Map flags) {
- this(flags, null);
- }
-
- public WhirrHadoopClusterImpl(Entity parent) {
- super(MutableMap.of(), parent);
- }
-
- public WhirrHadoopClusterImpl(Map flags, Entity parent) {
- super(flags, parent);
- }
-
- @Override
- public void init() {
- generateWhirrClusterRecipe();
- }
-
- @Override
- public void generateWhirrClusterRecipe() {
- Preconditions.checkArgument(getConfig(SIZE) > 1, "Min cluster size is 2");
- Preconditions.checkArgument(getConfig(MEMORY) >= 1000, "We need at least 1GB of memory per machine");
-
- List<String> recipeLines = Lists.newArrayList(
- "whirr.cluster-name=" + elvis((String)getConfig(NAME), "brooklyn-whirr-cluster").replaceAll("\\s+","-"),
- "whirr.instance-templates=1 hadoop-namenode+hadoop-jobtracker, "
- + (getConfig(SIZE) - 1) + " hadoop-datanode+hadoop-tasktracker",
- "whirr.hardware-min-ram=" + getConfig(MEMORY)
- // TODO: set whirr.hadoop.tarball.url=... to a reliable location
- );
-
- if (userRecipeLines.size() > 0) recipeLines.addAll(userRecipeLines);
- setConfig(RECIPE, Joiner.on("\n").join(recipeLines));
- }
-
- @Override
- public List<String> getUserRecipeLines() {
- synchronized (userRecipeLines) {
- return ImmutableList.copyOf(userRecipeLines);
- }
- }
-
- @Override
- public void addRecipeLine(String line) {
- userRecipeLines.add(checkNotNull(line, "line"));
- String r = elvis(getConfig(RECIPE), "");
- if (!Strings.isNullOrEmpty(r)) r += "\n";
- r += line;
- setConfig(RECIPE, r);
- }
-
- @Override
- public void start(Collection<? extends Location> locations) {
- super.start(locations);
-
- log.info("Starting local SOCKS proxy on port 6666 ...");
- proxy = new HadoopProxy(clusterSpec, cluster);
- try {
- proxy.start();
-
- setAttribute(SOCKS_SERVER, "localhost:6666");
-
- String namenodeHost = cluster.getInstanceMatching(RolePredicates.role("hadoop-namenode")).getPublicHostName();
- setAttribute(NAME_NODE_URL, "hdfs://" + namenodeHost + ":8020/");
-
- String jobtrackerHost = cluster.getInstanceMatching(RolePredicates.role("hadoop-jobtracker")).getPublicHostName();
- setAttribute(JOB_TRACKER_HOST_PORT, jobtrackerHost + ":8021");
- } catch (IOException e) {
- throw Exceptions.propagate(e);
- }
- }
-
- @Override
- public void stop() {
- if (proxy != null) proxy.stop();
- super.stop();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterLiveTest.java
----------------------------------------------------------------------
diff --git a/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterLiveTest.java b/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterLiveTest.java
deleted file mode 100644
index 9623d2f..0000000
--- a/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterLiveTest.java
+++ /dev/null
@@ -1,74 +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.
- */
-package brooklyn.extras.whirr.hadoop;
-
-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.config.BrooklynProperties;
-import brooklyn.entity.basic.ApplicationBuilder;
-import brooklyn.entity.basic.Entities;
-import brooklyn.entity.proxying.EntitySpec;
-import brooklyn.location.Location;
-import brooklyn.management.internal.LocalManagementContext;
-import brooklyn.test.entity.TestApplication;
-
-import com.google.common.collect.ImmutableList;
-
-public class WhirrHadoopClusterLiveTest {
-
- private static final Logger log = LoggerFactory.getLogger(WhirrHadoopClusterLiveTest.class);
-
- public static final String PROVIDER = "aws-ec2";
- public static final String LOCATION_SPEC = "jclouds:"+PROVIDER;
-
- protected TestApplication app;
- protected Location jcloudsLocation;
- private BrooklynProperties brooklynProperties;
- private LocalManagementContext ctx;
-
- @BeforeMethod(alwaysRun=true)
- public void setUp() throws Exception {
- brooklynProperties = BrooklynProperties.Factory.newDefault();
- ctx = new LocalManagementContext(brooklynProperties);
- app = ApplicationBuilder.newManagedApp(TestApplication.class, ctx);
- }
-
- @AfterMethod(alwaysRun=true)
- public void tearDown() throws Exception {
- if (app != null) Entities.destroyAllCatching(app.getManagementContext());
- }
-
- @Test(groups = { "Live" })
- public void testAwsRollout() {
- try {
- //final WhirrHadoopCluster hadoop =
- app.createAndManageChild(EntitySpec.create(WhirrHadoopCluster.class));
- Location loc = ctx.getLocationRegistry().resolve(LOCATION_SPEC);
- app.start(ImmutableList.of(loc));
- } finally {
- log.info("completed AWS Hadoop test: "+app.getAllAttributes());
- Entities.dumpInfo(app);
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterTest.java
----------------------------------------------------------------------
diff --git a/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterTest.java b/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterTest.java
deleted file mode 100644
index a893be7..0000000
--- a/systems/whirr/hadoop/src/test/java/brooklyn/extras/whirr/hadoop/WhirrHadoopClusterTest.java
+++ /dev/null
@@ -1,66 +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.
- */
-package brooklyn.extras.whirr.hadoop;
-
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import brooklyn.entity.basic.ApplicationBuilder;
-import brooklyn.entity.basic.Entities;
-import brooklyn.entity.proxying.EntitySpec;
-import brooklyn.test.entity.TestApplication;
-import brooklyn.util.exceptions.Exceptions;
-
-public class WhirrHadoopClusterTest {
-
- private TestApplication app;
-
- @BeforeMethod(alwaysRun=true)
- public void setUp() throws Exception {
- app = ApplicationBuilder.newManagedApp(TestApplication.class);
- }
-
- @AfterMethod(alwaysRun=true)
- public void tearDown() throws Exception {
- if (app != null) Entities.destroyAll(app.getManagementContext());
- }
-
- @Test
- public void testSizeTooSmall() throws Exception {
- try {
- WhirrHadoopCluster whc = app.createAndManageChild(EntitySpec.create(WhirrHadoopCluster.class)
- .configure("size", 1));
- } catch (Exception e) {
- IllegalArgumentException iae = Exceptions.getFirstThrowableOfType(e, IllegalArgumentException.class);
- if (iae != null && iae.toString().contains("Min cluster size is 2")) {
- // success
- } else {
- throw e;
- }
- }
- }
-
- @Test
- public void testDefaultsDontFailInRecipeGeneration() throws Exception {
- WhirrHadoopCluster whc = app.createAndManageChild(EntitySpec.create(WhirrHadoopCluster.class));
- whc.generateWhirrClusterRecipe();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/03888755/usage/all/pom.xml
----------------------------------------------------------------------
diff --git a/usage/all/pom.xml b/usage/all/pom.xml
index 12f66c1..d1efaf6 100644
--- a/usage/all/pom.xml
+++ b/usage/all/pom.xml
@@ -92,16 +92,6 @@
<dependency>
<groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-systems-whirr</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.brooklyn</groupId>
- <artifactId>brooklyn-systems-hadoop</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>io.brooklyn</groupId>
<artifactId>brooklyn-launcher</artifactId>
<version>${project.version}</version>
</dependency>