-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use commons module in server #272
Conversation
40350e5
to
b8092ec
Compare
b58d804
to
7ead1c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still reviewing, but these changes are not correct.
server/src/main/java/com/hedera/block/server/persistence/storage/PersistenceStorageConfig.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/hedera/block/server/persistence/storage/PersistenceStorageConfig.java
Outdated
Show resolved
Hide resolved
server/src/main/java/com/hedera/block/server/persistence/storage/PersistenceStorageConfig.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java
Outdated
Show resolved
Hide resolved
common/src/main/java/com/hedera/block/common/utils/FileUtilities.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the rest reviewed.
Let's chat about this code, as there are obviously some gaps in terms of understanding why some things are written the way they were.
server/src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriter.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java
Outdated
Show resolved
Hide resolved
server/src/test/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/com/hedera/block/server/persistence/storage/remove/BlockAsDirRemoverTest.java
Outdated
Show resolved
Hide resolved
@jsync-swirlds thanks for the reviews. Keep in mind that when I was doing these changes (as well as the ones in the simulator in the other PR), my aim was to only kind of 'redirect' all current usages of the utilities and constants to the new I have fixed the obvious and commented on the rest, but I agree, lets have a conversation in general about the topics here and others as well, since this would help me to gain more insight into the Hedera philosophy and the team's specific views on what we should aim for in terms of implementation and thought process. This will help avoid such big gaps and so many questions in the future. Thanks! :) |
I understand the intent. I think (as we discussed) that you would be better off (and the result will be better designed) to keep the shared library as clean as practical, and make whatever changes are needed in the server to correctly use that library. |
4d4f691
to
c611732
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nitpick, which could be addressed later.
server/src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReader.java
Outdated
Show resolved
Hide resolved
address this comment as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple items noted that should be addressed as a separate issue.
Please file issues for those prior to merging this PR.
e9ad93d
to
20b17c1
Compare
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
…ompile yet) Signed-off-by: Atanas Atanasov <[email protected]>
…ompile yet) Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
… thrown exception Signed-off-by: Atanas Atanasov <[email protected]>
Signed-off-by: Atanas Atanasov <[email protected]>
…with pr comments about test format Signed-off-by: Atanas Atanasov <[email protected]>
5241854
to
1cc7962
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #272 +/- ##
============================================
- Coverage 99.35% 98.88% -0.48%
+ Complexity 295 288 -7
============================================
Files 60 59 -1
Lines 1092 1077 -15
Branches 78 76 -2
============================================
- Hits 1085 1065 -20
- Misses 5 8 +3
- Partials 2 4 +2
|
Description:
:server
to start using logic from:common
Related issue(s):
Fixes #252
Notes for reviewer:
com.hedera.block.common.utils.FileUtilities#createPathIfNotExists
is used, the previous alternative usedFiles#createDirectory
, where the new version usesFiles#createDirectories
which acts quite differently, in fact, one unit test, namelytestProvidesBlockWriter_IOException
, which expects an exception to be thrown was not able to run successfully since it now creates the path using the new implementation withFiles#createDirectories
and previously it was not able to (the test is now modified). We should be careful about this since it is possible that the new usage could lead to silent bugs if unit tests do not already cover the needed edge cases.Checklist
com.hedera.block.server.Constants
removeapp.properties
andlogging.properties
and use them fromcom.hedera.block.common.constants.StringsConstants
;com.hedera.block.server.persistence.storage.FileUtils
and start usingcom.hedera.block.common.utils.FileUtilities
instead;