public interface BalancerResourceManager
Modifier and Type | Method and Description |
---|---|
void |
clearAllResourcesAndWaiters()
Clear all resource values and events waiting on resources.
|
<R> Optional<R> |
maybeGetResourceValue(SbcResource<R> resourceId)
Return the current value of a resource, if any.
|
<R> void |
provideResource(SbcResource<R> resourceId,
R resourceValue)
Provide a resource.
|
void |
waitOnResource(SbcResource<?> resourceId,
SbcEvent event)
Wait for a SbcResource to be provided.
|
<R> void provideResource(SbcResource<R> resourceId, R resourceValue)
R
- the type of the resource valueresourceId
- identifier for the resource which is receiving a valueresourceValue
- the value to assign to the resource.<R> Optional<R> maybeGetResourceValue(SbcResource<R> resourceId)
R
- type of resource to trackresourceId
- identifier for the resource to check the value of.void waitOnResource(SbcResource<?> resourceId, SbcEvent event)
provideResource(io.confluent.databalancer.event.resource.SbcResource<R>, R)
call will be made in the future; it does not consider the
current value (if any) of the SbcResource.
This call does not block, it only marks the SbcEvent as waiting on the SbcResource.resourceId
- the SbcResource which needs to be providedevent
- the SbcEvent that is waiting on the SbcResource. This SbcEvent will be submitted for execution once the SbcResource is provided.void clearAllResourcesAndWaiters()