Skip to content

Commit cf938ac

Browse files
committed
spotless
1 parent bdd3cc9 commit cf938ac

File tree

6 files changed

+31
-26
lines changed

6 files changed

+31
-26
lines changed

hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientAsyncPrefetchScanner.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ public class ClientAsyncPrefetchScanner extends ClientSimpleScanner {
6565
public ClientAsyncPrefetchScanner(Configuration configuration, Scan scan, TableName name,
6666
ClusterConnection connection, RpcRetryingCallerFactory rpcCallerFactory,
6767
RpcControllerFactory rpcControllerFactory, ExecutorService pool, int scanReadRpcTimeout,
68-
int scannerTimeout, int replicaCallTimeoutMicroSecondScan, ConnectionConfiguration connectionConfiguration,
69-
Map<String, byte[]> requestAttributes) throws IOException {
68+
int scannerTimeout, int replicaCallTimeoutMicroSecondScan,
69+
ConnectionConfiguration connectionConfiguration, Map<String, byte[]> requestAttributes)
70+
throws IOException {
7071
super(configuration, scan, name, connection, rpcCallerFactory, rpcControllerFactory, pool,
71-
scanReadRpcTimeout, scannerTimeout, replicaCallTimeoutMicroSecondScan, connectionConfiguration, requestAttributes);
72+
scanReadRpcTimeout, scannerTimeout, replicaCallTimeoutMicroSecondScan,
73+
connectionConfiguration, requestAttributes);
7274
exceptionsQueue = new ConcurrentLinkedQueue<>();
7375
final Context context = Context.current();
7476
final Runnable runnable = context.wrap(new PrefetchRunnable());

hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.apache.commons.lang3.mutable.MutableBoolean;
3434
import org.apache.hadoop.conf.Configuration;
3535
import org.apache.hadoop.hbase.DoNotRetryIOException;
36-
import org.apache.hadoop.hbase.HConstants;
3736
import org.apache.hadoop.hbase.HRegionInfo;
3837
import org.apache.hadoop.hbase.NotServingRegionException;
3938
import org.apache.hadoop.hbase.TableName;
@@ -105,8 +104,8 @@ public abstract class ClientScanner extends AbstractClientScanner {
105104
public ClientScanner(final Configuration conf, final Scan scan, final TableName tableName,
106105
ClusterConnection connection, RpcRetryingCallerFactory rpcFactory,
107106
RpcControllerFactory controllerFactory, ExecutorService pool, int scanReadRpcTimeout,
108-
int scannerTimeout, int primaryOperationTimeout, ConnectionConfiguration connectionConfiguration,
109-
Map<String, byte[]> requestAttributes)
107+
int scannerTimeout, int primaryOperationTimeout,
108+
ConnectionConfiguration connectionConfiguration, Map<String, byte[]> requestAttributes)
110109
throws IOException {
111110
if (LOG.isTraceEnabled()) {
112111
LOG.trace(

hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientSimpleScanner.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ public ClientSimpleScanner(Configuration configuration, Scan scan, TableName nam
3939
ClusterConnection connection, RpcRetryingCallerFactory rpcCallerFactory,
4040
RpcControllerFactory rpcControllerFactory, ExecutorService pool, int scanReadRpcTimeout,
4141
int scannerTimeout, int replicaCallTimeoutMicroSecondScan,
42-
ConnectionConfiguration connectionConfiguration, Map<String, byte[]> requestAttributes) throws IOException {
42+
ConnectionConfiguration connectionConfiguration, Map<String, byte[]> requestAttributes)
43+
throws IOException {
4344
super(configuration, scan, name, connection, rpcCallerFactory, rpcControllerFactory, pool,
44-
scanReadRpcTimeout, scannerTimeout, replicaCallTimeoutMicroSecondScan, connectionConfiguration, requestAttributes);
45+
scanReadRpcTimeout, scannerTimeout, replicaCallTimeoutMicroSecondScan,
46+
connectionConfiguration, requestAttributes);
4547
}
4648

4749
@Override

hbase-client/src/main/java/org/apache/hadoop/hbase/client/ConnectionConfiguration.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ public class ConnectionConfiguration {
164164
HConstants.DEFAULT_HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD);
165165

166166
this.metaScanTimeout = conf.getInt(HBASE_CLIENT_META_SCANNER_TIMEOUT, scanTimeout);
167-
this.useScannerTimeoutForNextCalls = conf.getBoolean(HBASE_CLIENT_USE_SCANNER_TIMEOUT_FOR_NEXT_CALLS, HBASE_CLIENT_USE_SCANNER_TIMEOUT_FOR_NEXT_CALLS_DEFAULT);
167+
this.useScannerTimeoutForNextCalls =
168+
conf.getBoolean(HBASE_CLIENT_USE_SCANNER_TIMEOUT_FOR_NEXT_CALLS,
169+
HBASE_CLIENT_USE_SCANNER_TIMEOUT_FOR_NEXT_CALLS_DEFAULT);
168170

169171
long pauseMs = conf.getLong(HBASE_CLIENT_PAUSE, DEFAULT_HBASE_CLIENT_PAUSE);
170172
long pauseMsForServerOverloaded = conf.getLong(HBASE_CLIENT_PAUSE_FOR_SERVER_OVERLOADED,

hbase-client/src/main/java/org/apache/hadoop/hbase/client/ReversedClientScanner.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ public class ReversedClientScanner extends ClientScanner {
4040
public ReversedClientScanner(Configuration conf, Scan scan, TableName tableName,
4141
ClusterConnection connection, RpcRetryingCallerFactory rpcFactory,
4242
RpcControllerFactory controllerFactory, ExecutorService pool, int scanReadRpcTimeout,
43-
int scannerTimeout, int primaryOperationTimeout, ConnectionConfiguration connectionConfiguration,
44-
Map<String, byte[]> requestAttributes)
43+
int scannerTimeout, int primaryOperationTimeout,
44+
ConnectionConfiguration connectionConfiguration, Map<String, byte[]> requestAttributes)
4545
throws IOException {
4646
super(conf, scan, tableName, connection, rpcFactory, controllerFactory, pool,
47-
scanReadRpcTimeout, scannerTimeout, primaryOperationTimeout, connectionConfiguration, requestAttributes);
47+
scanReadRpcTimeout, scannerTimeout, primaryOperationTimeout, connectionConfiguration,
48+
requestAttributes);
4849
}
4950

5051
@Override

hbase-client/src/main/java/org/apache/hadoop/hbase/client/ScannerCallableWithReplicas.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class ScannerCallableWithReplicas implements RetryingCallable<Result[]> {
7373

7474
public ScannerCallableWithReplicas(TableName tableName, ClusterConnection cConnection,
7575
ScannerCallable baseCallable, ExecutorService pool, int timeBeforeReplicas, Scan scan,
76-
int retries, int readRpcTimeout, int scannerTimeout, boolean useScannerTimeoutForNextCalls, int caching, Configuration conf,
77-
RpcRetryingCaller<Result[]> caller) {
76+
int retries, int readRpcTimeout, int scannerTimeout, boolean useScannerTimeoutForNextCalls,
77+
int caching, Configuration conf, RpcRetryingCaller<Result[]> caller) {
7878
this.currentScannerCallable = baseCallable;
7979
this.cConnection = cConnection;
8080
this.pool = pool;
@@ -331,24 +331,22 @@ public Cursor getCursor() {
331331
return currentScannerCallable != null ? currentScannerCallable.getCursor() : null;
332332
}
333333

334-
private void
335-
addCallsForCurrentReplica(ResultBoundedCompletionService<Pair<Result[], ScannerCallable>> cs, int rpcTimeout) {
334+
private void addCallsForCurrentReplica(
335+
ResultBoundedCompletionService<Pair<Result[], ScannerCallable>> cs, int rpcTimeout) {
336336
RetryingRPC retryingOnReplica = new RetryingRPC(currentScannerCallable);
337337
outstandingCallables.add(currentScannerCallable);
338338
cs.submit(retryingOnReplica, rpcTimeout, scannerTimeout, currentScannerCallable.id);
339339
}
340340

341341
/**
342342
* As we have a call sequence for scan, it is useless to have a different rpc timeout which is
343-
* less than the scan timeout. If the server does not respond in time(usually this will not
344-
* happen as we have heartbeat now), we will get an OutOfOrderScannerNextException when
345-
* resending the next request and the only way to fix this is to close the scanner and open a
346-
* new one.
347-
*
348-
* The legacy behavior of ScannerCallable has been to use readRpcTimeout despite the above. If
349-
* using legacy behavior, we always use that. If new behavior is enabled, we determine the rpc
350-
* timeout to use based on whether the scanner is open. If scanner is open, use scannerTimeout
351-
* otherwise use readRpcTimeout.
343+
* less than the scan timeout. If the server does not respond in time(usually this will not happen
344+
* as we have heartbeat now), we will get an OutOfOrderScannerNextException when resending the
345+
* next request and the only way to fix this is to close the scanner and open a new one. The
346+
* legacy behavior of ScannerCallable has been to use readRpcTimeout despite the above. If using
347+
* legacy behavior, we always use that. If new behavior is enabled, we determine the rpc timeout
348+
* to use based on whether the scanner is open. If scanner is open, use scannerTimeout otherwise
349+
* use readRpcTimeout.
352350
*/
353351
private int getRpcTimeout() {
354352
if (useScannerTimeoutForNextCalls) {
@@ -359,7 +357,8 @@ private int getRpcTimeout() {
359357
}
360358

361359
private void addCallsForOtherReplicas(
362-
ResultBoundedCompletionService<Pair<Result[], ScannerCallable>> cs, int min, int max, int rpcTimeout) {
360+
ResultBoundedCompletionService<Pair<Result[], ScannerCallable>> cs, int min, int max,
361+
int rpcTimeout) {
363362

364363
for (int id = min; id <= max; id++) {
365364
if (currentScannerCallable.id == id) {

0 commit comments

Comments
 (0)