Skip to content

Commit

Permalink
Merge branch 'cassandra-1.1.0' into cassandra-1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellis committed Mar 14, 2012
2 parents add6724 + c290372 commit d025bec
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -44,6 +44,7 @@ Merged from 1.0:


1.1-beta1
* add SOURCE and CAPTURE cqlsh commands (CASSANDRA-3479)
* add nodetool rebuild_index (CASSANDRA-3583)
* add nodetool rangekeysample (CASSANDRA-2917)
* Fix streaming too much data during move operations (CASSANDRA-3639)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.txt
Expand Up @@ -60,6 +60,10 @@ Features
be pinned to specfic media.
- Hadoop: a new BulkOutputFormat is included which will directly write
SSTables locally and then stream them into the cluster.
YOU SHOULD USE BulkOutputFormat BY DEFAULT. ColumnFamilyOutputFormat
is still around in case for some strange reason you want results
trickling out over Thrift, but BulkOutputFormat is significantly
more efficient.
- Hadoop: KeyRange.filter is now supported with ColumnFamilyInputFormat
- Hadoop wide row mode added to ColumnFamilyInputFormat
- The bulk loader is not longer a fat client; it can be run from an
Expand Down
11 changes: 11 additions & 0 deletions examples/simple_authentication/README.txt
Expand Up @@ -10,5 +10,16 @@ You can then set the authenticator and authority properties in cassandra.yaml
to use those classes. See the two configuration files access.properties and
passwd.properties to configure the authorized users and permissions.

When starting cassandra, you need to specify the location of the passwd.properties
and access.properties files by adding JVM args similar to the following either
in cassandra-env.sh or as commandline arguments:

-Dpasswd.properties=conf/passwd.properties
-Daccess.properties=conf/access.properties

For example, you might invoke cassandra as follows:

bin/cassandra -f -Dpasswd.properties=conf/passwd.properties -Daccess.properties=conf/access.properties

Please note that the code in this directory is for demonstration purposes. In
particular, it does not provide a high level of security.
9 changes: 7 additions & 2 deletions src/java/org/apache/cassandra/locator/Ec2Snitch.java
Expand Up @@ -51,10 +51,15 @@ public class Ec2Snitch extends AbstractNetworkTopologySnitch

public Ec2Snitch() throws IOException, ConfigurationException
{
String az = awsApiCall(ZONE_NAME_QUERY_URL);
// Split "us-east-1a" or "asia-1a" into "us-east"/"1a" and "asia"/"1a".
String[] splits = awsApiCall(ZONE_NAME_QUERY_URL).split("-");
String[] splits = az.split("-");
ec2zone = splits[splits.length - 1];
ec2region = splits.length < 3 ? splits[0] : splits[0] + "-" + splits[1];

// hack for CASSANDRA-4026
ec2region = az.substring(0, az.length() - 1);
if (ec2region.endsWith("1"))
ec2region = az.substring(0, az.length() - 3);
logger.info("EC2Snitch using region: " + ec2region + ", zone: " + ec2zone + ".");
}

Expand Down
14 changes: 13 additions & 1 deletion test/unit/org/apache/cassandra/locator/EC2SnitchTest.java
Expand Up @@ -36,6 +36,7 @@

public class EC2SnitchTest
{
private static String az;

private class TestEC2Snitch extends Ec2Snitch
{
Expand All @@ -47,13 +48,14 @@ public TestEC2Snitch() throws IOException, ConfigurationException
@Override
String awsApiCall(String url) throws IOException, ConfigurationException
{
return "us-east-1d";
return az;
}
}

@Test
public void testRac() throws IOException, ConfigurationException
{
az = "us-east-1d";
Ec2Snitch snitch = new TestEC2Snitch();
InetAddress local = InetAddress.getByName("127.0.0.1");
InetAddress nonlocal = InetAddress.getByName("127.0.0.7");
Expand All @@ -69,4 +71,14 @@ public void testRac() throws IOException, ConfigurationException
assertEquals("us-east", snitch.getDatacenter(local));
assertEquals("1d", snitch.getRack(local));
}

@Test
public void testNewRegions() throws IOException, ConfigurationException
{
az = "us-east-2d";
Ec2Snitch snitch = new TestEC2Snitch();
InetAddress local = InetAddress.getByName("127.0.0.1");
assertEquals("us-east-2", snitch.getDatacenter(local));
assertEquals("2d", snitch.getRack(local));
}
}

0 comments on commit d025bec

Please sign in to comment.