This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dse-cassandra | |
# starts a single datacenter DSE cluster and an opscenter node | |
services: | |
- type: io.cloudsoft.datastax.dse.DSECassandraDatacenter | |
name: DSE Cluster | |
brooklyn.config: | |
cluster.initial.size: 5 | |
cluster.initial.quorumSize: 3 | |
datastax.cassandra.opscenter.entity: $brooklyn:component("opscenter") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hosted AMP in SL running no blueprints currently, but previously deploying OG to SL and AWS | |
num #instances #bytes class name | |
---------------------------------------------- | |
1: 5798577 185554464 java.util.concurrent.ConcurrentHashMap$HashEntry | |
2: 5403795 172921440 java.lang.String | |
3: 1431659 84584664 [C | |
4: 1528111 67764056 [Ljava.util.concurrent.ConcurrentHashMap$HashEntry; | |
5: 1528111 61124440 java.util.concurrent.ConcurrentHashMap$Segment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > index.html << --EOF-- | |
<html><body> | |
<h1>Hello World</h1> | |
<p> | |
This is a sample Brooklyn-deployed web server, built on netcat. | |
Of course you can use any script here, or pre-built blueprints for common webapp, nosql, message software, | |
services, clusters, or a pre-built imageId, or Chef -- up to you. | |
</p> | |
<p> | |
Management policies can then be mixed in. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.cloudsoft.ibm.mms.amp.util; | |
import brooklyn.config.ConfigKey; | |
import brooklyn.enricher.Enrichers; | |
import brooklyn.entity.basic.AbstractEntity; | |
import brooklyn.entity.basic.Attributes; | |
import brooklyn.entity.basic.ConfigKeys; | |
import brooklyn.event.AttributeSensor; | |
import brooklyn.event.basic.Sensors; | |
import brooklyn.event.feed.http.HttpFeed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: chef-mysql-sample | |
location: | |
jclouds:aws-ec2:us-west-1: | |
minRam: 4gb | |
services: | |
- type: chef:mysql | |
... | |
provisioning.properties: | |
# this will override `minRam` set above | |
minRam: 5046mb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brooklyn.catalog: | |
version: 0.1 | |
description: Sample VM with a demo script | |
name: Alex-AWS-VM-1 | |
location: | |
jclouds:aws-ec2: | |
region: eu-west-1 | |
osFamily: ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String urlBase = "https://HOSTNAME:8443"; | |
String subUrl = "/"; | |
String password = "PASSWORD"; | |
org.apache.http.client.HttpClient c = new brooklyn.util.http.HttpTool.HttpClientBuilder().https(true).trustAll() | |
.uri(urlBase) | |
.credentials(new org.apache.http.auth.UsernamePasswordCredentials( | |
"admin", password)).build(); | |
brooklyn.util.http.HttpToolResponse r = brooklyn.util.http.HttpTool.httpGet(c, java.net.URI.create( | |
urlBase+subUrl), null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Function2 { int apply(int a, int b); } | |
int factorial(int n) { return applyFromOneToN(new Function2() { int apply(int a, int b) { return a*b; } }, n); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(ClusterSpec spec, | |
Predicate<NodeMetadata> condition, Statement statement) throws IOException, RunScriptOnNodesException { | |
return runScriptOnNodesMatching(spec, condition, statement, null); | |
} | |
public Map<? extends NodeMetadata, ExecResponse> runScriptOnNodesMatching(ClusterSpec spec, | |
Predicate<NodeMetadata> condition, Statement statement, RunScriptOptions options) | |
throws IOException, RunScriptOnNodesException { | |
Credentials credentials = new Credentials(spec.getClusterUser(), spec.getPrivateKey()); | |
if (options==null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.lang.builder.EqualsBuilder; | |
import org.apache.commons.lang.builder.HashCodeBuilder; | |
public class ReflectiveEquals { | |
static class Fast { | |
public int a = 1; | |
public int b = 2; | |
public String c = "foo"; | |
OlderNewer