Class CapacityExceededException

All Implemented Interfaces:
Serializable

public final class CapacityExceededException extends LoomException
Thrown when memory or entry limits are exceeded.

This exception indicates that an operation cannot be completed because adding the data would exceed a configured limit. This includes: - Total memory capacity exceeded - Maximum number of entries exceeded - Per-map memory quota exceeded - Replication queue capacity exceeded

Clients should evict entries, increase capacity limits, or retry the operation later after entries have been removed.

Since:
1.0
See Also:
  • Constructor Details

    • CapacityExceededException

      public CapacityExceededException(String message)
      Creates a new CapacityExceededException with message.
      Parameters:
      message - the error message
    • CapacityExceededException

      public CapacityExceededException(String message, Throwable cause)
      Creates a new CapacityExceededException with message and cause.
      Parameters:
      message - the error message
      cause - the underlying cause
    • CapacityExceededException

      public CapacityExceededException(String message, long currentCapacity, long maxCapacity, String resourceType)
      Creates a new CapacityExceededException with detailed capacity information.
      Parameters:
      message - the error message
      currentCapacity - the current usage of the resource
      maxCapacity - the maximum allowed capacity
      resourceType - the type of resource (e.g., "memory", "entries", "queue")
    • CapacityExceededException

      public CapacityExceededException(String message, long currentCapacity, long maxCapacity, String resourceType, Throwable cause)
      Creates a new CapacityExceededException with detailed capacity information and cause.
      Parameters:
      message - the error message
      currentCapacity - the current usage of the resource
      maxCapacity - the maximum allowed capacity
      resourceType - the type of resource (e.g., "memory", "entries", "queue")
      cause - the underlying cause
  • Method Details

    • getPercentageUsed

      public int getPercentageUsed()
      Gets the percentage of capacity that is used.
      Returns:
      the percentage used (0-100), or 0 if capacity info is unavailable