public static class ResourceLimits.EndpointAndGlobal
extends java.lang.Object
Constructor and Description |
---|
EndpointAndGlobal(ResourceLimits.Limit endpoint,
ResourceLimits.Limit global) |
Modifier and Type | Method and Description |
---|---|
void |
allocate(long amount) |
ResourceLimits.Limit |
endpoint() |
ResourceLimits.Limit |
global() |
ResourceLimits.Outcome |
release(long amount) |
ResourceLimits.Outcome |
tryAllocate(long amount) |
public EndpointAndGlobal(ResourceLimits.Limit endpoint, ResourceLimits.Limit global)
public ResourceLimits.Limit endpoint()
public ResourceLimits.Limit global()
public ResourceLimits.Outcome tryAllocate(long amount)
INSUFFICIENT_GLOBAL
if there weren't enough permits in the global limit, or
INSUFFICIENT_ENDPOINT
if there weren't enough permits in the per-endpoint limit, or
SUCCESS
if there were enough permits to take from both.public void allocate(long amount)
public ResourceLimits.Outcome release(long amount)
Copyright © 2009-2021 The Apache Software Foundation