Copilot commented on code in PR #8458:
URL: https://github.com/apache/hbase/pull/8458#discussion_r3579767228
##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionConfiguration.java:
##########
@@ -93,28 +102,27 @@ public class ConnectionConfiguration {
this.writeBufferPeriodicFlushTimerTickMs = conf.getLong(
WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS,
WRITE_BUFFER_PERIODIC_FLUSH_TIMERTICK_MS_DEFAULT);
- this.metaOperationTimeout =
conf.getInt(HConstants.HBASE_CLIENT_META_OPERATION_TIMEOUT,
- conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,
- HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT));
-
- this.operationTimeout =
conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,
+ this.operationTimeout = getNonNegativeInt(conf,
HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,
HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT);
+ this.metaOperationTimeout = getNonNegativeInt(conf,
+ HConstants.HBASE_CLIENT_META_OPERATION_TIMEOUT, operationTimeout);
+
this.scannerCaching = conf.getInt(HConstants.HBASE_CLIENT_SCANNER_CACHING,
HConstants.DEFAULT_HBASE_CLIENT_SCANNER_CACHING);
this.scannerMaxResultSize =
conf.getLong(HConstants.HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE_KEY,
HConstants.DEFAULT_HBASE_CLIENT_SCANNER_MAX_RESULT_SIZE);
- this.primaryCallTimeoutMicroSecond =
- conf.getInt(PRIMARY_CALL_TIMEOUT_MICROSECOND,
PRIMARY_CALL_TIMEOUT_MICROSECOND_DEFAULT);
+ this.primaryCallTimeoutMicroSecond = getNonNegativeInt(conf,
PRIMARY_CALL_TIMEOUT_MICROSECOND,
+ PRIMARY_CALL_TIMEOUT_MICROSECOND_DEFAULT);
- this.replicaCallTimeoutMicroSecondScan =
- conf.getInt(PRIMARY_SCAN_TIMEOUT_MICROSECOND,
PRIMARY_SCAN_TIMEOUT_MICROSECOND_DEFAULT);
+ this.replicaCallTimeoutMicroSecondScan = getNonNegativeInt(conf,
PRIMARY_SCAN_TIMEOUT_MICROSECOND,
+ PRIMARY_SCAN_TIMEOUT_MICROSECOND_DEFAULT);
Review Comment:
These lines exceed the repository Checkstyle LineLength limit (100 chars),
which will fail the build. Please wrap the assignment so each line stays under
100 characters.
##########
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestConnectionConfiguration.java:
##########
@@ -44,4 +48,47 @@ public void testDefaultMetaOperationTimeout() {
assertEquals(clientOperationTimeoutMs, config.getMetaOperationTimeout());
}
+ @Test
+ public void testNegativeTimeoutsThrow() {
+ List<String> timeoutKeys =
Arrays.asList(HConstants.HBASE_CLIENT_META_OPERATION_TIMEOUT,
+ HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,
ConnectionConfiguration.PRIMARY_CALL_TIMEOUT_MICROSECOND,
+ ConnectionConfiguration.PRIMARY_SCAN_TIMEOUT_MICROSECOND,
+ HConstants.HBASE_CLIENT_META_REPLICA_SCAN_TIMEOUT,
HConstants.HBASE_RPC_TIMEOUT_KEY,
+ HConstants.HBASE_RPC_READ_TIMEOUT_KEY,
ConnectionConfiguration.HBASE_CLIENT_META_READ_RPC_TIMEOUT_KEY,
+ HConstants.HBASE_RPC_WRITE_TIMEOUT_KEY);
Review Comment:
This timeout key list currently creates >100 character lines, which violates
the repository Checkstyle LineLength rule and can fail CI. Please reformat the
Arrays.asList call to wrap each key onto its own line (or otherwise keep lines
<= 100 chars).
--
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]