Package org.elasticsearch.common.breaker
Class PreallocatedCircuitBreakerService
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.indices.breaker.CircuitBreakerService
org.elasticsearch.common.breaker.PreallocatedCircuitBreakerService
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,LifecycleComponent
,org.elasticsearch.common.lease.Releasable
public class PreallocatedCircuitBreakerService extends CircuitBreakerService implements org.elasticsearch.common.lease.Releasable
CircuitBreakerService
that preallocates some bytes on construction.
Use this when you know you'll be allocating many small things on a
CircuitBreaker
quickly and there is a definite "finished" time, like
when aggregations are built.-
Field Summary
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
-
Constructor Summary
Constructors Constructor Description PreallocatedCircuitBreakerService(CircuitBreakerService next, java.lang.String breakerToPreallocate, long bytesToPreallocate, java.lang.String label)
-
Method Summary
Modifier and Type Method Description void
close()
CircuitBreaker
getBreaker(java.lang.String name)
AllCircuitBreakerStats
stats()
CircuitBreakerStats
stats(java.lang.String name)
Methods inherited from class org.elasticsearch.indices.breaker.CircuitBreakerService
doClose, doStart, doStop
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PreallocatedCircuitBreakerService
public PreallocatedCircuitBreakerService(CircuitBreakerService next, java.lang.String breakerToPreallocate, long bytesToPreallocate, java.lang.String label)
-
-
Method Details
-
getBreaker
- Specified by:
getBreaker
in classCircuitBreakerService
- Returns:
- the breaker that can be used to register estimates against
-
stats
- Specified by:
stats
in classCircuitBreakerService
- Returns:
- stats about all breakers
-
stats
- Specified by:
stats
in classCircuitBreakerService
- Returns:
- stats about a specific breaker
-
close
public void close()- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfaceorg.elasticsearch.common.lease.Releasable
- Overrides:
close
in classAbstractLifecycleComponent
-