cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject [2/3] git commit: merge from 1.0
Date Tue, 07 Feb 2012 15:20:15 GMT
merge from 1.0


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

Branch: refs/heads/trunk
Commit: e04e7698a317215d6e6a2902a2456c572c0e100c
Parents: 3459c38 5452883
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Tue Feb 7 18:13:43 2012 +0300
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Tue Feb 7 18:13:43 2012 +0300

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   20 +++++++++++++++
 .../cassandra/db/compaction/CompactionManager.java |   19 +++++---------
 .../apache/cassandra/db/index/SecondaryIndex.java  |    8 +++++-
 .../cassandra/db/index/SecondaryIndexManager.java  |   16 +++++++++++-
 .../apache/cassandra/db/index/keys/KeysIndex.java  |    5 +++
 6 files changed, 56 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e04e7698/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index c5073aa,0952ffd..afe695a
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@@ -1850,10 -1940,23 +1850,30 @@@ public class ColumnFamilyStore implemen
          return view.sstables.isEmpty() && view.memtable.getOperations() == 0 &&
view.memtablesPendingFlush.isEmpty();
      }
  
 +    private boolean isRowCacheEnabled()
 +    {
 +        return !(metadata.getCaching() == CFMetaData.Caching.NONE
 +              || metadata.getCaching() == CFMetaData.Caching.KEYS_ONLY
 +              || CacheService.instance.rowCache.getCapacity() == 0);
 +    }
++
+     /**
+      * Discard all SSTables that were created before given timestamp. Caller is responsible
to obtain compactionLock.
+      *
+      * @param truncatedAt The timestamp of the truncation
+      *                    (all SSTables before that timestamp are going be marked as compacted)
+      */
+     public void discardSSTables(long truncatedAt)
+     {
+         List<SSTableReader> truncatedSSTables = new ArrayList<SSTableReader>();
+ 
+         for (SSTableReader sstable : getSSTables())
+         {
+             if (!sstable.newSince(truncatedAt))
+                 truncatedSSTables.add(sstable);
+         }
+ 
+         if (!truncatedSSTables.isEmpty())
+             markCompacted(truncatedSSTables);
+     }
  }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e04e7698/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index c109b18,caaf6d2..c02aed2
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@@ -37,10 -37,9 +37,11 @@@ import org.apache.cassandra.concurrent.
  import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.config.Schema;
  import org.apache.cassandra.db.*;
 +import org.apache.cassandra.db.compaction.CompactionInfo.Holder;
+ import org.apache.cassandra.db.index.SecondaryIndex;
  import org.apache.cassandra.db.index.SecondaryIndexBuilder;
  import org.apache.cassandra.dht.Range;
 +import org.apache.cassandra.dht.Token;
  import org.apache.cassandra.io.sstable.*;
  import org.apache.cassandra.io.util.FileUtils;
  import org.apache.cassandra.io.util.RandomAccessReader;
@@@ -1173,14 -1155,4 +1168,14 @@@ public class CompactionManager implemen
              }
          }
      }
 -}
 +
 +    public void stopCompaction(String type)
 +    {
 +        OperationType operation = OperationType.valueOf(type);
 +        for (Holder holder : CompactionExecutor.getCompactions())
 +        {
 +            if (holder.getCompactionInfo().getTaskType() == operation)
 +                holder.stop();
 +        }
 +    }
- }
++}

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e04e7698/src/java/org/apache/cassandra/db/index/SecondaryIndex.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e04e7698/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e04e7698/src/java/org/apache/cassandra/db/index/keys/KeysIndex.java
----------------------------------------------------------------------


Mime
View raw message