r/m obsolete backwards compatibility
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1693a9b5 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1693a9b5 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1693a9b5 Branch: refs/heads/trunk Commit: 1693a9b51289d09519ab67a8b24fb36d4827317a Parents: 490a099 Author: Jonathan Ellis <[email protected]> Authored: Sat May 19 11:47:00 2012 -0500 Committer: Jonathan Ellis <[email protected]> Committed: Mon May 21 15:48:36 2012 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + NEWS.txt | 3 + .../org/apache/cassandra/net/MessagingService.java | 3 +- .../cassandra/service/AntiEntropyService.java | 12 ----- .../apache/cassandra/streaming/PendingFile.java | 22 +++----- .../apache/cassandra/streaming/StreamRequest.java | 38 +++++---------- 6 files changed, 26 insertions(+), 53 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1693a9b5/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 5543713..cf0f280 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,6 +7,7 @@ 'delete' key function (CASSANDRA-4132) * Save IndexSummary into new SSTable 'Summary' component (CASSANDRA-2392) * Add support for range tombstones (CASSANDRA-3708) + * Improve MessagingService efficiency (CASSANDRA-3617) 1.1.1-dev http://git-wip-us.apache.org/repos/asf/cassandra/blob/1693a9b5/NEWS.txt ---------------------------------------------------------------------- diff --git a/NEWS.txt b/NEWS.txt index e96409e..0748f58 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -21,6 +21,9 @@ Upgrading Upgrading --------- + - Network compatibility for versions older than 1.0 has been removed. + (Disk compatibility is retained.) If you want to do node-at-a-time, + zero-downtime upgrades to 1.2, you must be on 1.0 or 1.1 first. - The hints schema was changed from 1.1 to 1.2. Cassandra automatically snapshots and then truncates the hints column family as part of starting up 1.2 for the first time. Additionally, upgraded nodes http://git-wip-us.apache.org/repos/asf/cassandra/blob/1693a9b5/src/java/org/apache/cassandra/net/MessagingService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java index 21fb075..9dbdcdf 100644 --- a/src/java/org/apache/cassandra/net/MessagingService.java +++ b/src/java/org/apache/cassandra/net/MessagingService.java @@ -71,8 +71,7 @@ public final class MessagingService implements MessagingServiceMBean public static final String MBEAN_NAME = "org.apache.cassandra.net:type=MessagingService"; // 8 bits version, so don't waste versions - public static final int VERSION_07 = 1; - public static final int VERSION_080 = 2; + // We are no longer compatible with versions older than 1.0 public static final int VERSION_10 = 3; public static final int VERSION_11 = 4; public static final int VERSION_12 = 5; http://git-wip-us.apache.org/repos/asf/cassandra/blob/1693a9b5/src/java/org/apache/cassandra/service/AntiEntropyService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/AntiEntropyService.java b/src/java/org/apache/cassandra/service/AntiEntropyService.java index 1e9e321..08d4dd5 100644 --- a/src/java/org/apache/cassandra/service/AntiEntropyService.java +++ b/src/java/org/apache/cassandra/service/AntiEntropyService.java @@ -162,18 +162,6 @@ public class AntiEntropyService Set<InetAddress> neighbors = new HashSet<InetAddress>(replicaSets.get(rangeSuperSet)); neighbors.remove(FBUtilities.getBroadcastAddress()); - // Excluding all node with version <= 0.7 since they don't know how to - // create a correct merkle tree (they build it over the full range) - Iterator<InetAddress> iter = neighbors.iterator(); - while (iter.hasNext()) - { - InetAddress endpoint = iter.next(); - if (Gossiper.instance.getVersion(endpoint) <= MessagingService.VERSION_07) - { - logger.info("Excluding " + endpoint + " from repair because it is on version 0.7 or sooner. You should consider updating this node before running repair again."); - iter.remove(); - } - } return neighbors; } http://git-wip-us.apache.org/repos/asf/cassandra/blob/1693a9b5/src/java/org/apache/cassandra/streaming/PendingFile.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/streaming/PendingFile.java b/src/java/org/apache/cassandra/streaming/PendingFile.java index 8aa4b41..6576943 100644 --- a/src/java/org/apache/cassandra/streaming/PendingFile.java +++ b/src/java/org/apache/cassandra/streaming/PendingFile.java @@ -113,12 +113,11 @@ public class PendingFile dos.writeInt(sc.sections.size()); for (Pair<Long,Long> section : sc.sections) { - dos.writeLong(section.left); dos.writeLong(section.right); + dos.writeLong(section.left); + dos.writeLong(section.right); } - if (version > MessagingService.VERSION_07) - dos.writeUTF(sc.type.name()); - if (version > MessagingService.VERSION_080) - dos.writeLong(sc.estimatedKeys); + dos.writeUTF(sc.type.name()); + dos.writeLong(sc.estimatedKeys); } public PendingFile deserialize(DataInput dis, int version) throws IOException @@ -135,11 +134,8 @@ public class PendingFile sections.add(new Pair<Long,Long>(Long.valueOf(dis.readLong()), Long.valueOf(dis.readLong()))); // this controls the way indexes are rebuilt when streaming in. OperationType type = OperationType.RESTORE_REPLICA_COUNT; - if (version > MessagingService.VERSION_07) - type = OperationType.valueOf(dis.readUTF()); - long estimatedKeys = 0; - if (version > MessagingService.VERSION_080) - estimatedKeys = dis.readLong(); + type = OperationType.valueOf(dis.readUTF()); + long estimatedKeys = dis.readLong(); return new PendingFile(null, desc, component, sections, type, estimatedKeys); } @@ -153,10 +149,8 @@ public class PendingFile size += TypeSizes.NATIVE.sizeof(pf.sections.size()); for (Pair<Long,Long> section : pf.sections) size += TypeSizes.NATIVE.sizeof(section.left) + TypeSizes.NATIVE.sizeof(section.right); - if (version > MessagingService.VERSION_07) - size += TypeSizes.NATIVE.sizeof(pf.type.name()); - if (version > MessagingService.VERSION_080) - size += TypeSizes.NATIVE.sizeof(pf.estimatedKeys); + size += TypeSizes.NATIVE.sizeof(pf.type.name()); + size += TypeSizes.NATIVE.sizeof(pf.estimatedKeys); return size; } } http://git-wip-us.apache.org/repos/asf/cassandra/blob/1693a9b5/src/java/org/apache/cassandra/streaming/StreamRequest.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/streaming/StreamRequest.java b/src/java/org/apache/cassandra/streaming/StreamRequest.java index 3a08202..2b62692 100644 --- a/src/java/org/apache/cassandra/streaming/StreamRequest.java +++ b/src/java/org/apache/cassandra/streaming/StreamRequest.java @@ -132,15 +132,11 @@ public class StreamRequest for (Range<Token> range : srm.ranges) AbstractBounds.serializer.serialize(range, dos, version); - if (version > MessagingService.VERSION_07) - dos.writeUTF(srm.type.name()); - - if (version > MessagingService.VERSION_080) - { - dos.writeInt(Iterables.size(srm.columnFamilies)); - for (ColumnFamilyStore cfs : srm.columnFamilies) - dos.writeInt(cfs.metadata.cfId); - } + dos.writeUTF(srm.type.name()); + + dos.writeInt(Iterables.size(srm.columnFamilies)); + for (ColumnFamilyStore cfs : srm.columnFamilies) + dos.writeInt(cfs.metadata.cfId); } } @@ -162,16 +158,12 @@ public class StreamRequest for( int i = 0; i < size; ++i ) ranges.add((Range<Token>) AbstractBounds.serializer.deserialize(dis, version).toTokenBounds()); OperationType type = OperationType.RESTORE_REPLICA_COUNT; - if (version > MessagingService.VERSION_07) - type = OperationType.valueOf(dis.readUTF()); + type = OperationType.valueOf(dis.readUTF()); List<ColumnFamilyStore> stores = new ArrayList<ColumnFamilyStore>(); - if (version > MessagingService.VERSION_080) - { - int cfsSize = dis.readInt(); - for (int i = 0; i < cfsSize; ++i) - stores.add(Table.open(table).getColumnFamilyStore(dis.readInt())); - } + int cfsSize = dis.readInt(); + for (int i = 0; i < cfsSize; ++i) + stores.add(Table.open(table).getColumnFamilyStore(dis.readInt())); return new StreamRequest(target, ranges, table, stores, sessionId, type); } @@ -189,14 +181,10 @@ public class StreamRequest size += TypeSizes.NATIVE.sizeof(sr.ranges.size()); for (Range<Token> range : sr.ranges) size += AbstractBounds.serializer.serializedSize(range, version); - if (version > MessagingService.VERSION_07) - size += TypeSizes.NATIVE.sizeof(sr.type.name()); - if (version > MessagingService.VERSION_080) - { - size += TypeSizes.NATIVE.sizeof(Iterables.size(sr.columnFamilies)); - for (ColumnFamilyStore cfs : sr.columnFamilies) - size += TypeSizes.NATIVE.sizeof(cfs.metadata.cfId); - } + size += TypeSizes.NATIVE.sizeof(sr.type.name()); + size += TypeSizes.NATIVE.sizeof(Iterables.size(sr.columnFamilies)); + for (ColumnFamilyStore cfs : sr.columnFamilies) + size += TypeSizes.NATIVE.sizeof(cfs.metadata.cfId); return size; } }
