Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
WHIRR-200. Cassandra integration test hangs. Contributed by Stu Hood.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/incubator/whirr/trunk@1059087 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
tomwhite committed Jan 14, 2011
1 parent f0b39c1 commit 7ad7aea
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -107,6 +107,8 @@ Trunk (unreleased changes)
WHIRR-164. Tests fail if there is no ~/.ssh/id_rsa keypair.
(Andrei Savu via tomwhite)

WHIRR-200. Cassandra integration test hangs. (Stu Hood via tomwhite)

Release 0.2.0 - 2010-11-04

NEW FEATURES
Expand Down
2 changes: 1 addition & 1 deletion scripts/apache/cassandra/install
Expand Up @@ -22,7 +22,7 @@ set -x
set -e

C_MAJOR_VERSION=${1:-0.7}
C_TAR_URL=${2:-http://www.apache.org/dist/cassandra/0.7.0/apache-cassandra-0.7.0-rc3-bin.tar.gz}
C_TAR_URL=${2:-http://www.apache.org/dist/cassandra/0.7.0/apache-cassandra-0.7.0-bin.tar.gz}

c_tar_file=`basename $C_TAR_URL`
c_tar_dir=`echo $c_tar_file | awk -F '-bin' '{print $1}'`
Expand Down
Binary file removed services/cassandra/lib/apache-cassandra-0.6.2.jar
Binary file not shown.
Binary file added services/cassandra/lib/apache-cassandra-0.7.0.jar
Binary file not shown.
Binary file added services/cassandra/lib/libthrift-0.5.jar
Binary file not shown.
Binary file removed services/cassandra/lib/libthrift-r917130.jar
Binary file not shown.
8 changes: 4 additions & 4 deletions services/cassandra/pom.xml
Expand Up @@ -85,16 +85,16 @@
<dependency>
<groupId>apache</groupId>
<artifactId>cassandra</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/apache-cassandra-0.6.2.jar</systemPath>
<systemPath>${basedir}/lib/apache-cassandra-0.7.0.jar</systemPath>
</dependency>
<dependency>
<groupId>apache</groupId>
<artifactId>thrift</artifactId>
<version>r917130</version>
<version>0.5</version>
<scope>system</scope>
<systemPath>${basedir}/lib/libthrift-r917130.jar</systemPath>
<systemPath>${basedir}/lib/libthrift-0.5.jar</systemPath>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Expand Up @@ -32,7 +32,9 @@
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.whirr.service.Cluster;
import org.apache.whirr.service.Cluster.Instance;
import org.apache.whirr.service.ClusterSpec;
Expand Down Expand Up @@ -67,17 +69,23 @@ public void setUp() throws Exception {
waitForCassandra();
}

private Cassandra.Client client(Instance instance) throws TException
{
TTransport trans = new TFramedTransport(new TSocket(
instance.getPublicAddress().getHostAddress(),
CassandraClusterActionHandler.CLIENT_PORT));
trans.open();
TBinaryProtocol protocol = new TBinaryProtocol(trans);
return new Cassandra.Client(protocol);
}

private void waitForCassandra() {
for (Instance instance : cluster.getInstances()) {
while (true) {
try {
TSocket socket = new TSocket(instance.getPublicAddress()
.getHostAddress(), CassandraClusterActionHandler.CLIENT_PORT);
socket.open();
TBinaryProtocol protocol = new TBinaryProtocol(socket);
Cassandra.Client client = new Cassandra.Client(protocol);
Cassandra.Client client = client(instance);
client.describe_cluster_name();
socket.close();
client.getOutputProtocol().getTransport().close();
break;
} catch (TException e) {
System.out.print(".");
Expand All @@ -95,16 +103,12 @@ private void waitForCassandra() {
public void testInstances() throws Exception {
Set<String> endPoints = new HashSet<String>();
for (Instance instance : cluster.getInstances()) {
TSocket socket = new TSocket(instance.getPublicAddress().getHostAddress(),
CassandraClusterActionHandler.CLIENT_PORT);
socket.open();
TBinaryProtocol protocol = new TBinaryProtocol(socket);
Cassandra.Client client = new Cassandra.Client(protocol);
List<TokenRange> tr = client.describe_ring(KEYSPACE);
for (TokenRange tokenRange : tr) {
endPoints.addAll(tokenRange.endpoints);
Cassandra.Client client = client(instance);
Map<String,List<String>> tr = client.describe_schema_versions();
for (List<String> version : tr.values()) {
endPoints.addAll(version);
}
socket.close();
client.getOutputProtocol().getTransport().close();
}

for (Instance instance : cluster.getInstances()) {
Expand Down

0 comments on commit 7ad7aea

Please sign in to comment.