Class ResourceLimits.EndpointAndGlobal

java.lang.Object
org.apache.cassandra.net.ResourceLimits.EndpointAndGlobal
Enclosing class:
ResourceLimits

public static class ResourceLimits.EndpointAndGlobal extends 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 Details

  • Method Details

    • 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, 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.
    • allocate

      public void allocate(long amount)
    • release

      public ResourceLimits.Outcome release(long amount)