ayushtkn commented on code in PR #4339:
URL: https://github.com/apache/hadoop/pull/4339#discussion_r882775991
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/qjournal/server/TestJournalNode.java:
##########
@@ -672,4 +676,26 @@ private void setupStaticHostResolution(int
journalNodeCount,
}
}
+ @Test
+ public void testConfNormalHandlerNumber() {
+ int confHandlerNumber = jn.getConf().getInt(
+ DFSConfigKeys.DFS_JOURNALNODE_HANDLER_COUNT_KEY,
+ DFSConfigKeys.DFS_JOURNALNODE_HANDLER_COUNT_DEFAULT);
+ Assert.assertTrue(confHandlerNumber > 0);
Review Comment:
Assert. isn't required there is already a static import in the class.
Same for all the other statements
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNodeRpcServer.java:
##########
@@ -90,13 +92,25 @@ public class JournalNodeRpcServer implements
QJournalProtocol,
new QJournalProtocolServerSideTranslatorPB(this);
BlockingService service = QJournalProtocolService
.newReflectiveBlockingService(translator);
+ int confHandler = conf.getInt(DFS_JOURNALNODE_HANDLER_COUNT_KEY,
+ DFS_JOURNALNODE_HANDLER_COUNT_DEFAULT);
+ if (confHandler <= 0) {
+ LOG.warn("Unexpected configuration parameters: {} = {} <= 0," +
+ " and will use default value {}.",
+ DFS_JOURNALNODE_HANDLER_COUNT_KEY, confHandler,
+ DFS_JOURNALNODE_HANDLER_COUNT_DEFAULT);
+ confHandler = DFS_JOURNALNODE_HANDLER_COUNT_DEFAULT;
Review Comment:
Change to
```
LOG.warn("Invalid value for: {} = {}, Should be > 0,"
+ " will use default value of: {}.",
DFS_JOURNALNODE_HANDLER_COUNT_KEY, confHandler,
DFS_JOURNALNODE_HANDLER_COUNT_DEFAULT);
```
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNodeRpcServer.java:
##########
@@ -63,9 +65,9 @@
public class JournalNodeRpcServer implements QJournalProtocol,
InterQJournalProtocol {
private static final Logger LOG = JournalNode.LOG;
- private static final int HANDLER_COUNT = 5;
private final JournalNode jn;
private Server server;
+ private final int handlerNumber;
Review Comment:
can you change the variable name to ``handlerCount`` and the method to
``getHandlerCount() ``
--
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]