cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1087732 - in /cassandra/branches/cassandra-0.7: ./ test/distributed/ test/distributed/org/apache/cassandra/ test/distributed/org/apache/cassandra/utils/ test/resources/
Date Fri, 01 Apr 2011 14:57:45 GMT
Author: jbellis
Date: Fri Apr  1 14:57:44 2011
New Revision: 1087732

URL: http://svn.apache.org/viewvc?rev=1087732&view=rev
Log:
revert whirr change, it's for 0.8 only

Modified:
    cassandra/branches/cassandra-0.7/build.xml
    cassandra/branches/cassandra-0.7/test/distributed/README.txt
    cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/CassandraServiceController.java
    cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/utils/BlobUtils.java
    cassandra/branches/cassandra-0.7/test/resources/whirr-default.properties

Modified: cassandra/branches/cassandra-0.7/build.xml
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/build.xml?rev=1087732&r1=1087731&r2=1087732&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/build.xml (original)
+++ cassandra/branches/cassandra-0.7/build.xml Fri Apr  1 14:57:44 2011
@@ -207,10 +207,8 @@
                              sourcesFilesetId="test-dependency-sources" 
                              cacheDependencyRefs="true" 
                              dependencyRefsBuildFile="${build.dir}/test-dependencies.xml">
-        <dependency groupId="org.apache.whirr" artifactId="whirr-core" version="0.4.0-incubating"/>
-        <dependency groupId="org.apache.whirr" artifactId="whirr-cli" version="0.4.0-incubating"/>
-        <dependency groupId="org.jclouds.provider" artifactId="aws-s3" version="1.0-beta-9b"
/>
-
+        <dependency groupId="org.apache.whirr" artifactId="whirr-core" version="0.3.0-incubating"/>
+        <dependency groupId="org.apache.whirr" artifactId="whirr-cli" version="0.3.0-incubating"/>
         <remoteRepository refid="apache"/>
         <remoteRepository refid="central"/>
         <remoteRepository refid="jclouds"/>

Modified: cassandra/branches/cassandra-0.7/test/distributed/README.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/distributed/README.txt?rev=1087732&r1=1087731&r2=1087732&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/distributed/README.txt (original)
+++ cassandra/branches/cassandra-0.7/test/distributed/README.txt Fri Apr  1 14:57:44 2011
@@ -26,8 +26,7 @@ configuration is located at:
 
 An example EC2/S3 whirr configuration would be:
 ###############################################
-whirr.cluster-user=[username]
-whirr.provider=aws-ec2
+whirr.provider=ec2
 whirr.location-id=us-west-1
 whirr.image-id=us-west-1/ami-16f3a253
 whirr.hardware-id=m1.large
@@ -36,7 +35,7 @@ whirr.credential=[EC2 Secret Access Key]
 whirr.private-key-file=${sys:user.home}/.ssh/id_rsa
 whirr.public-key-file=${sys:user.home}/.ssh/id_rsa.pub
 whirr.run-url-base=http://hoodidge.net/scripts/
-whirr.blobstore.provider=aws-s3
+whirr.blobstore.provider=s3
 whirr.blobstore.container=cassandratests
 ###############################################
 

Modified: cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/CassandraServiceController.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/CassandraServiceController.java?rev=1087732&r1=1087731&r2=1087732&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/CassandraServiceController.java
(original)
+++ cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/CassandraServiceController.java
Fri Apr  1 14:57:44 2011
@@ -18,41 +18,52 @@
 
 package org.apache.cassandra;
 
+import java.io.IOException;
 import java.net.InetAddress;
 import java.net.URI;
 import java.util.*;
 
-import com.google.common.base.Predicate;
-
 import org.apache.cassandra.thrift.Cassandra;
-import org.apache.cassandra.utils.BlobUtils;
+import org.apache.cassandra.thrift.TokenRange;
 import org.apache.cassandra.utils.KeyPair;
+import org.apache.cassandra.utils.BlobUtils;
 import org.apache.cassandra.utils.Pair;
+
+import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.CompositeConfiguration;
 import org.apache.commons.configuration.PropertiesConfiguration;
+
 import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.protocol.TProtocol;
-import org.apache.thrift.transport.TFramedTransport;
-import org.apache.thrift.transport.TSocket;
-import org.apache.thrift.transport.TTransport;
-import org.apache.whirr.service.*;
+import org.apache.thrift.protocol.*;
+import org.apache.thrift.transport.*;
+
+import org.apache.whirr.service.Cluster;
 import org.apache.whirr.service.Cluster.Instance;
+import org.apache.whirr.service.ClusterSpec;
+import org.apache.whirr.service.ComputeServiceContextBuilder;
+import org.apache.whirr.service.Service;
+import org.apache.whirr.service.ServiceFactory;
+import org.apache.whirr.service.cassandra.CassandraService;
 import org.apache.whirr.service.cassandra.CassandraClusterActionHandler;
 import org.apache.whirr.service.jclouds.RunUrlStatement;
 
 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.domain.Credentials;
+import org.jclouds.io.Payload;
 import org.jclouds.scriptbuilder.domain.OsFamily;
+import org.jclouds.ssh.ExecResponse;
+import static org.jclouds.io.Payloads.newStringPayload;
+
+import com.google.common.base.Predicate;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.jclouds.io.Payloads.newStringPayload;
+import static org.junit.Assert.assertThat;
 
 public class CassandraServiceController
 {
@@ -73,7 +84,7 @@ public class CassandraServiceController
     private boolean     running;
 
     private ClusterSpec         clusterSpec;
-    private Service             service;
+    private CassandraService    service;
     private Cluster             cluster;
     private ComputeService      computeService;
     private Credentials         credentials;
@@ -85,7 +96,8 @@ public class CassandraServiceController
     {
     }
 
-    public Cassandra.Client createClient(InetAddress addr) throws TException
+    public Cassandra.Client createClient(InetAddress addr)
+        throws TTransportException, TException
     {
         TTransport transport    = new TSocket(
                                     addr.getHostAddress(),
@@ -158,10 +170,10 @@ public class CassandraServiceController
             tarball = blob.left;
             config.setProperty(CassandraClusterActionHandler.BIN_TARBALL, blob.right.toURL().toString());
             // TODO: parse the CassandraVersion property file instead
-            config.setProperty(CassandraClusterActionHandler.MAJOR_VERSION, "0.8");
+            config.setProperty(CassandraClusterActionHandler.MAJOR_VERSION, "0.7");
         }
 
-        service = new ServiceFactory().create(clusterSpec.getServiceName());
+        service = (CassandraService)new ServiceFactory().create(clusterSpec.getServiceName());
         cluster = service.launchCluster(clusterSpec);
         computeService = ComputeServiceContextBuilder.build(clusterSpec).getComputeService();
         hosts = new ArrayList<InetAddress>();

Modified: cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/utils/BlobUtils.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/utils/BlobUtils.java?rev=1087732&r1=1087731&r2=1087732&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/utils/BlobUtils.java
(original)
+++ cassandra/branches/cassandra-0.7/test/distributed/org/apache/cassandra/utils/BlobUtils.java
Fri Apr  1 14:57:44 2011
@@ -19,26 +19,24 @@
 package org.apache.cassandra.utils;
 
 import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
 import java.net.URI;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
 
-import com.google.common.io.Files;
 import org.apache.commons.configuration.Configuration;
 
 import org.apache.whirr.service.ClusterSpec;
 
+import org.jclouds.blobstore.BlobStore;
 import org.jclouds.blobstore.BlobStoreContext;
 import org.jclouds.blobstore.BlobStoreContextFactory;
-import org.jclouds.blobstore.InputStreamMap;
 import org.jclouds.blobstore.domain.BlobMetadata;
+import org.jclouds.blobstore.InputStreamMap;
 
-import org.jclouds.s3.S3AsyncClient;
-import org.jclouds.s3.S3Client;
-import org.jclouds.s3.domain.AccessControlList;
-import org.jclouds.s3.domain.CannedAccessPolicy;
+import org.jclouds.aws.s3.S3Client;
+import org.jclouds.aws.s3.S3AsyncClient;
+import org.jclouds.aws.s3.domain.AccessControlList;
+import org.jclouds.aws.s3.domain.CannedAccessPolicy;
+
+import org.jclouds.rest.RestContext;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -79,63 +77,24 @@ public final class BlobUtils
         File file = new File(filename);
         String container = getContainer(config);
         String provider = getProvider(config);
-
-        // blob name and checksum of the file
         String blobName = System.nanoTime() + "/" + file.getName();
-        String blobNameChecksum = blobName + ".md5";
-
         BlobStoreContext context = getContext(config, spec);
-
-        File checksumFile;
-
-        try
-        {
-            checksumFile = File.createTempFile("dtchecksum", "md5");
-            checksumFile.deleteOnExit();
-
-            FileWriter checksumWriter = new FileWriter(checksumFile);
-
-            String checksum = FBUtilities.bytesToHex(Files.getDigest(file, MessageDigest.getInstance("MD5")));
-
-            checksumWriter.write(String.format("%s  %s", checksum, file.getName()));
-            checksumWriter.close();
-        }
-        catch (IOException e)
-        {
-            throw new RuntimeException("Can't create a checksum of the file: " + filename);
-        }
-        catch (NoSuchAlgorithmException e)
-        {
-            throw new RuntimeException(e.getMessage());
-        }
-
         try
         {
             InputStreamMap map = context.createInputStreamMap(container);
-
             map.putFile(blobName, file);
-            map.putFile(blobNameChecksum, checksumFile);
-
             // TODO: magic! in order to expose the blob as public, we need to dive into provider
specific APIs
             // the hope is that permissions are encapsulated in jclouds in the future
-            if (provider.contains("s3"))
+            if (provider.equals("s3"))
             {
                 S3Client sss = context.<S3Client,S3AsyncClient>getProviderSpecificContext().getApi();
                 String ownerId = sss.getObjectACL(container, blobName).getOwner().getId();
-
                 sss.putObjectACL(container,
                                  blobName,
                                  AccessControlList.fromCannedAccessPolicy(CannedAccessPolicy.PUBLIC_READ,
ownerId));
-
-                sss.putObjectACL(container,
-                                 blobNameChecksum,
-                                 AccessControlList.fromCannedAccessPolicy(CannedAccessPolicy.PUBLIC_READ,
ownerId));
             }
             else
-            {
                 LOG.warn(provider + " may not be properly supported for tarball transfer.");
-            }
-
             // resolve the full URI of the blob (see http://code.google.com/p/jclouds/issues/detail?id=431)
             BlobMetadata blob = context.getBlobStore().blobMetadata(container, blobName);
             URI uri = context.getProviderSpecificContext().getEndpoint().resolve("/" + container
+ "/" + blob.getName());

Modified: cassandra/branches/cassandra-0.7/test/resources/whirr-default.properties
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/test/resources/whirr-default.properties?rev=1087732&r1=1087731&r2=1087732&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/test/resources/whirr-default.properties (original)
+++ cassandra/branches/cassandra-0.7/test/resources/whirr-default.properties Fri Apr  1 14:57:44
2011
@@ -17,6 +17,5 @@
 #
 whirr.service-name=cassandra
 whirr.cluster-name=cassandra_test
-whirr.cluster-user=app
 whirr.instance-templates=4 cassandra
-whirr.version=0.4.0-incubating
+whirr.version=0.3.0-incubating-SNAPSHOT



Mime
View raw message