diff --git a/CHANGES.txt b/CHANGES.txt index f47967ccfe..983cdea179 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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) diff --git a/NEWS.txt b/NEWS.txt index addf0937a4..4d64428895 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -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 diff --git a/examples/simple_authentication/README.txt b/examples/simple_authentication/README.txt index 3de5092fd2..dcf95538d9 100644 --- a/examples/simple_authentication/README.txt +++ b/examples/simple_authentication/README.txt @@ -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. diff --git a/src/java/org/apache/cassandra/locator/Ec2Snitch.java b/src/java/org/apache/cassandra/locator/Ec2Snitch.java index 4ffc0e85a8..1dced958b2 100644 --- a/src/java/org/apache/cassandra/locator/Ec2Snitch.java +++ b/src/java/org/apache/cassandra/locator/Ec2Snitch.java @@ -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 + "."); } diff --git a/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java b/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java index a72069a856..103db51b58 100644 --- a/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java +++ b/test/unit/org/apache/cassandra/locator/EC2SnitchTest.java @@ -36,6 +36,7 @@ import org.junit.Test; public class EC2SnitchTest { + private static String az; private class TestEC2Snitch extends Ec2Snitch { @@ -47,13 +48,14 @@ public class EC2SnitchTest @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"); @@ -69,4 +71,14 @@ public class EC2SnitchTest 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)); + } }