public class CircuitBreakerImpl extends Object implements CircuitBreaker
CircuitBreaker.Status| Constructor and Description |
|---|
CircuitBreakerImpl(boolean enable,
int windowInSeconds,
int errorThresholdPercentage,
int requestVolumeThreshold,
int sleepWindowInSeconds,
int attemptRequestCount,
long clusterId) |
CircuitBreakerImpl(TiConfiguration conf,
long clusterId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowRequest()
Every requests asks this if it is allowed to proceed or not.
|
boolean |
attemptExecution()
Invoked at start of command execution to attempt an execution.
|
void |
close() |
CircuitBreakerMetrics |
getMetrics()
Get the Circuit Breaker Metrics Object.
|
void |
recordAttemptFailure()
Invoked on unsuccessful executions as part of feedback mechanism when in a half-open state.
|
void |
recordAttemptSuccess()
Invoked on successful executions as part of feedback mechanism when in a half-open state.
|
public CircuitBreakerImpl(TiConfiguration conf, long clusterId)
public CircuitBreakerImpl(boolean enable,
int windowInSeconds,
int errorThresholdPercentage,
int requestVolumeThreshold,
int sleepWindowInSeconds,
int attemptRequestCount,
long clusterId)
public CircuitBreakerMetrics getMetrics()
CircuitBreakergetMetrics in interface CircuitBreakerpublic boolean allowRequest()
CircuitBreakerallowRequest in interface CircuitBreakerpublic void recordAttemptSuccess()
CircuitBreakerrecordAttemptSuccess in interface CircuitBreakerpublic void recordAttemptFailure()
CircuitBreakerrecordAttemptFailure in interface CircuitBreakerpublic boolean attemptExecution()
CircuitBreakerattemptExecution in interface CircuitBreakerpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2025 PingCAP. All rights reserved.