Module org.elasticsearch.server
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:
Closeable
,AutoCloseable
,LifecycleComponent
,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
ConstructorsConstructorDescriptionPreallocatedCircuitBreakerService
(CircuitBreakerService next, String breakerToPreallocate, long bytesToPreallocate, String label) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doClose()
Close this component.getBreaker
(String name) stats()
Methods inherited from class org.elasticsearch.indices.breaker.CircuitBreakerService
doStart, doStop
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.core.Releasable
close
-
Constructor Details
-
PreallocatedCircuitBreakerService
public PreallocatedCircuitBreakerService(CircuitBreakerService next, String breakerToPreallocate, long bytesToPreallocate, 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
-
doClose
protected void doClose()Description copied from class:AbstractLifecycleComponent
Close this component. Typically that means doing the reverse of whatever happened during initialization, such as releasing resources acquired there.This method is called while synchronized on
AbstractLifecycleComponent.lifecycle
. It is called once in the lifetime of a component. If the component was started then it will be stopped before it is closed, and once it is closed it will not be started or stopped.- Overrides:
doClose
in classCircuitBreakerService
-