You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/06/01 13:18:51 UTC
[GitHub] [ratis] codings-dan opened a new pull request, #652: RATIS-1588. Add a constructor of RaftStorageImpl for forward compatibility
codings-dan opened a new pull request, #652:
URL: https://github.com/apache/ratis/pull/652
see https://issues.apache.org/jira/projects/RATIS/issues/RATIS-1588
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a constructor of RaftStorageImpl for forward compatibility
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1148246722
@szetszwo I have added a RaftStorage.Builder, PTAL again, thx!
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo commented on pull request #652: RATIS-1588. Add a constructor of RaftStorageImpl for forward compatibility
Posted by GitBox <gi...@apache.org>.
szetszwo commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1144352259
@codings-dan , sorry that it broke Alluxio. RaftStorageImpl is not a public API so that we do not have to maintain compatibility. We may consider adding a RaftStorage.Builder as a public API.
BTW, this is backward compatibility -- a new version of the software works for the existing applications. Forward compatibility means the current design of the software can work on future applications.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1157632606
> The test failure seems related. Could you take a look
This is caused by improper handling of exceptions in reflection,I have fixed it.
> let's remove the public RaftStorageImpl constructor below since it is no longer used.
I have remove the extra code.
> let's use SizeInBytes for storageFreeSpaceMin
Done.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo commented on pull request #652: RATIS-1588. Add a constructor of RaftStorageImpl for forward compatibility
Posted by GitBox <gi...@apache.org>.
szetszwo commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1144352260
@codings-dan , sorry that it broke Alluxio. RaftStorageImpl is not a public API so that we do not have to maintain compatibility. We may consider adding a RaftStorage.Builder as a public API.
BTW, this is backward compatibility -- a new version of the software works for the existing applications. Forward compatibility means the current design of the software can work on future applications.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on a diff in pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on code in PR #652:
URL: https://github.com/apache/ratis/pull/652#discussion_r895710195
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public Builder setLogCorruptionPolicy(CorruptionPolicy logCorruptionPolicy) {
+ this.logCorruptionPolicy = logCorruptionPolicy;
+ return this;
+ }
+
+ public Builder setOption(StartupOption option) {
+ this.option = option;
+ return this;
+ }
+
+ public Builder setStorageFeeSpaceMin(long storageFeeSpaceMin) {
+ this.storageFeeSpaceMin = storageFeeSpaceMin;
+ return this;
+ }
+
+ public RaftStorageImpl build() throws IOException {
+ return new RaftStorageImpl(dir, logCorruptionPolicy, option, storageFeeSpaceMin);
Review Comment:
done
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1157633024
@szetszwo Thanks for help review the code, PTAL, thx!
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
szetszwo commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1159020263
#635 should be able to reduce the timeout problem. @codings-dan , could you review it?
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo commented on a diff in pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
szetszwo commented on code in PR #652:
URL: https://github.com/apache/ratis/pull/652#discussion_r891622724
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
Review Comment:
The Builder should be moved to RaftStorage so that it will be in raft-server-api.
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public Builder setLogCorruptionPolicy(CorruptionPolicy logCorruptionPolicy) {
+ this.logCorruptionPolicy = logCorruptionPolicy;
+ return this;
+ }
+
+ public Builder setOption(StartupOption option) {
+ this.option = option;
+ return this;
+ }
+
+ public Builder setStorageFeeSpaceMin(long storageFeeSpaceMin) {
Review Comment:
Let's call it setFreeSpaceMin. BTW, there is a TYPO: "Fee" should "Free".
Also, let's use SizeInBytes for the parameter.
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public Builder setLogCorruptionPolicy(CorruptionPolicy logCorruptionPolicy) {
+ this.logCorruptionPolicy = logCorruptionPolicy;
+ return this;
+ }
+
+ public Builder setOption(StartupOption option) {
+ this.option = option;
+ return this;
+ }
+
+ public Builder setStorageFeeSpaceMin(long storageFeeSpaceMin) {
+ this.storageFeeSpaceMin = storageFeeSpaceMin;
+ return this;
+ }
+
+ public RaftStorageImpl build() throws IOException {
+ return new RaftStorageImpl(dir, logCorruptionPolicy, option, storageFeeSpaceMin);
Review Comment:
After moved to raft-server-api, we have to use reflection to call the constructor. See RaftServer.Builder as an example.
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public Builder setLogCorruptionPolicy(CorruptionPolicy logCorruptionPolicy) {
+ this.logCorruptionPolicy = logCorruptionPolicy;
+ return this;
+ }
+
+ public Builder setOption(StartupOption option) {
Review Comment:
We should move StartupOption from RaftStorageImpl to RaftStorage so that it becomes a public API.
Also, let's add a new StartupOption.RECOVER instead of using null.
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
Review Comment:
Let's rename it to setDirectory.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1158489622
The ci test error seems have noting to do with this code change.
https://github.com/apache/ratis/runs/6930404226?check_suite_focus=true#step:5:611
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo merged pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
szetszwo merged PR #652:
URL: https://github.com/apache/ratis/pull/652
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1159057332
> #635 should be able to reduce the timeout problem. @codings-dan , could you review it?
Of course, happy to help review the code!
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
szetszwo commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1157759300
@codings-dan , thanks for the update. TestRaftStorage failed. Please take a look.
https://github.com/apache/ratis/runs/6920545804?check_suite_focus=true#step:5:562
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
szetszwo commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1155394043
@codings-dan , The test failure seems related. Could you take a look?
BTW, let's remove the public RaftStorageImpl constructor below since it is no longer used.
```
public RaftStorageImpl(File dir, CorruptionPolicy logCorruptionPolicy,
long storageFeeSpaceMin) throws IOException {
```
Also, let's use SizeInBytes for storageFreeSpaceMin? Or, we may have two setStorageFreeSpaceMin methods.
```
public Builder setStorageFreeSpaceMin(SizeInBytes storageFreeSpaceMin) {
this.storageFreeSpaceMin = storageFreeSpaceMin.getSize();
return this;
}
public Builder setStorageFreeSpaceMin(long storageFreeSpaceMin) {
this.storageFreeSpaceMin = storageFreeSpaceMin;
return this;
}
```
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1158560639
https://github.com/apache/ratis/runs/6931402074?check_suite_focus=true#step:5:611
This unit test can run locally, see as below

--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] szetszwo commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
szetszwo commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1158491436
Sure, let's restart the failed jobs.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on a diff in pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on code in PR #652:
URL: https://github.com/apache/ratis/pull/652#discussion_r895709944
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public Builder setLogCorruptionPolicy(CorruptionPolicy logCorruptionPolicy) {
+ this.logCorruptionPolicy = logCorruptionPolicy;
+ return this;
+ }
+
+ public Builder setOption(StartupOption option) {
+ this.option = option;
+ return this;
+ }
+
+ public Builder setStorageFeeSpaceMin(long storageFeeSpaceMin) {
Review Comment:
done
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on a diff in pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on code in PR #652:
URL: https://github.com/apache/ratis/pull/652#discussion_r895710383
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public Builder setLogCorruptionPolicy(CorruptionPolicy logCorruptionPolicy) {
+ this.logCorruptionPolicy = logCorruptionPolicy;
+ return this;
+ }
+
+ public Builder setOption(StartupOption option) {
Review Comment:
done
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
+ private File dir;
+ private CorruptionPolicy logCorruptionPolicy;
+ private StartupOption option;
+ private long storageFeeSpaceMin;
+
+ public Builder setDir(File dir) {
Review Comment:
done
##########
ratis-server/src/main/java/org/apache/ratis/server/storage/RaftStorageImpl.java:
##########
@@ -41,6 +41,41 @@ public enum StartupOption {
FORMAT
}
+ public static Builder newBuilder() {
+ return new RaftStorageImpl.Builder();
+ }
+
+ public static class Builder {
Review Comment:
done
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1153909602
@szetszwo PTAL again, thank you!
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a builder of RaftStorageImpl
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1158443045
> TestRaftStorage failed.
Similar to the previous ut error, it was caused by improper handling of exceptions in reflection, I have fixed it
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a constructor of RaftStorageImpl for forward compatibility
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1143651020
@szetszwo Can you help review this pull request, 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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ratis] codings-dan commented on pull request #652: RATIS-1588. Add a constructor of RaftStorageImpl for forward compatibility
Posted by GitBox <gi...@apache.org>.
codings-dan commented on PR #652:
URL: https://github.com/apache/ratis/pull/652#issuecomment-1144795429
> We may consider adding a RaftStorage.Builder as a public API.
Good idea, I will add a RaftStorage.Builder.
> a new version of the software works for the existing applications. Forward compatibility means the current design of the software can work on future applications
Thanks for telling me about these, I now understand the difference!
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org