Package org.apache.cassandra.net
Class ResourceLimits.EndpointAndGlobal
- java.lang.Object
-
- org.apache.cassandra.net.ResourceLimits.EndpointAndGlobal
-
- Enclosing class:
- ResourceLimits
public static class ResourceLimits.EndpointAndGlobal extends java.lang.Object
A convenience class that groups a per-endpoint limit with the global one to allow allocating/releasing permits from/to both limits as one logical operation.
-
-
Constructor Summary
Constructors Constructor Description EndpointAndGlobal(ResourceLimits.Limit endpoint, ResourceLimits.Limit global)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
allocate(long amount)
ResourceLimits.Limit
endpoint()
ResourceLimits.Limit
global()
ResourceLimits.Outcome
release(long amount)
ResourceLimits.Outcome
tryAllocate(long amount)
-
-
-
Constructor Detail
-
EndpointAndGlobal
public EndpointAndGlobal(ResourceLimits.Limit endpoint, ResourceLimits.Limit global)
-
-
Method Detail
-
endpoint
public ResourceLimits.Limit endpoint()
-
global
public ResourceLimits.Limit global()
-
tryAllocate
public ResourceLimits.Outcome tryAllocate(long amount)
- Returns:
INSUFFICIENT_GLOBAL
if there weren't enough permits in the global limit, orINSUFFICIENT_ENDPOINT
if there weren't enough permits in the per-endpoint limit, orSUCCESS
if there were enough permits to take from both.
-
allocate
public void allocate(long amount)
-
release
public ResourceLimits.Outcome release(long amount)
-
-