cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject [1/3] cassandra git commit: Ninja: reinstate @Deprecated getUserDefinedTask removed by mistake
Date Fri, 08 Dec 2017 18:49:53 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.11 25e46f052 -> 16bcbb925
  refs/heads/trunk 29a0d1f82 -> 78150142e


Ninja: reinstate @Deprecated getUserDefinedTask removed by mistake


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

Branch: refs/heads/cassandra-3.11
Commit: 16bcbb9256392dc5364f2bd592f45649080935dc
Parents: 25e46f0
Author: Paulo Motta <pauloricardomg@gmail.com>
Authored: Sat Dec 9 05:47:34 2017 +1100
Committer: Paulo Motta <paulo@apache.org>
Committed: Sat Dec 9 05:48:46 2017 +1100

----------------------------------------------------------------------
 .../db/compaction/CompactionStrategyManager.java | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/16bcbb92/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java
index 4103433..efaedc8 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionStrategyManager.java
@@ -862,11 +862,19 @@ public class CompactionStrategyManager implements INotificationConsumer
      */
     public List<AbstractCompactionTask> getUserDefinedTasks(Collection<SSTableReader>
sstables, int gcBefore)
     {
+        return getUserDefinedTasks(sstables, gcBefore, false);
+    }
+
+    public List<AbstractCompactionTask> getUserDefinedTasks(Collection<SSTableReader>
sstables, int gcBefore, boolean validateForCompaction)
+    {
         maybeReloadDiskBoundaries();
         List<AbstractCompactionTask> ret = new ArrayList<>();
         readLock.lock();
         try
         {
+            if (validateForCompaction)
+                validateForCompaction(sstables);
+
             Map<Integer, List<SSTableReader>> repairedSSTables = sstables.stream()
                                                                          .filter(s ->
!s.isMarkedSuspect() && s.isRepaired())
                                                                          .collect(Collectors.groupingBy((s)
-> compactionStrategyIndexFor(s)));
@@ -890,6 +898,17 @@ public class CompactionStrategyManager implements INotificationConsumer
         }
     }
 
+    /**
+     * @deprecated use {@link #getUserDefinedTasks(Collection, int)} instead.
+     */
+    @Deprecated()
+    public AbstractCompactionTask getUserDefinedTask(Collection<SSTableReader> sstables,
int gcBefore)
+    {
+        List<AbstractCompactionTask> tasks = getUserDefinedTasks(sstables, gcBefore,
true);
+        assert tasks.size() == 1;
+        return tasks.get(0);
+    }
+
     public int getEstimatedRemainingTasks()
     {
         maybeReloadDiskBoundaries();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message