public abstract class TaskCoordinator.Permit extends Object implements Closeable
TaskCoordinator.setAppPermitPercent(int)) are
implemented as bookkeeping adjustments and are not represented by Permit
objects.| Constructor and Description |
|---|
Permit(TaskCoordinator.Task task,
long leaseIntervalMs) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkLeaseExpiry() |
void |
close() |
abstract boolean |
isDeficit() |
boolean |
isExpired()
Returns true if the lease has expired.
|
boolean |
isReleased() |
void |
releasePermit()
Marks the permit as being released after verifying that it was not
already released or expired.
|
void |
setLease(long leaseInterval,
TimeUnit unit)
Used to Extend the lease associated with the permit, when the
initial lease time cannot easily be predicted.
|
public Permit(TaskCoordinator.Task task, long leaseIntervalMs)
public boolean isReleased()
public boolean isExpired()
protected void checkLeaseExpiry()
public void setLease(long leaseInterval,
TimeUnit unit)
leaseInterval - the new lease intervalunit - the units used to express the lease intervalpublic void releasePermit()
public abstract boolean isDeficit()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2024. All rights reserved.