This file contains hidden or 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
<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd" | |
xmlns="urn:infinispan:config:5.2"> | |
<global> | |
<transport> | |
<properties> | |
<property name="configurationFile" value="jgroups-tcp.xml"/> | |
</properties> | |
</transport> |
This file contains hidden or 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
CREATE TABLE raw_metrics ( | |
schedule_id int, | |
time timestamp, | |
value double, | |
PRIMARY KEY (schedule_id, time) | |
); |
This file contains hidden or 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
CREATE TABLE raw_metrics ( | |
schedule_id int, | |
time timestamp, | |
value double, | |
PRIMARY KEY (schedule_id, time) | |
); |
This file contains hidden or 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
@Listeners({CassandraClusterManager.class}) | |
public class MyTest { | |
@BeforeClass | |
@DeployCluster(numNodes = 4) // installs, and starts 4 node cluster | |
public void initCluster() { | |
... | |
} | |
@AfterClass |
This file contains hidden or 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
// A Thrift slice query using Hector | |
SliceQuery<Integer, Long, Double> query = HFactory.createSliceQuery(keyspace, IntegerSerializer.get(), | |
LongSerializer.get(), DoubleSerializer.get()); | |
query.setColumnFamily(RAW_METRIC_DATA_CF); | |
query.setKey(scheduleId); | |
query.setRange(null, null, false, 10); | |
` | |
QueryResult<ColumnSlice<Long, Double>> queryResult = query.execute(); | |
List<HColumn<Long, Double>> actual = queryResult.get().getColumns(); |
This file contains hidden or 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
<module xmlns="urn:jboss:module:1.0" name="org.apache-extras.cassandra-jdbc"> | |
<resources> | |
<resource-root path="cassandra-jdbc-1.2.0-SNAPSHOT.jar"/> | |
<resource-root path="cassandra-clientutil-1.2.0-beta1.jar"/> | |
<resource-root path="cassandra-thrift-1.2.0-beta1.jar"/> | |
<resource-root path="libthrift-0.7.0.jar"/> | |
<resource-root path="jsr305-1.3.9.jar"/> | |
<resource-root path="guava-12.0.jar"/> | |
</resources> |
This file contains hidden or 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
<subsystem xmlns="urn:jboss:domain:datasources:1.0"> | |
<datasources> | |
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" | |
use-java-context="true"> | |
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url> | |
<driver>h2</driver> | |
<security> | |
<user-name>sa</user-name> | |
<password>sa</password> | |
</security> |
This file contains hidden or 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
@Stateless | |
public class MySessionBean { | |
@Resource(name="CassandraDS", mappedName="java:jboss/datasources/CassandraDS") | |
private DataSource dataSource; | |
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) | |
public void useCassandraDS() { | |
try { | |
Connection connection = dataSource.getConnection(); |
This file contains hidden or 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
CREATE KEYSPACE rhq WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}; | |
USE rhq; | |
CREATE TABLE raw_metrics ( | |
schedule_id int, | |
time timestamp, | |
value double, | |
PRIMARY KEY (schedule_id, time) | |
); |
This file contains hidden or 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
require 'java' | |
import org.rhq.cassandra.schema.SchemaManager | |
if $project.properties['db'] == 'dev' | |
$self.log 'PERFORMING STORAGE NODE SETUP TO LATEST SCHEMA' | |
username = $project.properties.fetch('rhq.dev.cassandra.username', 'cassandra') | |
password = $project.properties.fetch('rhq.dev.cassandra.password', 'cassandra') | |
seeds = $project.properties.fetch('rhq.dev.cassandra.seeds', '127.0.0.1|9160|9142') |