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()
CircuitBreaker
getMetrics
in interface CircuitBreaker
public boolean allowRequest()
CircuitBreaker
allowRequest
in interface CircuitBreaker
public void recordAttemptSuccess()
CircuitBreaker
recordAttemptSuccess
in interface CircuitBreaker
public void recordAttemptFailure()
CircuitBreaker
recordAttemptFailure
in interface CircuitBreaker
public boolean attemptExecution()
CircuitBreaker
attemptExecution
in interface CircuitBreaker
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2024 PingCAP. All rights reserved.