public class GenericLeaseSelector<T extends Lease> extends Object implements LeaseSelector<T>
| Constructor and Description |
|---|
GenericLeaseSelector() |
| Modifier and Type | Method and Description |
|---|---|
int |
getLeaseCountThatCanBeTaken(Collection<T> allLeases)
Provides the number of leases that should be taken by the worker.
|
Set<T> |
getLeasesToTakeFromExpiredLeases(List<T> expiredLeases,
int numLeasesToReachTarget)
Provides the list of leases to be taken.
|
public Set<T> getLeasesToTakeFromExpiredLeases(List<T> expiredLeases, int numLeasesToReachTarget)
getLeasesToTakeFromExpiredLeases in interface LeaseSelector<T extends Lease>expiredLeases - list of leases that are currently expirednumLeasesToReachTarget - the number of leases to be takenpublic int getLeaseCountThatCanBeTaken(Collection<T> allLeases)
getLeaseCountThatCanBeTaken in interface LeaseSelector<T extends Lease>allLeases - list of all existing leasesCopyright © 2021. All rights reserved.