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
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 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
export CASSANDRA_HOME=~/cassandra | |
export PATH=$PATH:$CASSANDRA_HOME/bin |
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
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 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
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 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
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 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
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 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
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 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
<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 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
package org.integrallis.drools.junit; | |
import org.kie.api.KieServices; | |
import org.kie.api.runtime.KieContainer; | |
import org.kie.api.runtime.KieSession; | |
import org.junit.After; | |
import org.junit.Before; | |
public abstract class BaseDroolsTestCase { |
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
rule "ACME-Fico" | |
when | |
the lender is "ACME Mortgage" | |
and there is an application | |
- with a FICO score below 680 | |
then | |
reject the application because "a FICO score of at least 680 is required" | |
end |