public interface QueueCircuitBreakerStorage
QueueCircuitBreaker.| Modifier and Type | Method and Description |
|---|---|
io.vertx.core.Future<Void> |
closeAllCircuits()
Closes all non-closed circuits.
|
io.vertx.core.Future<Void> |
closeAndRemoveCircuit(PatternAndCircuitHash patternAndCircuitHash)
Closes the circuit and removes all circuit information from storage.
|
io.vertx.core.Future<Void> |
closeCircuit(PatternAndCircuitHash patternAndCircuitHash)
Closes the circuit.
|
io.vertx.core.Future<io.vertx.core.json.JsonObject> |
getAllCircuits()
Get the information (status, failRatio and circuit) of all circuits.
|
io.vertx.core.Future<io.vertx.core.json.JsonObject> |
getQueueCircuitInformation(String circuitHash)
Get the information (status, failRatio and circuit) of the circuit represented by the provided circuitHash.
|
io.vertx.core.Future<QueueCircuitState> |
getQueueCircuitState(PatternAndCircuitHash patternAndCircuitHash)
Get the actual
QueueCircuitState of the provided patternAndCircuitHash object. |
io.vertx.core.Future<QueueCircuitState> |
getQueueCircuitState(String circuitHash)
Get the actual
QueueCircuitState of the provided circuitHash. |
io.vertx.core.Future<Void> |
lockQueue(String queueName,
PatternAndCircuitHash patternAndCircuitHash)
Mark the queueName as a locked queue of the circuit representing the provided patternAndCircuitHash.
|
io.vertx.core.Future<String> |
popQueueToUnlock()
Get the next queue to unlock.
|
io.vertx.core.Future<Void> |
reOpenCircuit(PatternAndCircuitHash patternAndCircuitHash)
Re-Opens the (half-open) circuit again.
|
io.vertx.core.Future<Long> |
setOpenCircuitsToHalfOpen()
Changes the status of all circuits having a status equals
QueueCircuitState.OPEN
to QueueCircuitState.HALF_OPEN. |
io.vertx.core.Future<List<String>> |
unlockSampleQueues()
Get a list of sample queues of all circuits having a status equals
QueueCircuitState.HALF_OPEN. |
io.vertx.core.Future<UpdateStatisticsResult> |
updateStatistics(PatternAndCircuitHash patternAndCircuitHash,
String uniqueRequestID,
long timestamp,
int errorThresholdPercentage,
long entriesMaxAgeMS,
long minQueueSampleCount,
long maxQueueSampleCount,
QueueResponseType queueResponseType)
Updates the statistics of the corresponding circuit based on the provided patternAndCircuitHash.
|
io.vertx.core.Future<QueueCircuitState> getQueueCircuitState(PatternAndCircuitHash patternAndCircuitHash)
QueueCircuitState of the provided patternAndCircuitHash object. When no circuit could be
found in the storage, QueueCircuitState.CLOSED is returned.patternAndCircuitHash - circuit informationQueueCircuitState or QueueCircuitState.CLOSED when no circuit was foundio.vertx.core.Future<QueueCircuitState> getQueueCircuitState(String circuitHash)
QueueCircuitState of the provided circuitHash. When no circuit could be found in the
storage, QueueCircuitState.CLOSED is returned.circuitHash - the hash representing the circuitQueueCircuitState or QueueCircuitState.CLOSED when no circuit was foundio.vertx.core.Future<io.vertx.core.json.JsonObject> getQueueCircuitInformation(String circuitHash)
circuitHash - the hash representing the circuit to get the informations fromJsonObject containing the information of the circuitio.vertx.core.Future<io.vertx.core.json.JsonObject> getAllCircuits()
JsonObject containing the information of all circuitsio.vertx.core.Future<UpdateStatisticsResult> updateStatistics(PatternAndCircuitHash patternAndCircuitHash, String uniqueRequestID, long timestamp, int errorThresholdPercentage, long entriesMaxAgeMS, long minQueueSampleCount, long maxQueueSampleCount, QueueResponseType queueResponseType)
Updates the statistics of the corresponding circuit based on the provided patternAndCircuitHash.
Updating the statistics includes the following steps:
QueueResponseType.FAILUREQueueResponseType.SUCCESSpatternAndCircuitHash - the information of the circuituniqueRequestID - the unique identifier of the queued requesttimestamp - the current timestamperrorThresholdPercentage - the threshold to change status to 'OPEN' when reachedentriesMaxAgeMS - the maximum age of fail/success records to respect to calculate the failRatiominQueueSampleCount - the minimum amount of records (unique uniqueRequestIDs) to reach before status can be changedmaxQueueSampleCount - the maximum amount of fail/success records to keepqueueResponseType - the QueueResponseType representing the execution result of the queuedRequestUpdateStatisticsResult object representing the result of the statistics updateio.vertx.core.Future<Void> lockQueue(String queueName, PatternAndCircuitHash patternAndCircuitHash)
queueName - the name of the queuepatternAndCircuitHash - the information of the circuitio.vertx.core.Future<String> popQueueToUnlock()
null when no queue was foundio.vertx.core.Future<Void> closeCircuit(PatternAndCircuitHash patternAndCircuitHash)
Closes the circuit.
Closing the circuit includes the following steps:
patternAndCircuitHash - the information of the circuitio.vertx.core.Future<Void> closeAndRemoveCircuit(PatternAndCircuitHash patternAndCircuitHash)
patternAndCircuitHash - the information of the circuitio.vertx.core.Future<Void> closeAllCircuits()
Closes all non-closed circuits.
Closing all non-closed circuits includes the following steps:
io.vertx.core.Future<Void> reOpenCircuit(PatternAndCircuitHash patternAndCircuitHash)
patternAndCircuitHash - the information of the circuitio.vertx.core.Future<Long> setOpenCircuitsToHalfOpen()
QueueCircuitState.OPEN
to QueueCircuitState.HALF_OPEN.io.vertx.core.Future<List<String>> unlockSampleQueues()
QueueCircuitState.HALF_OPEN. The sample
queues are always the queues which have not been unlocked the longest. Each sample queue of each circuit is then
updated to be the 'most recently' unlocked queue.Copyright © 2016–2019. All rights reserved.