Copilot commented on code in PR #7267:
URL: https://github.com/apache/hbase/pull/7267#discussion_r2315771883


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java:
##########
@@ -1867,8 +1867,16 @@ public void abortProcess() {
     configurationManager.registerObserver(procEnv);
 
     int cpus = Runtime.getRuntime().availableProcessors();
-    final int numThreads = 
conf.getInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, Math.max(
-      (cpus > 0 ? cpus / 4 : 0), 
MasterProcedureConstants.DEFAULT_MIN_MASTER_PROCEDURE_THREADS));
+    int defaultNumThreads = Math.max((cpus > 0 ? cpus / 4 : 0),
+      MasterProcedureConstants.DEFAULT_MIN_MASTER_PROCEDURE_THREADS);
+    int numThreads =
+      conf.getInt(MasterProcedureConstants.MASTER_PROCEDURE_THREADS, 
defaultNumThreads);
+    if (numThreads <= 0) {
+      LOG.warn(MasterProcedureConstants.MASTER_PROCEDURE_THREADS
+        + " is set to {}, which is invalid, " + "using default value {} 
instead", numThreads,
+        defaultNumThreads);

Review Comment:
   The string concatenation with + operator mixed with parameterized logging is 
inconsistent and harder to read. Consider using fully parameterized logging: 
`LOG.warn("{} is set to {}, which is invalid, using default value {} instead", 
MasterProcedureConstants.MASTER_PROCEDURE_THREADS, numThreads, 
defaultNumThreads);`
   ```suggestion
         LOG.warn("{} is set to {}, which is invalid, using default value {} 
instead",
           MasterProcedureConstants.MASTER_PROCEDURE_THREADS, numThreads, 
defaultNumThreads);
   ```



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