echonesis commented on code in PR #9689:
URL: https://github.com/apache/ozone/pull/9689#discussion_r2780966499
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMSnapshotProvider.java:
##########
@@ -55,24 +55,111 @@ public class SCMSnapshotProvider {
private final CertificateClient scmCertificateClient;
+ /**
+ * Startup options for SCM snapshot provider.
+ */
+ public enum StartupOption {
+ /**
+ * FORMAT mode: Ratis snapshot directory should not exist.
+ * Will create and initialize a new Ratis snapshot directory.
+ */
+ FORMAT,
+ /**
+ * NORMAL mode: Ratis snapshot directory should already exist.
+ * Will read from existing Ratis snapshot directory.
+ */
+ NORMAL
+ }
+
+ /**
+ * Creates SCMSnapshotProvider with default NORMAL startup option.
+ * This constructor is used in most scenarios where the Ratis snapshot
+ * directory is expected to already exist.
+ *
+ * @param conf Configuration source
+ * @param peerNodes List of peer SCM nodes
+ * @param scmCertificateClient Certificate client for secure communication
+ */
public SCMSnapshotProvider(ConfigurationSource conf,
List<SCMNodeDetails> peerNodes,
CertificateClient scmCertificateClient) {
Review Comment:
The constructor is also used in
[SCMHAManagerImpl.java:99-101](https://github.com/apache/ozone/blob/master/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAManagerImpl.java#L99-L101)
via `newScmSnapshotProvider()` method. However, this method is marked as
`@VisibleForTesting`.
Do you mean we should refactor `SCMHAManagerImpl` to use dependency
injection, so that `TestSCMHAManagerImpl` can inject the mock
`SCMSnapshotProvider` directly instead of overriding `newScmSnapshotProvider()`?
--
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]