Package io.grpc.internal
Class ExponentialBackoffPolicy
java.lang.Object
io.grpc.internal.ExponentialBackoffPolicy
- All Implemented Interfaces:
BackoffPolicy
Retry Policy for Transport reconnection. Initial parameters from
https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md
TODO(carl-mastrangelo): add unit tests for this class
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate doubleprivate longprivate doubleprivate longprivate Random -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of nanoseconds to wait.(package private) ExponentialBackoffPolicysetInitialBackoffNanos(long initialBackoffNanos) (package private) ExponentialBackoffPolicysetJitter(double jitter) (package private) ExponentialBackoffPolicysetMaxBackoffNanos(long maxBackoffNanos) (package private) ExponentialBackoffPolicysetMultiplier(double multiplier) (package private) ExponentialBackoffPolicyprivate longuniformRandom(double low, double high)
-
Field Details
-
random
-
initialBackoffNanos
private long initialBackoffNanos -
maxBackoffNanos
private long maxBackoffNanos -
multiplier
private double multiplier -
jitter
private double jitter -
nextBackoffNanos
private long nextBackoffNanos
-
-
Constructor Details
-
ExponentialBackoffPolicy
public ExponentialBackoffPolicy()
-
-
Method Details
-
nextBackoffNanos
public long nextBackoffNanos()Description copied from interface:BackoffPolicyReturns the number of nanoseconds to wait.- Specified by:
nextBackoffNanosin interfaceBackoffPolicy
-
uniformRandom
private long uniformRandom(double low, double high) -
setRandom
-
setInitialBackoffNanos
-
setMaxBackoffNanos
-
setMultiplier
-
setJitter
-