public class CircuitBreakerImpl extends Object implements CircuitBreaker
CircuitBreaker.Status| 构造器和说明 |
|---|
CircuitBreakerImpl(boolean enable,
int windowInSeconds,
int errorThresholdPercentage,
int requestVolumeThreshold,
int sleepWindowInSeconds,
int attemptRequestCount,
long clusterId) |
CircuitBreakerImpl(TiConfiguration conf,
long clusterId) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 CircuitBreakerpublic boolean allowRequest()
CircuitBreakerallowRequest 在接口中 CircuitBreakerpublic void recordAttemptSuccess()
CircuitBreakerrecordAttemptSuccess 在接口中 CircuitBreakerpublic void recordAttemptFailure()
CircuitBreakerrecordAttemptFailure 在接口中 CircuitBreakerpublic boolean attemptExecution()
CircuitBreakerattemptExecution 在接口中 CircuitBreakerpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2023 PingCAP. All rights reserved.