cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edimitr...@apache.org
Subject [cassandra] branch trunk updated: Clean up repair code patch by Simon Zhou; reviewed by Ekaterina Dimitrova and Andrés de la Peña for CASSANDRA-13720
Date Wed, 18 Aug 2021 00:50:33 GMT
This is an automated email from the ASF dual-hosted git repository.

edimitrova pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new fd3eb4f  Clean up repair code patch by Simon Zhou; reviewed by Ekaterina Dimitrova
and Andrés de la Peña for CASSANDRA-13720
fd3eb4f is described below

commit fd3eb4fd9e930503c7149db5e90644857eb6e4d3
Author: Simon Zhou <zhouqingcun@gmail.com>
AuthorDate: Sun Aug 1 12:10:37 2021 -0700

    Clean up repair code
    patch by Simon Zhou; reviewed by Ekaterina Dimitrova and Andrés de la Peña for CASSANDRA-13720
---
 CHANGES.txt                                            |  1 +
 .../org/apache/cassandra/repair/RepairRunnable.java    | 18 ++++--------------
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index fd5c3ff..e813ab2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.1
+ * Clean up repair code (CASSANDRA-13720)
  * Background schedule to clean up orphaned hints files (CASSANDRA-16815)
  * Modify SecondaryIndexManager#indexPartition() to retrieve only columns for which indexes
are actually being built (CASSANDRA-16776)
  * Batch the token metadata update to improve the speed (CASSANDRA-15291)
diff --git a/src/java/org/apache/cassandra/repair/RepairRunnable.java b/src/java/org/apache/cassandra/repair/RepairRunnable.java
index 798ba5e..4f76a8d 100644
--- a/src/java/org/apache/cassandra/repair/RepairRunnable.java
+++ b/src/java/org/apache/cassandra/repair/RepairRunnable.java
@@ -309,7 +309,7 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
         traceState.enableActivityNotification(tag);
         for (ProgressListener listener : listeners)
             traceState.addProgressListener(listener);
-        Thread queryThread = createQueryThread(cmd, sessionId);
+        Thread queryThread = createQueryThread(sessionId);
         queryThread.setName("RepairTracePolling");
         queryThread.start();
         return traceState;
@@ -412,7 +412,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
         if (options.isPreview())
         {
             previewRepair(parentSession,
-                          creationTimeMillis,
                           neighborsAndRanges.filterCommonRanges(keyspace, cfnames),
                           neighborsAndRanges.participants,
                           cfnames);
@@ -420,7 +419,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
         else if (options.isIncremental())
         {
             incrementalRepair(parentSession,
-                              creationTimeMillis,
                               traceState,
                               neighborsAndRanges,
                               neighborsAndRanges.participants,
@@ -429,7 +427,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
         else
         {
             normalRepair(parentSession,
-                         creationTimeMillis,
                          traceState,
                          neighborsAndRanges.filterCommonRanges(keyspace, cfnames),
                          neighborsAndRanges.participants,
@@ -439,7 +436,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
 
     @SuppressWarnings("UnstableApiUsage")
     private void normalRepair(UUID parentSession,
-                              long startTime,
                               TraceState traceState,
                               List<CommonRange> commonRanges,
                               Set<InetAddressAndPort> preparedEndpoints,
@@ -485,7 +481,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
                             new RepairCompleteCallback(parentSession,
                                                        successfulRanges,
                                                        preparedEndpoints,
-                                                       startTime,
                                                        traceState,
                                                        hasFailure,
                                                        executor),
@@ -493,7 +488,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
     }
 
     private void incrementalRepair(UUID parentSession,
-                                   long startTime,
                                    TraceState traceState,
                                    NeighborsAndRanges neighborsAndRanges,
                                    Set<InetAddressAndPort> preparedEndpoints,
@@ -528,12 +522,11 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
             ranges.addAll(range);
         }
         Futures.addCallback(repairResult,
-                            new RepairCompleteCallback(parentSession, ranges, preparedEndpoints,
startTime, traceState, hasFailure, executor),
+                            new RepairCompleteCallback(parentSession, ranges, preparedEndpoints,
traceState, hasFailure, executor),
                             MoreExecutors.directExecutor());
     }
 
     private void previewRepair(UUID parentSession,
-                               long startTime,
                                List<CommonRange> commonRanges,
                                Set<InetAddressAndPort> preparedEndpoints,
                                String... cfnames)
@@ -569,7 +562,7 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
                     }
                     else
                     {
-                        message = (previewKind == PreviewKind.REPAIRED ? "Repaired data is
inconsistent\n" : "Preview complete\n") + summary.toString();
+                        message = (previewKind == PreviewKind.REPAIRED ? "Repaired data is
inconsistent\n" : "Preview complete\n") + summary;
                         RepairMetrics.previewFailures.inc();
                         if (previewKind == PreviewKind.REPAIRED)
                             maybeSnapshotReplicas(parentSession, keyspace, results);
@@ -727,7 +720,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
         final UUID parentSession;
         final Collection<Range<Token>> successfulRanges;
         final Set<InetAddressAndPort> preparedEndpoints;
-        final long startTime;
         final TraceState traceState;
         final AtomicBoolean hasFailure;
         final ExecutorService executor;
@@ -735,7 +727,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
         public RepairCompleteCallback(UUID parentSession,
                                       Collection<Range<Token>> successfulRanges,
                                       Set<InetAddressAndPort> preparedEndpoints,
-                                      long startTime,
                                       TraceState traceState,
                                       AtomicBoolean hasFailure,
                                       ExecutorService executor)
@@ -743,7 +734,6 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
             this.parentSession = parentSession;
             this.successfulRanges = successfulRanges;
             this.preparedEndpoints = preparedEndpoints;
-            this.startTime = startTime;
             this.traceState = traceState;
             this.hasFailure = hasFailure;
             this.executor = executor;
@@ -791,7 +781,7 @@ public class RepairRunnable implements Runnable, ProgressEventNotifier
         neighborRangeList.add(new CommonRange(endpoints, transEndpoints, ranges));
     }
 
-    private Thread createQueryThread(final int cmd, final UUID sessionId)
+    private Thread createQueryThread(final UUID sessionId)
     {
         return NamedThreadFactory.createThread(new WrappedRunnable()
         {

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


Mime
View raw message