cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [2/3] cassandra git commit: Remove default method AbstractRow.isEmpty
Date Wed, 12 Aug 2015 12:55:44 GMT
Remove default method AbstractRow.isEmpty

Replacing it with one more efficient concrete
implementation in BTreeRow

patch by benedict; reviewed by snazy for CASSANDRA-9926


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

Branch: refs/heads/trunk
Commit: 0be8cb665248982ea9a1f773d845cea926dd683f
Parents: 4623aa6
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Tue Aug 4 08:24:20 2015 +0100
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Wed Aug 12 14:55:00 2015 +0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/rows/AbstractRow.java    | 7 -------
 src/java/org/apache/cassandra/db/rows/BTreeBackedRow.java | 9 +++++++--
 2 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0be8cb66/src/java/org/apache/cassandra/db/rows/AbstractRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/rows/AbstractRow.java b/src/java/org/apache/cassandra/db/rows/AbstractRow.java
index 807d805..6090274 100644
--- a/src/java/org/apache/cassandra/db/rows/AbstractRow.java
+++ b/src/java/org/apache/cassandra/db/rows/AbstractRow.java
@@ -49,13 +49,6 @@ public abstract class AbstractRow implements Row
         return Iterables.any(cells(), cell -> cell.isLive(nowInSec));
     }
 
-    public boolean isEmpty()
-    {
-        return primaryKeyLivenessInfo().isEmpty()
-            && deletion().isLive()
-            && !iterator().hasNext();
-    }
-
     public boolean isStatic()
     {
         return clustering() == Clustering.STATIC_CLUSTERING;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0be8cb66/src/java/org/apache/cassandra/db/rows/BTreeBackedRow.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/rows/BTreeBackedRow.java b/src/java/org/apache/cassandra/db/rows/BTreeBackedRow.java
index 2e0d320..548fb82 100644
--- a/src/java/org/apache/cassandra/db/rows/BTreeBackedRow.java
+++ b/src/java/org/apache/cassandra/db/rows/BTreeBackedRow.java
@@ -42,8 +42,6 @@ import org.apache.cassandra.utils.btree.UpdateFunction;
  */
 public class BTreeBackedRow extends AbstractRow
 {
-    private static final ColumnData[] NO_DATA = new ColumnData[0];
-
     private static final long EMPTY_SIZE = ObjectSizes.measure(emptyRow(Clustering.EMPTY));
 
     private final Clustering clustering;
@@ -171,6 +169,13 @@ public class BTreeBackedRow extends AbstractRow
         return primaryKeyLivenessInfo;
     }
 
+    public boolean isEmpty()
+    {
+        return primaryKeyLivenessInfo().isEmpty()
+               && deletion().isLive()
+               && BTree.isEmpty(btree);
+    }
+
     public DeletionTime deletion()
     {
         return deletion;


Mime
View raw message