class RedisQueueCircuitBreakerStorage implements QueueCircuitBreakerStorage {

    @Override
    public Future<JsonObject> getQueueCircuitInformation(String circuitHash) {
        Future<JsonObject> future = Future.future();
        List<String> fields = Arrays.asList(FIELD_STATE, FIELD_FAILRATIO, FIELD_CIRCUIT);
        redisClient.hmget(buildInfosKey(circuitHash), fields, event -> {
            if(event.failed()){
                future.fail(event.cause());
            } else {
                try {
                    QueueCircuitState state = QueueCircuitState.fromString(event.result().getString(0), QueueCircuitState.CLOSED);
                    String failRatioStr = event.result().getString(1);
                    String circuit = event.result().getString(2);
                    JsonObject result = new JsonObject();
                    result.put("status", state.name().toLowerCase());
                    JsonObject info = new JsonObject();
                    if (failRatioStr != null) {
                        info.put(FIELD_FAILRATIO, Integer.valueOf(failRatioStr));
                    }
                    if (circuit != null) {
                        info.put(FIELD_CIRCUIT, circuit);
                    }
                    result.put("info", info);
                    future.complete(result);
                }catch (Exception e){
                    future.fail(e);
                }
            }
        });
        return future;
    }

    public  RedisQueueCircuitBreakerStorage(RedisClient redisClient);

}