public class ResourceBudgetManager extends Object
ResourceProfile
.
For a given total resource budget, this class handles reserving and releasing resources from the budget, and rejects reservations if they cannot be satisfied by the remaining budget.
Both the total budget and the reservations are in the form of ResourceProfile
.
Constructor and Description |
---|
ResourceBudgetManager(ResourceProfile totalBudget) |
Modifier and Type | Method and Description |
---|---|
ResourceProfile |
getAvailableBudget() |
ResourceProfile |
getTotalBudget() |
boolean |
release(ResourceProfile reservation) |
boolean |
reserve(ResourceProfile reservation) |
public ResourceBudgetManager(ResourceProfile totalBudget)
public ResourceProfile getTotalBudget()
public ResourceProfile getAvailableBudget()
public boolean reserve(ResourceProfile reservation)
public boolean release(ResourceProfile reservation)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.