com.smaato.switchgear.circuitbreaker.state.bucket.BucketedFailureStatesHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of switchgear Show documentation
Show all versions of switchgear Show documentation
Switchgear is a Java library that provides an API for call isolation, timeouts, and circuit breaker
functionality. Our main goal is to achieve minimal performance overhead of the library, even when used in the
hottest place of your application. Additionally, we've opted for zero transitive dependencies and maintaining a
fluent API.
The newest version!
package com.smaato.switchgear.circuitbreaker.state.bucket;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.smaato.switchgear.circuitbreaker.state.LastFailureCause;
public class BucketedFailureStatesHolder {
private final Map failureStates = new ConcurrentHashMap<>();
public LastFailureCause getFailureState(final BucketRange timeoutBucketRange) {
return failureStates.computeIfAbsent(timeoutBucketRange, ignored -> new LastFailureCause());
}
}