cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject [4/4] cassandra git commit: Properly deserialize PrepareMessage for global repairs
Date Mon, 07 Sep 2015 06:19:26 GMT
Properly deserialize PrepareMessage for global repairs

Patch by marcuse; reviewed by yukim for CASSANDRA-10265


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

Branch: refs/heads/cassandra-2.2
Commit: dae2045f0b444f4857141463335893becaa05a89
Parents: 99c6ad6
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Fri Sep 4 10:20:31 2015 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Mon Sep 7 08:04:52 2015 +0200

----------------------------------------------------------------------
 NEWS.txt                                                |  4 ++++
 .../cassandra/repair/messages/PrepareMessage.java       | 12 ++++++++++--
 .../apache/cassandra/repair/messages/RepairMessage.java |  2 +-
 3 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/dae2045f/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index 2523af2..4c2c52e 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -22,6 +22,10 @@ Changed Defaults
    - commitlog_total_space_in_mb will use the smaller of 8192, and 1/4
      of the total space of the commitlog volume. (Before: always used
      8192)
+   - Incremental repair is on by default since 2.2.0, run full repairs by
+     providing the '-full' parameter to nodetool repair.
+   - Parallel repairs are the default since 2.2.0, run sequential repairs
+     by providing the '-seq' parameter to nodetool repair.
 
 
 2.2.1

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dae2045f/src/java/org/apache/cassandra/repair/messages/PrepareMessage.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/repair/messages/PrepareMessage.java b/src/java/org/apache/cassandra/repair/messages/PrepareMessage.java
index a57c27e..3a00376 100644
--- a/src/java/org/apache/cassandra/repair/messages/PrepareMessage.java
+++ b/src/java/org/apache/cassandra/repair/messages/PrepareMessage.java
@@ -34,7 +34,8 @@ import org.apache.cassandra.utils.UUIDSerializer;
 
 public class PrepareMessage extends RepairMessage
 {
-    public final static MessageSerializer serializer = new PrepareMessageSerializer();
+    public final static MessageSerializer serializer = new PrepareMessageSerializer(false);
+    public final static MessageSerializer globalSerializer = new PrepareMessageSerializer(true);
     public final List<UUID> cfIds;
     public final Collection<Range<Token>> ranges;
 
@@ -52,6 +53,13 @@ public class PrepareMessage extends RepairMessage
 
     public static class PrepareMessageSerializer implements MessageSerializer<PrepareMessage>
     {
+        private final boolean isGlobal;
+
+        public PrepareMessageSerializer(boolean global)
+        {
+            this.isGlobal = global;
+        }
+
         public void serialize(PrepareMessage message, DataOutputPlus out, int version) throws
IOException
         {
             out.writeInt(message.cfIds.size());
@@ -80,7 +88,7 @@ public class PrepareMessage extends RepairMessage
                 ranges.add((Range<Token>) Range.tokenSerializer.deserialize(in, MessagingService.globalPartitioner(),
version));
             boolean isIncremental = in.readBoolean();
 
-            return new PrepareMessage(parentRepairSession, cfIds, ranges, isIncremental,
false);
+            return new PrepareMessage(parentRepairSession, cfIds, ranges, isIncremental,
isGlobal);
         }
 
         public long serializedSize(PrepareMessage message, int version)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/dae2045f/src/java/org/apache/cassandra/repair/messages/RepairMessage.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/repair/messages/RepairMessage.java b/src/java/org/apache/cassandra/repair/messages/RepairMessage.java
index d78c2fd..82e474f 100644
--- a/src/java/org/apache/cassandra/repair/messages/RepairMessage.java
+++ b/src/java/org/apache/cassandra/repair/messages/RepairMessage.java
@@ -45,7 +45,7 @@ public abstract class RepairMessage
         SYNC_COMPLETE(3, SyncComplete.serializer),
         ANTICOMPACTION_REQUEST(4, AnticompactionRequest.serializer),
         PREPARE_MESSAGE(5, PrepareMessage.serializer),
-        PREPARE_GLOBAL_MESSAGE(8, PrepareMessage.serializer),
+        PREPARE_GLOBAL_MESSAGE(8, PrepareMessage.globalSerializer),
         SNAPSHOT(6, SnapshotMessage.serializer),
         CLEANUP(7, CleanupMessage.serializer);
 


Mime
View raw message