|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.ai.scorer.ScorerCreator.ScorerWork
public static final class ScorerCreator.ScorerWork
Class to encapsulate all background and evolution work for a given ScorerCache. The doChunk() entry point is designed to be thread-safe and highly threadable, ie can be called from multiple worker threads at once.
| Field Summary | |
|---|---|
private boolean |
allowScorerSharingByEvent
If true, then we try to retrieve persisted/shared Scorers from the system variables event mechanism. |
private java.util.concurrent.atomic.AtomicLong |
excessSlowTimeNs
Excess time spent running slow evolution methods (ns). |
private SimpleLoggerIF |
log
Logger; never null. |
private AbstractScorerCache |
scorerCache
Underlying Scorer cache; never null. |
| Constructor Summary | |
|---|---|
ScorerCreator.ScorerWork(AbstractScorerCache scorerCache,
SimpleLoggerIF log,
boolean allowScorerSharingByEvent)
Create instance. |
|
| Method Summary | |
|---|---|
void |
doChunk(long endTime,
long minEndTime,
boolean special,
java.util.Queue<java.lang.String> inboundEval)
Run one chunk of work. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final AbstractScorerCache scorerCache
private final SimpleLoggerIF log
private final boolean allowScorerSharingByEvent
private final java.util.concurrent.atomic.AtomicLong excessSlowTimeNs
This is increased by the execution time of each "slow" instance and decreased by the execution time of each "fast" instance. Slow methods may only start when it is negative, fast ones otherwise.
Run-time for "failed" executions may or may not be included.
This starts at zero, and the effect of the "fair share" scheduling that this controls should be to keep it as close to zero (on either side of zero) as possible.
This is thread-safe.
| Constructor Detail |
|---|
public ScorerCreator.ScorerWork(AbstractScorerCache scorerCache,
SimpleLoggerIF log,
boolean allowScorerSharingByEvent)
scorerCache - cache of Scorers to work with; never nulllog - logger; never nullallowScorerSharingByEvent - if true,
then we try to retrieve persisted/shared Scorers
from the system variables event mechanism| Method Detail |
|---|
public final void doChunk(long endTime,
long minEndTime,
boolean special,
java.util.Queue<java.lang.String> inboundEval)
special - if true, do extra background work and normal workinboundEval - if non-null then is queue of externally-supplied Scorers
to evaluate and insert into the population if appropriate;
these are regarded as potentially untrusted so are validated and canonicalised before useendTime - target end time for this chunk of work to stop byminEndTime - time before which we should not stop (ie target minimum quantum)
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||