
public abstract class HjBinaryEurekaImpl<L,R> extends Object implements HjBinaryEureka<L,R>
| Modifier and Type | Class and Description |
|---|---|
static class |
HjBinaryEurekaImpl.HjConjunctiveEurekaImpl<L,R>
Represents an binary logical AND expression between two Eureka instances.
|
static class |
HjBinaryEurekaImpl.HjDisjunctiveEurekaImpl<L,R>
Represents an binary logical OR expression between two Eureka instances.
|
| Modifier and Type | Field and Description |
|---|---|
protected HjEureka<L,Object,L> |
leftEureka |
protected HjEureka<R,Object,R> |
rightEureka |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(Pair<Object,Object> localValue,
boolean triggerAbort)
Checks whether the locally known value can lead to a better estimate than the globally known value.
|
protected abstract boolean |
expressionValue(boolean leftValue,
boolean rightValue) |
Pair<L,R> |
get()
Return the value stored in the eureka object.
|
L |
getLeft() |
R |
getRight() |
boolean |
offer(Pair<L,R> 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.
|
public void onRegistration()
HjEurekapublic void onCleanup()
HjEurekapublic boolean resolved()
HjEurekapublic boolean shouldAbortOnOffer(boolean offerResult)
HjEurekapublic Pair<L,R> get()
HjEurekapublic L getLeft()
getLeft in interface HjBinaryEureka<L,R>public R getRight()
getRight in interface HjBinaryEureka<L,R>public boolean offer(Pair<L,R> newValue, boolean triggerAbort) throws SuspendableException
HjEurekashouldAbortOnOffer() returns true and
triggerAbort is true, the task will abort instead of returning true.offer in interface HjEureka<Pair<L,R>,Pair<Object,Object>,Pair<L,R>>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(Pair<Object,Object> localValue, boolean triggerAbort) throws SuspendableException
HjEurekacheck in interface HjEureka<Pair<L,R>,Pair<Object,Object>,Pair<L,R>>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 suspendableprotected abstract boolean expressionValue(boolean leftValue,
boolean rightValue)
Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.