Class CapacityExceededException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.loomcache.common.exception.LoomException
com.loomcache.common.exception.CapacityExceededException
- All Implemented Interfaces:
Serializable
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 Summary
ConstructorsConstructorDescriptionCapacityExceededException(String message) Creates a new CapacityExceededException with message.CapacityExceededException(String message, long currentCapacity, long maxCapacity, String resourceType) Creates a new CapacityExceededException with detailed capacity information.CapacityExceededException(String message, long currentCapacity, long maxCapacity, String resourceType, Throwable cause) Creates a new CapacityExceededException with detailed capacity information and cause.CapacityExceededException(String message, Throwable cause) Creates a new CapacityExceededException with message and cause. -
Method Summary
Modifier and TypeMethodDescriptionintGets the percentage of capacity that is used.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CapacityExceededException
Creates a new CapacityExceededException with message.- Parameters:
message- the error message
-
CapacityExceededException
-
CapacityExceededException
public CapacityExceededException(String message, long currentCapacity, long maxCapacity, String resourceType) Creates a new CapacityExceededException with detailed capacity information.- Parameters:
message- the error messagecurrentCapacity- the current usage of the resourcemaxCapacity- the maximum allowed capacityresourceType- 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 messagecurrentCapacity- the current usage of the resourcemaxCapacity- the maximum allowed capacityresourceType- 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
-