Github user michaelsembwever commented on the pull request:
https://github.com/apache/cassandra/commit/ba09523de7cad3b3732c0e7e60b072f84e809e21#commitcomment-28005488
In src/java/org/apache/cassandra/dht/BootstrapEvent.java:
In src/java/org/apache/cassandra/dht/BootstrapEvent.java on line 62:
out of curiosity:
could we go one step further to avoid the static methods in the event
classes as well?
For example putting `DiagnosticEventService.instance()` into a member field
in an "events" class which holds the existing static util methods, and in the
peer classes that use the events class instantiate and keep an instance.
Something like:
```
public class BootstrapEvents // this could also be named
"BootstrapEventUtil"
{
private final DiagnosticEventService service;
BootstrapEvent()
{
this.service = DiagnosticEventService.instance();
}
@VisibleForTesting
BootstrapEvent(DiagnosticEventService service)
{
this.service = service;
}
â¦
private static class BootstrapEvent extends DiagnosticEvent
{
private final BootstrapEventType type;
private final TokenMetadata tokenMetadata;
private final InetAddressAndPort address;
private final String allocationKeyspace;
private final Integer numTokens;
private final Collection<Token> tokens;
private BootstrapEvent(BootstrapEventType type, InetAddressAndPort
address, TokenMetadata tokenMetadata,
String allocationKeyspace, int numTokens,
ImmutableCollection<Token> tokens)
{
â¦
}
}
```
and
```
public class BootStrapper extends ProgressEventNotifierSupport
{
â¦
private final BoostrapEvents bootstrapEvents = BootstrapEvents();
â¦
bootstrapEvents.useSpecifiedTokens(â¦);
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]