szetszwo commented on code in PR #667:
URL: https://github.com/apache/ratis/pull/667#discussion_r916171229


##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -38,30 +37,35 @@ public class RaftStorageImpl implements RaftStorage {
 
   // TODO support multiple storage directories
   private final RaftStorageDirectoryImpl storageDir;
-  private final StorageState state;
+  private final StartupOption startupOption;
   private final CorruptionPolicy logCorruptionPolicy;
+  private volatile StorageState state = StorageState.UNINITIALIZED;
   private volatile RaftStorageMetadataFileImpl metaFile;
 
   RaftStorageImpl(File dir, CorruptionPolicy logCorruptionPolicy, 
StartupOption option,
-      long storageFeeSpaceMin) throws IOException {
+      long storageFeeSpaceMin) {
     this.storageDir = new RaftStorageDirectoryImpl(dir, storageFeeSpaceMin);
-    if (option == StartupOption.FORMAT) {
+    this.logCorruptionPolicy = 
Optional.ofNullable(logCorruptionPolicy).orElseGet(CorruptionPolicy::getDefault);
+    this.startupOption = option;
+  }
+
+  @Override
+  public void initialize() throws IOException {

Review Comment:
   @lokeshj1703 , That's is a good idea!  Thanks.



-- 
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]

Reply via email to