cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1153727 - in /cassandra/trunk: ./ contrib/ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/streaming/ test/distributed/org/apache/cassandra/ test/resources/functions/
Date Thu, 04 Aug 2011 02:04:43 GMT
Author: jbellis
Date: Thu Aug  4 02:04:41 2011
New Revision: 1153727

URL: http://svn.apache.org/viewvc?rev=1153727&view=rev
Log:
merge from 0.8

Added:
    cassandra/trunk/test/resources/functions/
      - copied from r1153724, cassandra/branches/cassandra-0.8/test/resources/functions/
    cassandra/trunk/test/resources/functions/configure_cassandra.sh
      - copied unchanged from r1153724, cassandra/branches/cassandra-0.8/test/resources/functions/configure_cassandra.sh
    cassandra/trunk/test/resources/functions/install_cassandra.sh
      - copied unchanged from r1153724, cassandra/branches/cassandra-0.8/test/resources/functions/install_cassandra.sh
    cassandra/trunk/test/resources/functions/nodetool_cassandra.sh
      - copied unchanged from r1153724, cassandra/branches/cassandra-0.8/test/resources/functions/nodetool_cassandra.sh
    cassandra/trunk/test/resources/functions/start_cassandra.sh
      - copied unchanged from r1153724, cassandra/branches/cassandra-0.8/test/resources/functions/start_cassandra.sh
    cassandra/trunk/test/resources/functions/stop_cassandra.sh
      - copied unchanged from r1153724, cassandra/branches/cassandra-0.8/test/resources/functions/stop_cassandra.sh
    cassandra/trunk/test/resources/functions/wipe_cassandra.sh
      - copied unchanged from r1153724, cassandra/branches/cassandra-0.8/test/resources/functions/wipe_cassandra.sh
Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/contrib/   (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java
    cassandra/trunk/test/distributed/org/apache/cassandra/CassandraServiceController.java
    cassandra/trunk/test/distributed/org/apache/cassandra/MutationTest.java
    cassandra/trunk/test/distributed/org/apache/cassandra/TestBase.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 02:04:41 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7:1026516-1151306
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1153202,1153683
+/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1153724
 /cassandra/branches/cassandra-0.8.0:1125021-1130369
 /cassandra/branches/cassandra-0.8.1:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1153727&r1=1153726&r2=1153727&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Thu Aug  4 02:04:41 2011
@@ -64,6 +64,7 @@
  * add asynchronous and half-sync/half-async thrift servers (CASSANDRA-1405)
  * fix potential use of free'd native memory in SerializingCache 
    (CASSANDRA-2951)
+ * include files-to-be-streamed in StreamInSession.getSources (CASSANDRA-2972)
 
 
 0.8.2

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 02:04:41 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
 /cassandra/branches/cassandra-0.7/contrib:1026516-1151306
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1153202,1153683
+/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1153724
 /cassandra/branches/cassandra-0.8.0/contrib:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 02:04:41 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1151306
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1153202,1153683
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1153724
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 02:04:41 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1151306
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1153202,1153683
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1153724
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 02:04:41 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1151306
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1153202,1153683
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1153724
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 02:04:41 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1151306
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1153202,1153683
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1153724
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug  4 02:04:41 2011
@@ -1,7 +1,7 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1151306
 /cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1153202,1153683
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1153724
 /cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018
 /cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689

Modified: cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java?rev=1153727&r1=1153726&r2=1153727&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/streaming/StreamInSession.java Thu Aug 
4 02:04:41 2011
@@ -201,10 +201,9 @@ public class StreamInSession
             if (entry.getKey().left.equals(host))
             {
                 StreamInSession session = entry.getValue();
-                set.addAll(session.files);
-                if(session.current != null) {
+                if (session.current != null)
                     set.add(session.current);
-                }
+                set.addAll(session.files);
             }
         }
         return set;

Modified: cassandra/trunk/test/distributed/org/apache/cassandra/CassandraServiceController.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/distributed/org/apache/cassandra/CassandraServiceController.java?rev=1153727&r1=1153726&r2=1153727&view=diff
==============================================================================
--- cassandra/trunk/test/distributed/org/apache/cassandra/CassandraServiceController.java
(original)
+++ cassandra/trunk/test/distributed/org/apache/cassandra/CassandraServiceController.java
Thu Aug  4 02:04:41 2011
@@ -39,21 +39,21 @@ import org.apache.thrift.transport.TTran
 import org.apache.whirr.service.*;
 import org.apache.whirr.service.Cluster.Instance;
 import org.apache.whirr.service.cassandra.CassandraClusterActionHandler;
-import org.apache.whirr.service.jclouds.RunUrlStatement;
+import org.apache.whirr.service.jclouds.StatementBuilder;
 
 import org.jclouds.blobstore.domain.BlobMetadata;
 import org.jclouds.compute.ComputeService;
 import org.jclouds.compute.domain.ExecResponse;
 import org.jclouds.compute.domain.NodeMetadata;
 import org.jclouds.compute.options.RunScriptOptions;
+import org.jclouds.compute.RunScriptOnNodesException;
 import org.jclouds.domain.Credentials;
 import org.jclouds.scriptbuilder.domain.OsFamily;
+import org.jclouds.scriptbuilder.domain.Statements;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.jclouds.io.Payloads.newStringPayload;
-
 public class CassandraServiceController
 {
     private static final Logger LOG =
@@ -76,7 +76,6 @@ public class CassandraServiceController
     private Service             service;
     private Cluster             cluster;
     private ComputeService      computeService;
-    private Credentials         credentials;
     private CompositeConfiguration config;
     private BlobMetadata        tarball;
     private List<InetAddress>   hosts;
@@ -113,12 +112,12 @@ public class CassandraServiceController
             try
             {
                 Cassandra.Client client = createClient(addr);
-
                 client.describe_cluster_name();
                 break;
             }
             catch (TException e)
             {
+                LOG.debug(e.toString());
                 try
                 {
                     Thread.sleep(1000);
@@ -168,14 +167,13 @@ public class CassandraServiceController
         for (Instance instance : cluster.getInstances())
         {
             hosts.add(instance.getPublicAddress());
-            credentials = instance.getLoginCredentials();
         }
 
-        waitForClusterInitialization();
-
         ShutdownHook shutdownHook = new ShutdownHook(this);
         Runtime.getRuntime().addShutdownHook(shutdownHook);
 
+        waitForClusterInitialization();
+
         running = true;
     }
 
@@ -231,7 +229,7 @@ public class CassandraServiceController
      */
     public void nodetool(String args, InetAddress... hosts)
     {
-        callOnHosts(String.format("apache/cassandra/nodetool %s", args), hosts);
+        callOnHosts(Arrays.asList(hosts), "nodetool_cassandra", args);
     }
 
     /**
@@ -239,25 +237,31 @@ public class CassandraServiceController
      */
     public void wipeHosts(InetAddress... hosts)
     {
-        callOnHosts("apache/cassandra/wipe-state", hosts);
+        callOnHosts(Arrays.asList(hosts), "wipe_cassandra");
     }
 
     public Failure failHosts(List<InetAddress> hosts)
     {
-        return new Failure(hosts.toArray(new InetAddress[hosts.size()])).trigger();
+        return new Failure(hosts).trigger();
     }
 
     public Failure failHosts(InetAddress... hosts)
     {
-        return new Failure(hosts).trigger();
+        return new Failure(Arrays.asList(hosts)).trigger();
     }
 
     /** TODO: Move to CassandraService? */
-    protected void callOnHosts(String payload, InetAddress... hosts)
+    protected void callOnHosts(List<InetAddress> hosts, String functionName, String...
functionArgs)
     {
         final Set<String> hostset = new HashSet<String>();
+
         for (InetAddress host : hosts)
             hostset.add(host.getHostAddress());
+
+        StatementBuilder statementBuilder = new StatementBuilder();
+        statementBuilder.addStatement(Statements.call(functionName, functionArgs));
+        Credentials credentials = new Credentials(clusterSpec.getClusterUser(), clusterSpec.getPrivateKey());
+
         Map<? extends NodeMetadata,ExecResponse> results;
         try
         {
@@ -269,18 +273,27 @@ public class CassandraServiceController
                     intersection.retainAll(node.getPublicAddresses());
                     return !intersection.isEmpty();
                 }
-            }, newStringPayload(new RunUrlStatement(clusterSpec.getRunUrlBase(), payload).render(OsFamily.UNIX)),
-            RunScriptOptions.Builder.overrideCredentialsWith(credentials));
+            },
+            statementBuilder,
+            RunScriptOptions.Builder.overrideCredentialsWith(credentials).wrapInInitScript(false).runAsRoot(false));
         }
-        catch (Exception e)
+        catch (RunScriptOnNodesException e)
         {
             throw new RuntimeException(e);
         }
+
         if (results.size() != hostset.size())
+        {
             throw new RuntimeException(results.size() + " hosts matched " + hostset + ":
" + results);
+        }
+
         for (ExecResponse response : results.values())
+        {
             if (response.getExitCode() != 0)
-                throw new RuntimeException("Call " + payload + " failed on at least one of
" + hostset + ": " + results.values());
+            {
+                throw new RuntimeException("Call " + functionName + " failed on at least
one of " + hostset + ": " + results.values());
+            }
+        }
     }
 
     public List<InetAddress> getHosts()
@@ -290,24 +303,26 @@ public class CassandraServiceController
 
     class Failure
     {
-        private InetAddress[] hosts;
+        private List<InetAddress> hosts;
 
-        public Failure(InetAddress... hosts)
+        public Failure(List<InetAddress> hosts)
         {
             this.hosts = hosts;
         }
         
         public Failure trigger()
         {
-            callOnHosts("apache/cassandra/stop", hosts);
+            callOnHosts(hosts, "stop_cassandra");
             return this;
         }
 
         public void resolve()
         {
-            callOnHosts("apache/cassandra/start", hosts);
+            callOnHosts(hosts, "start_cassandra");
             for (InetAddress host : hosts)
+            {
                 waitForNodeInitialization(host);
+            }
         }
     }
 

Modified: cassandra/trunk/test/distributed/org/apache/cassandra/MutationTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/distributed/org/apache/cassandra/MutationTest.java?rev=1153727&r1=1153726&r2=1153727&view=diff
==============================================================================
--- cassandra/trunk/test/distributed/org/apache/cassandra/MutationTest.java (original)
+++ cassandra/trunk/test/distributed/org/apache/cassandra/MutationTest.java Thu Aug  4 02:04:41
2011
@@ -129,6 +129,7 @@ public class MutationTest extends TestBa
                 .expecting(UnavailableException.class).perform(ConsistencyLevel.QUORUM);
         } finally {
             failure.resolve();
+            Thread.sleep(10000);
         }
 
         // with all nodes up

Modified: cassandra/trunk/test/distributed/org/apache/cassandra/TestBase.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/distributed/org/apache/cassandra/TestBase.java?rev=1153727&r1=1153726&r2=1153727&view=diff
==============================================================================
--- cassandra/trunk/test/distributed/org/apache/cassandra/TestBase.java (original)
+++ cassandra/trunk/test/distributed/org/apache/cassandra/TestBase.java Thu Aug  4 02:04:41
2011
@@ -61,7 +61,6 @@ public abstract class TestBase
             cfdef.setRow_cache_size(1000);
             cfdef.setRow_cache_save_period_in_seconds(0);
             cfdef.setKey_cache_save_period_in_seconds(3600);
-            cfdef.setMemtable_flush_after_mins(59);
             cfdef.setMemtable_throughput_in_mb(255);
             cfdef.setMemtable_operations_in_millions(0.29);
         }
@@ -87,8 +86,7 @@ public abstract class TestBase
             client.system_add_keyspace(new KsDef(name,
                                                  "org.apache.cassandra.locator.SimpleStrategy",
                                                  Arrays.asList(cfdef))
-                                               .setStrategy_options(stratOptions)
-                                               .setCf_defs(Collections.<CfDef>emptyList()));
+                                               .setStrategy_options(stratOptions));
 
             // poll, until KS added
             for (InetAddress host : hosts)
@@ -199,7 +197,7 @@ public abstract class TestBase
         protected long timestamp;
 
         private Set<Class<Exception>> expected = new HashSet<Class<Exception>>();
-        private long timeout = StorageService.RING_DELAY;
+        private long timeout = StorageService.RING_DELAY * 2;
 
         public RetryingAction(Cassandra.Client client, String cf, ByteBuffer key)
         {



Mime
View raw message