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
<config xmlns="urn:org:jgroups" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.2.xsd"> | |
<TCP | |
bind_port="7800" | |
loopback="false" | |
recv_buf_size="${tcp.recv_buf_size:20M}" | |
send_buf_size="${tcp.send_buf_size:640K}" | |
max_bundle_size="64K" | |
max_bundle_timeout="30" |
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.integrallis.atmosphere | |
import io.dropwizard.lifecycle.Managed | |
import java.io.BufferedReader | |
import java.io.InputStreamReader | |
import java.net.InetAddress | |
import java.util.List | |
import java.util.Set | |
import org.jgroups.JChannel |
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
session = cluster.connect("oink"); | |
for (Row row : session.execute("SELECT oink_id, dateOf(oink_id), user_id, body FROM oinks")) { | |
System.out.println("========================================================"); | |
System.out.println("OINK_ID: " + row.getUUID("oink_id")); | |
System.out.println("TIMESTAMP: " + row.getDate("dateOf(oink_id)")); | |
System.out.println("USER_ID: " + row.getString("user_id")); | |
System.out.println("BODY: " + row.getString("body")); | |
} | |
System.out.println("========================================================"); |
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 static void main(String[] args) { | |
Cluster cluster = null; | |
Session session = null; | |
try { | |
cluster = Cluster.builder().addContactPoints("localhost").build(); | |
Metadata metadata = cluster.getMetadata(); | |
System.out.printf("Connected to cluster: %s\n", metadata.getClusterName()); | |
for ( Host host : metadata.getAllHosts() ) { | |
System.out.printf("Datacenter: %s; Host: %s; Rack: %s\n", host.getDatacenter(), host.getAddress(), host.getRack()); |
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 org.integrallis.cassandra.oink; | |
import com.datastax.driver.core.Cluster; | |
import com.datastax.driver.core.Host; | |
import com.datastax.driver.core.Metadata; | |
import com.datastax.driver.core.Row; | |
import com.datastax.driver.core.Session; | |
import com.datastax.driver.core.exceptions.NoHostAvailableException; |
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 org.integrallis.cassandra.oink; | |
import com.datastax.driver.core.Cluster; | |
import com.datastax.driver.core.Host; | |
import com.datastax.driver.core.Metadata; | |
import com.datastax.driver.core.Row; | |
import com.datastax.driver.core.Session; | |
import com.datastax.driver.core.exceptions.NoHostAvailableException; | |
public class HelloCassandra { |
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
export CASSANDRA_HOME=~/cassandra | |
export PATH=$PATH:$CASSANDRA_HOME/bin |
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
sudo mkdir /var/lib/cassandra | |
sudo mkdir /var/log/cassandra | |
sudo chown -R $USER:$GROUP /var/lib/cassandra | |
sudo chown -R $USER:$GROUP /var/log/cassandra |
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
cd ~/temp | |
wget http://www.us.apache.org/dist/cassandra/2.1.2/apache-cassandra-2.1.2-bin.tar.gz | |
tar -xvzf apache-cassandra-2.1.2-bin.tar.gz | |
mv apache-cassandra-2.1.2 ~/cassandra |
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
brew install cassandra | |
brew install python | |
easy_install cql |