static class ConnectionImplementation.ServerErrorTracker extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
ConnectionImplementation.ServerErrorTracker.ServerErrors
The record of errors for a server.
|
Modifier and Type | Field and Description |
---|---|
private long |
canRetryUntil |
private ConcurrentMap<ServerName,ConnectionImplementation.ServerErrorTracker.ServerErrors> |
errorsByServer |
private int |
maxTries |
private long |
startTrackingTime |
Constructor and Description |
---|
ServerErrorTracker(long timeout,
int maxTries)
Constructor
|
Modifier and Type | Method and Description |
---|---|
(package private) long |
calculateBackoffTime(ServerName server,
long basePause)
Calculates the back-off time for a retrying request to a particular server.
|
(package private) boolean |
canTryMore(int numAttempt)
We stop to retry when we have exhausted BOTH the number of tries and the time allocated.
|
(package private) long |
getStartTrackingTime() |
(package private) void |
reportServerError(ServerName server)
Reports that there was an error on the server to do whatever bean-counting necessary.
|
private final ConcurrentMap<ServerName,ConnectionImplementation.ServerErrorTracker.ServerErrors> errorsByServer
private final long canRetryUntil
private final int maxTries
private final long startTrackingTime
public ServerErrorTracker(long timeout, int maxTries)
timeout
- how long to wait before timeout, in unit of millisecondmaxTries
- how many times to tryboolean canTryMore(int numAttempt)
numAttempt
- how many times we have tried by nowlong calculateBackoffTime(ServerName server, long basePause)
server
- The server in question.basePause
- The default hci pause.void reportServerError(ServerName server)
server
- The server in question.long getStartTrackingTime()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.