Package org.apache.cassandra.net
Class ResourceLimits.EndpointAndGlobal
java.lang.Object
org.apache.cassandra.net.ResourceLimits.EndpointAndGlobal
- Enclosing class:
- ResourceLimits
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
ConstructorsConstructorDescriptionEndpointAndGlobal(ResourceLimits.Limit endpoint, ResourceLimits.Limit global) -
Method Summary
Modifier and TypeMethodDescriptionvoidallocate(long amount) endpoint()global()release(long amount) tryAllocate(long amount)
-
Constructor Details
-
EndpointAndGlobal
-
-
Method Details
-
endpoint
-
global
-
tryAllocate
- Returns:
INSUFFICIENT_GLOBALif there weren't enough permits in the global limit, orINSUFFICIENT_ENDPOINTif there weren't enough permits in the per-endpoint limit, orSUCCESSif there were enough permits to take from both.
-
allocate
public void allocate(long amount) -
release
-