poorbarcode commented on code in PR #21946:
URL: https://github.com/apache/pulsar/pull/21946#discussion_r1536578927
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractReplicator.java:
##########
@@ -64,10 +70,35 @@ public abstract class AbstractReplicator {
protected static final AtomicReferenceFieldUpdater<AbstractReplicator,
State> STATE_UPDATER =
AtomicReferenceFieldUpdater.newUpdater(AbstractReplicator.class,
State.class, "state");
- private volatile State state = State.Stopped;
-
- protected enum State {
- Stopped, Starting, Started, Stopping
+ @VisibleForTesting
+ @Getter
+ protected volatile State state = State.Stopped;
+
+ public enum State {
+ /**
+ * This enum has two mean meanings:Init, Stopped.
+ * Regarding the meaning "Stopped", only {@link
PersistentTopic#checkGC} will call {@link #disconnect},
+ * so this method only be used by {@link PersistentTopic#checkGC}
now.
+ * TODO After improving the method {@link #disconnect)}, we should
rename "Stopped" to "Init".
+ */
+ // The internal producer is stopped.
+ Stopped,
+ // Trying to create a new internal producer.
+ Starting,
+ // The internal producer has started, and tries copy data.
+ Started,
+ /**
+ * @Deprecated Only {@link PersistentTopic#checkGC} will call {@link
#disconnect}, so this method only be
+ * used by {@link PersistentTopic#checkGC} now.
+ * TODO After improving the method {@link #disconnect)}, this enum
should be removed.
+ */
+ @Deprecated
+ // The internal producer is trying to stop.
+ Stopping,
Review Comment:
Renamed
--
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]