public class HjCountEurekaImpl<T> extends Object implements HjCountEureka<T>
Constructor and Description |
---|
HjCountEurekaImpl(long maxCount,
int spaceForResult) |
Modifier and Type | Method and Description |
---|---|
boolean |
check(Void localValue,
boolean triggerAbort)
Checks whether the locally known value can lead to a better estimate than the globally known value.
|
long |
curCount() |
List<T> |
get()
Return the value stored in the eureka object.
|
long |
maxCount() |
boolean |
offer(T newValue,
boolean triggerAbort)
Attempts to update the eureka object with a new value.
|
void |
onCleanup()
Invoked by the runtime at the end of the finish scope in which the eureka has been registered.
|
void |
onRegistration()
Invoked by the runtime at the start of the finish scope in which the eureka has been registered.
|
boolean |
resolved()
Return true if the eureka has been resolved.
|
boolean |
shouldAbortOnOffer(boolean offerResult)
Return true if the eureka should abort the current task on a successful update.
|
String |
toString() |
public long maxCount()
maxCount
in interface HjCountEureka<T>
public long curCount()
curCount
in interface HjCountEureka<T>
public void onRegistration()
public void onCleanup()
public boolean resolved()
public boolean shouldAbortOnOffer(boolean offerResult)
public List<T> get()
public boolean offer(T newValue, boolean triggerAbort) throws SuspendableException
shouldAbortOnOffer()
returns true and
triggerAbort
is true, the task will abort instead of returning true.offer
in interface HjEureka<T,Void,List<T>>
newValue
- The new value to try and update the eureka object with.triggerAbort
- Boolean value that conmfigures whether task is aborted inside this method call.offer
should trigger task abortion.SuspendableException
- Marker to notify that this method is suspendablepublic boolean check(Void localValue, boolean triggerAbort) throws SuspendableException
check
in interface HjEureka<T,Void,List<T>>
localValue
- The local value used to compare with the globally known eureka valuetriggerAbort
- Boolean value that conmfigures whether task is aborted inside this method call.offer
should trigger task abortion.SuspendableException
- Marker to notify that this method is suspendableCopyright © 2015 Rice University - Department of Computer Science. All rights reserved.