cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject [3/6] cassandra git commit: Fix sstabledump handling of partition-level deletions
Date Fri, 03 Feb 2017 19:13:41 GMT
Fix sstabledump handling of partition-level deletions

Patch by Tyler Hobbs; reviewed by Yuki Morishita for CASSANDRA-13177


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

Branch: refs/heads/trunk
Commit: 883c9f0f743139d78996f5faf191508a9be338b5
Parents: a70b0d4
Author: Tyler Hobbs <tylerlhobbs@gmail.com>
Authored: Fri Feb 3 13:12:33 2017 -0600
Committer: Tyler Hobbs <tylerlhobbs@gmail.com>
Committed: Fri Feb 3 13:12:33 2017 -0600

----------------------------------------------------------------------
 CHANGES.txt                                         |  2 ++
 .../org/apache/cassandra/tools/JsonTransformer.java | 16 +++++++---------
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/883c9f0f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ade3d5a..dc10e1f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 3.0.11
+ * Fix handling of partition with partition-level deletion plus
+   live rows in sstabledump (CASSANDRA-13177)
  * Provide user workaround when system_schema.columns does not contain entries
    for a table that's in system_schema.tables (CASSANDRA-13180)
  * Dump threads when unit tests time out (CASSANDRA-13117)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/883c9f0f/src/java/org/apache/cassandra/tools/JsonTransformer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/JsonTransformer.java b/src/java/org/apache/cassandra/tools/JsonTransformer.java
index 590e527..0a72583 100644
--- a/src/java/org/apache/cassandra/tools/JsonTransformer.java
+++ b/src/java/org/apache/cassandra/tools/JsonTransformer.java
@@ -191,20 +191,18 @@ public final class JsonTransformer
             json.writeNumberField("position", this.currentScanner.getCurrentPosition());
 
             if (!partition.partitionLevelDeletion().isLive())
-            {
                 serializeDeletion(partition.partitionLevelDeletion());
-                json.writeEndObject();
-            }
-            else
+
+            json.writeEndObject();
+
+            if (partition.hasNext() || partition.staticRow() != null)
             {
-                json.writeEndObject();
                 json.writeFieldName("rows");
                 json.writeStartArray();
                 updatePosition();
                 if (!partition.staticRow().isEmpty())
-                {
                     serializeRow(partition.staticRow());
-                }
+
                 Unfiltered unfiltered;
                 updatePosition();
                 while (partition.hasNext())
@@ -221,9 +219,9 @@ public final class JsonTransformer
                     updatePosition();
                 }
                 json.writeEndArray();
-            }
 
-            json.writeEndObject();
+                json.writeEndObject();
+            }
         }
         catch (IOException e)
         {


Mime
View raw message