Record Class ResourceBudget
java.lang.Object
java.lang.Record
org.j7m.middleware.api.isolation.ResourceBudget
- Record Components:
maxConcurrentExecutions- maximum concurrent executions in providermaxRuntime- maximum runtime before timeoutmaxStdoutBytes- maximum captured stdout bytesmaxStderrBytes- maximum captured stderr bytesmaxEnvironmentVariables- maximum exposed environment variablesmaxEnvironmentBytes- maximum aggregate environment bytesmaxCommandLineBytes- maximum command-line bytesmaxQueueBacklog- maximum pending backlog policy valuecpuBudget- advisory CPU budgetmemoryBudget- advisory memory budgetthreadBudget- thread budgetqueueBudget- queue/backlog budget classification
public record ResourceBudget(int maxConcurrentExecutions, Duration maxRuntime, int maxStdoutBytes, int maxStderrBytes, int maxEnvironmentVariables, int maxEnvironmentBytes, int maxCommandLineBytes, int maxQueueBacklog, CpuBudget cpuBudget, MemoryBudget memoryBudget, ThreadBudget threadBudget, QueueBudget queueBudget)
extends Record
Bounded resource budget for an isolation request.
The budget is immutable and thread-safe. Pure-Java providers enforce concurrency, runtime, output, environment, and command-line limits. The Java-only baseline has no internal work queue, so queue/backlog values are policy metadata unless a future provider reports stronger support. CPU, memory, and working-directory-size values are advisory or policy hooks unless an implementation reports stronger support.
-
Constructor Summary
ConstructorsConstructorDescriptionResourceBudget(int maxConcurrentExecutions, Duration maxRuntime, int maxStdoutBytes, int maxStderrBytes, int maxEnvironmentVariables, int maxEnvironmentBytes, int maxCommandLineBytes, int maxQueueBacklog, CpuBudget cpuBudget, MemoryBudget memoryBudget, ThreadBudget threadBudget, QueueBudget queueBudget) Creates a validated budget. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecpuBudgetrecord component.static ResourceBudgetdefaults()Returns a conservative default budget for local test and demo execution.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxCommandLineBytesrecord component.intReturns the value of themaxConcurrentExecutionsrecord component.intReturns the value of themaxEnvironmentBytesrecord component.intReturns the value of themaxEnvironmentVariablesrecord component.intReturns the value of themaxQueueBacklogrecord component.Returns the value of themaxRuntimerecord component.intReturns the value of themaxStderrBytesrecord component.intReturns the value of themaxStdoutBytesrecord component.Returns the value of thememoryBudgetrecord component.Returns the value of thequeueBudgetrecord component.Returns the value of thethreadBudgetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ResourceBudget
public ResourceBudget(int maxConcurrentExecutions, Duration maxRuntime, int maxStdoutBytes, int maxStderrBytes, int maxEnvironmentVariables, int maxEnvironmentBytes, int maxCommandLineBytes, int maxQueueBacklog, CpuBudget cpuBudget, MemoryBudget memoryBudget, ThreadBudget threadBudget, QueueBudget queueBudget) Creates a validated budget.
-
-
Method Details
-
defaults
Returns a conservative default budget for local test and demo execution.- Returns:
- default budget
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
maxConcurrentExecutions
public int maxConcurrentExecutions()Returns the value of themaxConcurrentExecutionsrecord component.- Returns:
- the value of the
maxConcurrentExecutionsrecord component
-
maxRuntime
Returns the value of themaxRuntimerecord component.- Returns:
- the value of the
maxRuntimerecord component
-
maxStdoutBytes
public int maxStdoutBytes()Returns the value of themaxStdoutBytesrecord component.- Returns:
- the value of the
maxStdoutBytesrecord component
-
maxStderrBytes
public int maxStderrBytes()Returns the value of themaxStderrBytesrecord component.- Returns:
- the value of the
maxStderrBytesrecord component
-
maxEnvironmentVariables
public int maxEnvironmentVariables()Returns the value of themaxEnvironmentVariablesrecord component.- Returns:
- the value of the
maxEnvironmentVariablesrecord component
-
maxEnvironmentBytes
public int maxEnvironmentBytes()Returns the value of themaxEnvironmentBytesrecord component.- Returns:
- the value of the
maxEnvironmentBytesrecord component
-
maxCommandLineBytes
public int maxCommandLineBytes()Returns the value of themaxCommandLineBytesrecord component.- Returns:
- the value of the
maxCommandLineBytesrecord component
-
maxQueueBacklog
public int maxQueueBacklog()Returns the value of themaxQueueBacklogrecord component.- Returns:
- the value of the
maxQueueBacklogrecord component
-
cpuBudget
-
memoryBudget
Returns the value of thememoryBudgetrecord component.- Returns:
- the value of the
memoryBudgetrecord component
-
threadBudget
Returns the value of thethreadBudgetrecord component.- Returns:
- the value of the
threadBudgetrecord component
-
queueBudget
Returns the value of thequeueBudgetrecord component.- Returns:
- the value of the
queueBudgetrecord component
-