ekaterinadimitrova2 commented on a change in pull request #896:
URL: https://github.com/apache/cassandra/pull/896#discussion_r577131697



##########
File path: src/java/org/apache/cassandra/service/ActiveRepairServiceMBean.java
##########
@@ -41,4 +41,13 @@
     public List<CompositeData> getRepairStats(List<String> schemaArgs, String 
rangeString);
     public List<CompositeData> getPendingStats(List<String> schemaArgs, String 
rangeString);
     public List<CompositeData> cleanupPending(List<String> schemaArgs, String 
rangeString, boolean force);
+
+    /**
+     * Each ongoing repair (incremental and non-incremental) is represented by 
a
+     * {@link ActiveRepairService.ParentRepairSession} entry in the {@link 
ActiveRepairService} cache.
+     * Returns the current number of ongoing repairs (the current number of 
cached entries).
+     *
+     * @return current size of the internal cache holding {@link 
ActiveRepairService.ParentRepairSession} instances
+     */
+    int parentRepairSessionCount();

Review comment:
       I think we should mention this exposure in the ticket

##########
File path: src/java/org/apache/cassandra/repair/RepairRunnable.java
##########
@@ -393,22 +393,23 @@ private void repair(String[] cfnames, NeighborsAndRanges 
neighborsAndRanges)
     {
         if (options.isPreview())
         {
-            previewRepair(parentSession, creationTimeMillis, 
neighborsAndRanges.filterCommonRanges(keyspace, cfnames), cfnames);
+            previewRepair(parentSession, creationTimeMillis, 
neighborsAndRanges.filterCommonRanges(keyspace, cfnames), 
neighborsAndRanges.participants ,cfnames);

Review comment:
       Correct space: `previewRepair(parentSession, creationTimeMillis, 
neighborsAndRanges.filterCommonRanges(keyspace, cfnames), 
neighborsAndRanges.participants, cfnames);`

##########
File path: src/java/org/apache/cassandra/repair/RepairRunnable.java
##########
@@ -393,22 +393,23 @@ private void repair(String[] cfnames, NeighborsAndRanges 
neighborsAndRanges)
     {
         if (options.isPreview())
         {
-            previewRepair(parentSession, creationTimeMillis, 
neighborsAndRanges.filterCommonRanges(keyspace, cfnames), cfnames);
+            previewRepair(parentSession, creationTimeMillis, 
neighborsAndRanges.filterCommonRanges(keyspace, cfnames), 
neighborsAndRanges.participants ,cfnames);
         }
         else if (options.isIncremental())
         {
-            incrementalRepair(parentSession, creationTimeMillis, traceState, 
neighborsAndRanges, cfnames);
+            incrementalRepair(parentSession, creationTimeMillis, traceState, 
neighborsAndRanges, neighborsAndRanges.participants, cfnames);
         }
         else
         {
-            normalRepair(parentSession, creationTimeMillis, traceState, 
neighborsAndRanges.filterCommonRanges(keyspace, cfnames), cfnames);
+            normalRepair(parentSession, creationTimeMillis, traceState, 
neighborsAndRanges.filterCommonRanges(keyspace, cfnames), 
neighborsAndRanges.participants, cfnames);
         }
     }
 
     private void normalRepair(UUID parentSession,
                               long startTime,
                               TraceState traceState,
                               List<CommonRange> commonRanges,
+                              Set<InetAddressAndPort> cleanupEndpoints,

Review comment:
       I would keep it `preparedEndpoints`

##########
File path: src/java/org/apache/cassandra/repair/RepairRunnable.java
##########
@@ -699,6 +706,7 @@ public void onSuccess(Object result)
             else
             {
                 success("Repair completed successfully");
+                ActiveRepairService.instance.cleanUp(parentSession, 
cleanupEndpoints);

Review comment:
       Why not remove the parentSession too?
   `ActiveRepairService.instance.removeParentRepairSession(parentSession);`
   Is it considered change of behavior? 
   /CC @adelapena 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to