cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/4] git commit: Merge branch 'cassandra-1.0' into cassandra-1.1
Date Wed, 08 Feb 2012 14:32:57 GMT
Updated Branches:
  refs/heads/cassandra-1.1 7108f3ed3 -> 1616f3fa4


Merge branch 'cassandra-1.0' into cassandra-1.1

Conflicts:
	src/java/org/apache/cassandra/db/filter/QueryFilter.java


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

Branch: refs/heads/cassandra-1.1
Commit: 1616f3fa467fc8014fb586e1c938ae65dee606a7
Parents: 7108f3e 2187530
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Feb 8 15:32:19 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Feb 8 15:32:19 2012 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        |   14 +------
 src/java/org/apache/cassandra/db/Column.java       |    5 ++
 .../org/apache/cassandra/db/ColumnFamilyStore.java |    2 +-
 src/java/org/apache/cassandra/db/IColumn.java      |    1 +
 src/java/org/apache/cassandra/db/SuperColumn.java  |   15 ++++++-
 .../apache/cassandra/db/filter/QueryFilter.java    |    2 +-
 .../apache/cassandra/db/RemoveSubColumnTest.java   |   34 +++++++++++++++
 7 files changed, 57 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/1616f3fa/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1616f3fa/src/java/org/apache/cassandra/db/Column.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1616f3fa/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1616f3fa/src/java/org/apache/cassandra/db/IColumn.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/IColumn.java
index 903fa12,fe6e949..864a9df
--- a/src/java/org/apache/cassandra/db/IColumn.java
+++ b/src/java/org/apache/cassandra/db/IColumn.java
@@@ -33,14 -33,10 +33,15 @@@ public interface IColum
  {
      public static final int MAX_NAME_LENGTH = FBUtilities.MAX_UNSIGNED_SHORT;
  
 +    /**
 +     * @return true if the column has been deleted (is a tombstone).  This depends on comparing
the server clock
 +     * with getLocalDeletionTime, so it can change during a single request if you're not
careful.
 +     */
      public boolean isMarkedForDelete();
 +
      public long getMarkedForDeleteAt();
      public long mostRecentLiveChangeAt();
+     public long mostRecentNonGCableChangeAt(int gcbefore);
      public ByteBuffer name();
      public int size();
      public int serializedSize();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1616f3fa/src/java/org/apache/cassandra/db/SuperColumn.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/SuperColumn.java
index bb482b2,75f166c..6efc93e
--- a/src/java/org/apache/cassandra/db/SuperColumn.java
+++ b/src/java/org/apache/cassandra/db/SuperColumn.java
@@@ -138,10 -140,15 +138,23 @@@ public class SuperColumn extends Abstra
  
      public long mostRecentLiveChangeAt()
      {
 -        return mostRecentNonGCableChangeAt(Integer.MAX_VALUE);
 +        long max = Long.MIN_VALUE;
 +        for (IColumn column : getSubColumns())
 +        {
-             if (!column.isMarkedForDelete() && column.timestamp() > max)
++            if (column.isMarkedForDelete() && column.timestamp() > max)
++            {
++                max = column.timestamp();
++            }
++        }
++        return max;
+     }
+ 
+     public long mostRecentNonGCableChangeAt(int gcbefore)
+     {
+         long max = Long.MIN_VALUE;
+         for (IColumn column : getSubColumns())
+         {
 -            if ((!column.isMarkedForDelete() || column.getLocalDeletionTime() >= gcbefore)
&& column.timestamp() > max)
++            if (column.getLocalDeletionTime() >= gcbefore && column.timestamp()
> max)
              {
                  max = column.timestamp();
              }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/1616f3fa/src/java/org/apache/cassandra/db/filter/QueryFilter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/filter/QueryFilter.java
index e647957,a2e9a95..b50e5d1
--- a/src/java/org/apache/cassandra/db/filter/QueryFilter.java
+++ b/src/java/org/apache/cassandra/db/filter/QueryFilter.java
@@@ -149,8 -154,8 +149,8 @@@ public class QueryFilte
          // the column itself must be not gc-able (it is live, or a still relevant tombstone,
or has live subcolumns), (1)
          // and if its container is deleted, the column must be changed more recently than
the container tombstone (2)
          // (since otherwise, the only thing repair cares about is the container tombstone)
-         long maxChange = column.mostRecentLiveChangeAt();
+         long maxChange = column.mostRecentNonGCableChangeAt(gcBefore);
 -        return (!column.isMarkedForDelete() || column.getLocalDeletionTime() >= gcBefore
|| maxChange > column.getMarkedForDeleteAt()) // (1)
 +        return (column.getLocalDeletionTime() >= gcBefore || maxChange > column.getMarkedForDeleteAt())
// (1)
                 && (!container.isMarkedForDelete() || maxChange > container.getMarkedForDeleteAt());
// (2)
      }
  


Mime
View raw message