xkrogen commented on code in PR #4209:
URL: https://github.com/apache/hadoop/pull/4209#discussion_r1035381835
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournaledEditsCache.java:
##########
@@ -123,8 +125,14 @@ class JournaledEditsCache {
JournaledEditsCache(Configuration conf) {
float fraction =
conf.getFloat(DFSConfigKeys.DFS_JOURNALNODE_EDIT_CACHE_SIZE_FRACTION_KEY,
DFSConfigKeys.DFS_JOURNALNODE_EDIT_CACHE_SIZE_FRACTION_DEFAULT);
+ if (fraction <= 0 || fraction >= 1.0f) {
+ terminate(1, new IllegalArgumentException(String.format(
Review Comment:
`terminate()` seems too strong to me; I would expect that we just use
`Preconditions.checkArgument()` to throw an exception. This is used elsewhere
to validate config values, e.g. in `FSDirectory` constructor and
`HAUtil.getNameNodeIdOfOtherNodes()`.
--
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]