maedhroz commented on code in PR #2660:
URL: https://github.com/apache/cassandra/pull/2660#discussion_r1318797162
##########
src/java/org/apache/cassandra/service/ActiveRepairService.java:
##########
@@ -150,28 +142,44 @@
@Simulate(with = MONITORS)
public class ActiveRepairService implements IEndpointStateChangeSubscriber,
IFailureDetectionEventListener, ActiveRepairServiceMBean
{
+
public enum ParentRepairStatus
{
IN_PROGRESS, COMPLETED, FAILED
}
- public static class ConsistentSessions
+ public class ConsistentSessions
{
- public final LocalSessions local = new LocalSessions();
- public final CoordinatorSessions coordinated = new
CoordinatorSessions();
+ public final LocalSessions local;
+ public final CoordinatorSessions coordinated;
+
+ public ConsistentSessions(SharedContext.RepairContext ctx)
+ {
+ local = new LocalSessions(ctx);
+ coordinated = new CoordinatorSessions(ctx);
+ }
}
- public final ConsistentSessions consistent = new ConsistentSessions();
+ public final ConsistentSessions consistent;
private boolean registeredForEndpointChanges = false;
private static final Logger logger =
LoggerFactory.getLogger(ActiveRepairService.class);
- // singleton enforcement
- public static final ActiveRepairService instance = new
ActiveRepairService(FailureDetector.instance, Gossiper.instance);
public static final long UNREPAIRED_SSTABLE = 0;
public static final TimeUUID NO_PENDING_REPAIR = null;
+ public static ActiveRepairService instance()
+ {
+ return Holder.instance;
+ }
+
+ private static class Holder
+ {
+ // singleton enforcement
Review Comment:
nit: Would be fine ditching this comment...we don't have a similar comment
using the same pattern elsewhere, etc.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]