cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject git commit: fix build post-rebase
Date Mon, 08 Apr 2013 18:36:06 GMT
Updated Branches:
  refs/heads/trunk 220a828b7 -> 4902bdc7b


fix build post-rebase


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

Branch: refs/heads/trunk
Commit: 4902bdc7b97d8f514724ebf1ccb2598f8e69d64d
Parents: 220a828
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Mon Apr 8 13:36:04 2013 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Mon Apr 8 13:36:04 2013 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   10 +++++-----
 src/java/org/apache/cassandra/db/DataTracker.java  |   10 +++++-----
 .../db/compaction/AbstractCompactionTask.java      |    9 ++++-----
 .../cassandra/db/compaction/CompactionManager.java |   14 +++++++-------
 .../cassandra/db/compaction/CompactionTask.java    |    4 ++--
 .../compaction/SizeTieredCompactionStrategy.java   |    2 +-
 6 files changed, 24 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4902bdc7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index fe6dca0..516fcd6 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -1894,15 +1894,15 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         }
     }
 
-    public Collection<SSTableReader> markAllCompacting()
+    public Iterable<SSTableReader> markAllCompacting()
     {
-        Callable<Collection<SSTableReader>> callable = new Callable<Collection<SSTableReader>>()
+        Callable<Iterable<SSTableReader>> callable = new Callable<Iterable<SSTableReader>>()
         {
-            public Collection<SSTableReader> call() throws Exception
+            public Iterable<SSTableReader> call() throws Exception
             {
                 assert data.getCompacting().isEmpty() : data.getCompacting();
-                Collection<SSTableReader> sstables = AbstractCompactionStrategy.filterSuspectSSTables(getSSTables());
-                if (sstables.isEmpty())
+                Iterable<SSTableReader> sstables = AbstractCompactionStrategy.filterSuspectSSTables(getSSTables());
+                if (Iterables.isEmpty(sstables))
                     return null;
                 boolean success = data.markCompacting(sstables);
                 assert success : "something marked things compacting while compactions are
disabled";

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4902bdc7/src/java/org/apache/cassandra/db/DataTracker.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DataTracker.java b/src/java/org/apache/cassandra/db/DataTracker.java
index 8cc78b4..27c0480 100644
--- a/src/java/org/apache/cassandra/db/DataTracker.java
+++ b/src/java/org/apache/cassandra/db/DataTracker.java
@@ -186,13 +186,13 @@ public class DataTracker
      * unmarkCompacting, but since we will never call markCompacted on a sstable marked
      * as compacting (unless there is a serious bug), we can skip this.
      */
-    public boolean markCompacting(Collection<SSTableReader> sstables)
+    public boolean markCompacting(Iterable<SSTableReader> sstables)
     {
-        assert sstables != null && !sstables.isEmpty();
+        assert sstables != null && !Iterables.isEmpty(sstables);
 
         View currentView = view.get();
         Set<SSTableReader> inactive = Sets.difference(ImmutableSet.copyOf(sstables),
currentView.compacting);
-        if (inactive.size() < sstables.size())
+        if (inactive.size() < Iterables.size(sstables))
             return false;
 
         View newView = currentView.markCompacting(inactive);
@@ -203,7 +203,7 @@ public class DataTracker
      * Removes files from compacting status: this is different from 'markCompacted'
      * because it should be run regardless of whether a compaction succeeded.
      */
-    public void unmarkCompacting(Collection<SSTableReader> unmark)
+    public void unmarkCompacting(Iterable<SSTableReader> unmark)
     {
         if (!cfstore.isValid())
         {
@@ -533,7 +533,7 @@ public class DataTracker
             return new View(memtable, memtablesPendingFlush, sstables, compactingNew, intervalTree);
         }
 
-        public View unmarkCompacting(Collection<SSTableReader> tounmark)
+        public View unmarkCompacting(Iterable<SSTableReader> tounmark)
         {
             Set<SSTableReader> compactingNew = ImmutableSet.copyOf(Sets.difference(compacting,
ImmutableSet.copyOf(tounmark)));
             return new View(memtable, memtablesPendingFlush, sstables, compactingNew, intervalTree);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4902bdc7/src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java b/src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java
index b592655..a4c101f 100644
--- a/src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/AbstractCompactionTask.java
@@ -17,19 +17,18 @@
  */
 package org.apache.cassandra.db.compaction;
 
-import java.util.Collection;
 import java.util.Set;
 
-import org.apache.cassandra.db.Directories;
-import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Directories;
 import org.apache.cassandra.db.compaction.CompactionManager.CompactionExecutorStatsCollector;
+import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.io.util.DiskAwareRunnable;
 
 public abstract class AbstractCompactionTask extends DiskAwareRunnable
 {
     protected final ColumnFamilyStore cfs;
-    protected Collection<SSTableReader> sstables;
+    protected Iterable<SSTableReader> sstables;
     protected boolean isUserDefined;
     protected OperationType compactionType;
 
@@ -37,7 +36,7 @@ public abstract class AbstractCompactionTask extends DiskAwareRunnable
      * @param cfs
      * @param sstables must be marked compacting
      */
-    public AbstractCompactionTask(ColumnFamilyStore cfs, Collection<SSTableReader>
sstables)
+    public AbstractCompactionTask(ColumnFamilyStore cfs, Iterable<SSTableReader> sstables)
     {
         this.cfs = cfs;
         this.sstables = sstables;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4902bdc7/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index 21bbb8e..64cf253 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -177,12 +177,12 @@ public class CompactionManager implements CompactionManagerMBean
 
     private static interface AllSSTablesOperation
     {
-        public void perform(ColumnFamilyStore store, Collection<SSTableReader> sstables)
throws IOException;
+        public void perform(ColumnFamilyStore store, Iterable<SSTableReader> sstables)
throws IOException;
     }
 
     private void performAllSSTableOperation(final ColumnFamilyStore cfs, final AllSSTablesOperation
operation) throws InterruptedException, ExecutionException
     {
-        final Collection<SSTableReader> sstables = cfs.markAllCompacting();
+        final Iterable<SSTableReader> sstables = cfs.markAllCompacting();
         if (sstables == null)
             return;
 
@@ -202,7 +202,7 @@ public class CompactionManager implements CompactionManagerMBean
     {
         performAllSSTableOperation(cfStore, new AllSSTablesOperation()
         {
-            public void perform(ColumnFamilyStore store, Collection<SSTableReader>
sstables) throws IOException
+            public void perform(ColumnFamilyStore store, Iterable<SSTableReader> sstables)
throws IOException
             {
                 doScrub(store, sstables);
             }
@@ -213,7 +213,7 @@ public class CompactionManager implements CompactionManagerMBean
     {
         performAllSSTableOperation(cfStore, new AllSSTablesOperation()
         {
-            public void perform(ColumnFamilyStore cfs, Collection<SSTableReader> sstables)
+            public void perform(ColumnFamilyStore cfs, Iterable<SSTableReader> sstables)
             {
                 for (final SSTableReader sstable : sstables)
                 {
@@ -235,11 +235,11 @@ public class CompactionManager implements CompactionManagerMBean
     {
         performAllSSTableOperation(cfStore, new AllSSTablesOperation()
         {
-            public void perform(ColumnFamilyStore store, Collection<SSTableReader>
sstables) throws IOException
+            public void perform(ColumnFamilyStore store, Iterable<SSTableReader> sstables)
throws IOException
             {
                 // Sort the column families in order of SSTable size, so cleanup of smaller
CFs
                 // can free up space for larger ones
-                List<SSTableReader> sortedSSTables = new ArrayList<SSTableReader>(sstables);
+                List<SSTableReader> sortedSSTables = Lists.newArrayList(sstables);
                 Collections.sort(sortedSSTables, new SSTableReader.SizeComparator());
 
                 doCleanupCompaction(store, sortedSSTables, renewer);
@@ -385,7 +385,7 @@ public class CompactionManager implements CompactionManagerMBean
      *
      * @throws IOException
      */
-    private void doScrub(ColumnFamilyStore cfs, Collection<SSTableReader> sstables)
throws IOException
+    private void doScrub(ColumnFamilyStore cfs, Iterable<SSTableReader> sstables) throws
IOException
     {
         assert !cfs.isIndex();
         for (final SSTableReader sstable : sstables)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4902bdc7/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index 9befb52..8c4a102 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@ -41,11 +41,11 @@ public class CompactionTask extends AbstractCompactionTask
     private Set<SSTableReader> toCompact;
     private CompactionExecutorStatsCollector collector;
 
-    public CompactionTask(ColumnFamilyStore cfs, Collection<SSTableReader> sstables,
final int gcBefore)
+    public CompactionTask(ColumnFamilyStore cfs, Iterable<SSTableReader> sstables,
final int gcBefore)
     {
         super(cfs, sstables);
         this.gcBefore = gcBefore;
-        toCompact = new HashSet<SSTableReader>(sstables);
+        toCompact = Sets.newHashSet(sstables);
     }
 
     public static synchronized long addToTotalBytesCompacted(long bytesCompacted)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4902bdc7/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
index 6a35094..844720f 100644
--- a/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/SizeTieredCompactionStrategy.java
@@ -152,7 +152,7 @@ public class SizeTieredCompactionStrategy extends AbstractCompactionStrategy
 
     public AbstractCompactionTask getMaximalTask(final int gcBefore)
     {
-        Collection<SSTableReader> sstables = cfs.markAllCompacting();
+        Iterable<SSTableReader> sstables = cfs.markAllCompacting();
         if (sstables == null)
             return null;
 


Mime
View raw message