cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [4/6] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Tue, 30 Sep 2014 15:59:46 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt
	test/unit/org/apache/cassandra/service/StorageServiceServerTest.java


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/42230c8c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/42230c8c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/42230c8c

Branch: refs/heads/trunk
Commit: 42230c8c50ad29197e6339fa18bbd080cf99bead
Parents: 3ece6f2 aa7794c
Author: Yuki Morishita <yukim@apache.org>
Authored: Tue Sep 30 10:56:55 2014 -0500
Committer: Yuki Morishita <yukim@apache.org>
Committed: Tue Sep 30 10:56:55 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/service/StorageService.java       | 28 +++++++----
 .../service/StorageServiceServerTest.java       | 50 ++++++++++++++++++++
 3 files changed, 71 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/42230c8c/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 354cb5d,5902d75..dcfc6c5
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -62,55 -13,9 +62,56 @@@ Merged from 2.0
   * Fix RowIndexEntry to report correct serializedSize (CASSANDRA-7948)
   * Make CQLSSTableWriter sync within partitions (CASSANDRA-7360)
   * Potentially use non-local replicas in CqlConfigHelper (CASSANDRA-7906)
 - * Explicitly disallowing mixing multi-column and single-column
 + * Explicitly disallow mixing multi-column and single-column
     relations on clustering columns (CASSANDRA-7711)
   * Better error message when condition is set on PK column (CASSANDRA-7804)
 + * Don't send schema change responses and events for no-op DDL
 +   statements (CASSANDRA-7600)
 + * (Hadoop) fix cluster initialisation for a split fetching (CASSANDRA-7774)
 + * Throw InvalidRequestException when queries contain relations on entire
 +   collection columns (CASSANDRA-7506)
 + * (cqlsh) enable CTRL-R history search with libedit (CASSANDRA-7577)
 + * (Hadoop) allow ACFRW to limit nodes to local DC (CASSANDRA-7252)
 + * (cqlsh) cqlsh should automatically disable tracing when selecting
 +   from system_traces (CASSANDRA-7641)
 + * (Hadoop) Add CqlOutputFormat (CASSANDRA-6927)
 + * Don't depend on cassandra config for nodetool ring (CASSANDRA-7508)
 + * (cqlsh) Fix failing cqlsh formatting tests (CASSANDRA-7703)
 + * Fix IncompatibleClassChangeError from hadoop2 (CASSANDRA-7229)
 + * Add 'nodetool sethintedhandoffthrottlekb' (CASSANDRA-7635)
 + * (cqlsh) Add tab-completion for CREATE/DROP USER IF [NOT] EXISTS (CASSANDRA-7611)
 + * Catch errors when the JVM pulls the rug out from GCInspector (CASSANDRA-5345)
 + * cqlsh fails when version number parts are not int (CASSANDRA-7524)
 + * Fix NPE when table dropped during streaming (CASSANDRA-7946)
 + * Fix wrong progress when streaming uncompressed (CASSANDRA-7878)
++ * Fix possible infinite loop in creating repair range (CASSANDRA-7983)
 +Merged from 1.2:
 + * Don't index tombstones (CASSANDRA-7828)
 + * Improve PasswordAuthenticator default super user setup (CASSANDRA-7788)
 +
 +
 +2.1.0
 + * (cqlsh) Removed "ALTER TYPE <name> RENAME TO <name>" from tab-completion
 +   (CASSANDRA-7895)
 + * Fixed IllegalStateException in anticompaction (CASSANDRA-7892)
 + * cqlsh: DESCRIBE support for frozen UDTs, tuples (CASSANDRA-7863)
 + * Avoid exposing internal classes over JMX (CASSANDRA-7879)
 + * Add null check for keys when freezing collection (CASSANDRA-7869)
 + * Improve stress workload realism (CASSANDRA-7519)
 +
 +
 +2.1.0-rc7
 + * Add frozen keyword and require UDT to be frozen (CASSANDRA-7857)
 + * Track added sstable size correctly (CASSANDRA-7239)
 + * (cqlsh) Fix case insensitivity (CASSANDRA-7834)
 + * Fix failure to stream ranges when moving (CASSANDRA-7836)
 + * Correctly remove tmplink files (CASSANDRA-7803)
 + * (cqlsh) Fix column name formatting for functions, CAS operations,
 +   and UDT field selections (CASSANDRA-7806)
 + * (cqlsh) Fix COPY FROM handling of null/empty primary key
 +   values (CASSANDRA-7792)
 + * Fix ordering of static cells (CASSANDRA-7763)
 +Merged from 2.0:
   * Forbid re-adding dropped counter columns (CASSANDRA-7831)
   * Fix CFMetaData#isThriftCompatible() for PK-only tables (CASSANDRA-7832)
   * Always reject inequality on the partition key without token()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/42230c8c/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/StorageService.java
index d2cb1ab,43bc198..46a7610
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@@ -35,16 -33,11 +35,17 @@@ import javax.management.MBeanServer
  import javax.management.Notification;
  import javax.management.NotificationBroadcasterSupport;
  import javax.management.ObjectName;
 +import javax.management.openmbean.TabularData;
 +import javax.management.openmbean.TabularDataSupport;
 +
 +import ch.qos.logback.classic.LoggerContext;
 +import ch.qos.logback.classic.jmx.JMXConfiguratorMBean;
 +import ch.qos.logback.classic.spi.ILoggingEvent;
 +import ch.qos.logback.core.Appender;
  
+ import com.google.common.annotations.VisibleForTesting;
  import com.google.common.base.Predicate;
  import com.google.common.collect.*;
 -import com.google.common.util.concurrent.AtomicDouble;
  import com.google.common.util.concurrent.FutureCallback;
  import com.google.common.util.concurrent.Futures;
  import com.google.common.util.concurrent.Uninterruptibles;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/42230c8c/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/service/StorageServiceServerTest.java
index 84b7a3c,d78c7d6..dd25b35
--- a/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java
+++ b/test/unit/org/apache/cassandra/service/StorageServiceServerTest.java
@@@ -428,34 -268,54 +432,80 @@@ public class StorageServiceServerTes
          assert primaryRanges.contains(new Range<Token>(new StringToken("B"), new StringToken("C")));
      }
  
 +    /* Does not make much sense to use -local and -pr with simplestrategy, but just to prevent
human errors */
 +    @Test
 +    public void testPrimaryRangeForEndpointWithinDCWithSimpleStrategy() throws Exception
 +    {
 +        TokenMetadata metadata = StorageService.instance.getTokenMetadata();
 +        metadata.clearUnsafe();
 +
 +        metadata.updateNormalToken(new StringToken("A"), InetAddress.getByName("127.0.0.1"));
 +        metadata.updateNormalToken(new StringToken("B"), InetAddress.getByName("127.0.0.2"));
 +        metadata.updateNormalToken(new StringToken("C"), InetAddress.getByName("127.0.0.3"));
 +
 +        Map<String, String> configOptions = new HashMap<>();
 +        configOptions.put("replication_factor", "2");
 +
 +        Keyspace.clear("Keyspace1");
 +        KSMetaData meta = KSMetaData.newKeyspace("Keyspace1", "SimpleStrategy", configOptions,
false);
 +        Schema.instance.setKeyspaceDefinition(meta);
 +
 +        Collection<Range<Token>> primaryRanges = StorageService.instance.getPrimaryRangeForEndpointWithinDC(meta.name,
InetAddress.getByName("127.0.0.1"));
 +        assert primaryRanges.size() == 1;
 +        assert primaryRanges.contains(new Range<Token>(new StringToken("C"), new StringToken("A")));
 +
 +        primaryRanges = StorageService.instance.getPrimaryRangeForEndpointWithinDC(meta.name,
InetAddress.getByName("127.0.0.2"));
 +        assert primaryRanges.size() == 1;
 +        assert primaryRanges.contains(new Range<Token>(new StringToken("A"), new StringToken("B")));
 +
 +        primaryRanges = StorageService.instance.getPrimaryRangeForEndpointWithinDC(meta.name,
InetAddress.getByName("127.0.0.3"));
 +        assert primaryRanges.size() == 1;
 +        assert primaryRanges.contains(new Range<Token>(new StringToken("B"), new StringToken("C")));
 +    }
++
+     @Test
+     public void testCreateRepairRangeFrom() throws Exception
+     {
+         StorageService.instance.setPartitionerUnsafe(new Murmur3Partitioner());
+ 
+         TokenMetadata metadata = StorageService.instance.getTokenMetadata();
+         metadata.clearUnsafe();
+ 
+         metadata.updateNormalToken(new LongToken(1000L), InetAddress.getByName("127.0.0.1"));
+         metadata.updateNormalToken(new LongToken(2000L), InetAddress.getByName("127.0.0.2"));
+         metadata.updateNormalToken(new LongToken(3000L), InetAddress.getByName("127.0.0.3"));
+         metadata.updateNormalToken(new LongToken(4000L), InetAddress.getByName("127.0.0.4"));
+ 
+         Map<String, String> configOptions = new HashMap<String, String>();
+         configOptions.put("replication_factor", "3");
 -
 -        Keyspace.clear("Keyspace1");
 -        KSMetaData meta = KSMetaData.newKeyspace("Keyspace1", "SimpleStrategy", configOptions,
false);
 -        Schema.instance.setKeyspaceDefinition(meta);
 -
+         Collection<Range<Token>> repairRangeFrom = StorageService.instance.createRepairRangeFrom("1500",
"3700");
+         assert repairRangeFrom.size() == 3;
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(1500L), new
LongToken(2000L)));
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(2000L), new
LongToken(3000L)));
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(3000L), new
LongToken(3700L)));
+ 
+         repairRangeFrom = StorageService.instance.createRepairRangeFrom("500", "700");
+         assert repairRangeFrom.size() == 1;
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(500L), new
LongToken(700L)));
+ 
+         repairRangeFrom = StorageService.instance.createRepairRangeFrom("500", "1700");
+         assert repairRangeFrom.size() == 2;
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(500L), new
LongToken(1000L)));
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(1000L), new
LongToken(1700L)));
+ 
+         repairRangeFrom = StorageService.instance.createRepairRangeFrom("2500", "2300");
+         assert repairRangeFrom.size() == 5;
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(2500L), new
LongToken(3000L)));
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(3000L), new
LongToken(4000L)));
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(4000L), new
LongToken(1000L)));
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(1000L), new
LongToken(2000L)));
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(2000L), new
LongToken(2300L)));
+ 
+         repairRangeFrom = StorageService.instance.createRepairRangeFrom("2000", "3000");
+         assert repairRangeFrom.size() == 1;
+         assert repairRangeFrom.contains(new Range<Token>(new LongToken(2000L), new
LongToken(3000L)));
+ 
+         repairRangeFrom = StorageService.instance.createRepairRangeFrom("2000", "2000");
+         assert repairRangeFrom.size() == 0;
+     }
  }


Mime
View raw message