org.terracotta.async.stealpolicies
Class FallBehindStealPolicy<I>
java.lang.Object
org.terracotta.async.stealpolicies.FallBehindStealPolicy<I>
- All Implemented Interfaces:
- StealPolicy<I>
public class FallBehindStealPolicy<I>
- extends Object
- implements StealPolicy<I>
A steal policy that will allow stealing once a bucket has fallen behind the thief by a certain amount of time.
In practical terms this means a bucket can be stolen from if its last processing time was more than
the threshold time before the thief's last processing time.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FallBehindStealPolicy
public FallBehindStealPolicy(long maxAllowedFallBehind)
- Parameters:
maxAllowedFallBehind - the amount of milliseconds that the victim is allowed
to fall behind the thief before its work gets stolen
shouldSteal
public boolean shouldSteal(ProcessingBucket<I> victim,
ProcessingBucket<I> thief)
- Description copied from interface:
StealPolicy
- Returns
true if the thief bucket can steal work items from the victim bucket.
- Specified by:
shouldSteal in interface StealPolicy<I>
- Parameters:
victim - bucket being stolen fromthief - bucket doing the stealing
- Returns:
true if stealing is permitted
Copyright © 2015 Terracotta, Inc.. All Rights Reserved.