public class GlobalTaskPoolScheduling extends Object implements TeeTimeScheduler, PipeScheduler, Thread.UncaughtExceptionHandler
Constructor and Description |
---|
GlobalTaskPoolScheduling(int numThreads,
Configuration configuration)
A thread executes a stage x per job.
|
GlobalTaskPoolScheduling(int numThreads,
Configuration configuration,
int numOfExecutions) |
Modifier and Type | Method and Description |
---|---|
List<AbstractStage> |
getFiniteProducerStages() |
Set<AbstractStage> |
getFrontStages() |
teetime.framework.scheduling.globaltaskpool.TeeTimeTaskQueueThreadChw |
getOwningThreadSynched(AbstractStage stage) |
teetime.framework.scheduling.globaltaskpool.PrioritizedTaskPool |
getPrioritizedTaskPool() |
boolean |
isBeingExecuted(AbstractStage stage) |
boolean |
isPausedStage(AbstractStage stage) |
void |
onElementAdded(AbstractSynchedPipe<?> pipe)
This event is invoked by the given synchronized pipe whenever a new element was added to it.
|
void |
onElementAdded(AbstractUnsynchedPipe<?> pipe)
This event is invoked by the given unsynchronized pipe whenever a new element was added to it.
|
void |
onElementNotAdded(AbstractSynchedPipe<?> pipe)
This event is invoked by the given synchronized pipe whenever a new element could not be added to it.
|
void |
onExecute()
Executes the execution.
|
void |
onFinish()
Waits for the execution to finished.
|
void |
onInitialize() |
void |
onTerminate()
Aborts the execution.
|
void |
onValidate() |
boolean |
setIsBeingExecuted(AbstractStage stage,
boolean newValue) |
void |
setOwningThreadSynced(AbstractStage stage,
teetime.framework.scheduling.globaltaskpool.TeeTimeTaskQueueThreadChw newThread) |
void |
startStageAtRuntime(AbstractStage stage) |
String |
toString() |
void |
uncaughtException(Thread thread,
Throwable throwable) |
public GlobalTaskPoolScheduling(int numThreads, Configuration configuration)
numThreads
- configuration
- public GlobalTaskPoolScheduling(int numThreads, Configuration configuration, int numOfExecutions)
numThreads
- the number of threads to use for executing the given P&F configurationconfiguration
- the configuration to execute/schedulenumOfExecutions
- the number of execution per scheduled stage (task) for a thread. Is rounded up to the next power of 2, i.e., 1,2,4,16,...
public void onInitialize()
onInitialize
in interface TeeTimeScheduler
public void onValidate()
onValidate
in interface TeeTimeScheduler
public void onExecute()
TeeTimeScheduler
onExecute
in interface TeeTimeScheduler
public void onTerminate()
TeeTimeScheduler
onTerminate
in interface TeeTimeScheduler
public void onFinish()
TeeTimeScheduler
onFinish
in interface TeeTimeScheduler
public void startStageAtRuntime(AbstractStage stage)
startStageAtRuntime
in interface TeeTimeScheduler
public List<AbstractStage> getFiniteProducerStages()
public Set<AbstractStage> getFrontStages()
public teetime.framework.scheduling.globaltaskpool.PrioritizedTaskPool getPrioritizedTaskPool()
public void onElementAdded(AbstractUnsynchedPipe<?> pipe)
PipeScheduler
onElementAdded
in interface PipeScheduler
public void onElementAdded(AbstractSynchedPipe<?> pipe)
PipeScheduler
onElementAdded
in interface PipeScheduler
public void onElementNotAdded(AbstractSynchedPipe<?> pipe)
PipeScheduler
onElementNotAdded
in interface PipeScheduler
public boolean isPausedStage(AbstractStage stage)
public boolean isBeingExecuted(AbstractStage stage)
public boolean setIsBeingExecuted(AbstractStage stage, boolean newValue)
public void setOwningThreadSynced(AbstractStage stage, teetime.framework.scheduling.globaltaskpool.TeeTimeTaskQueueThreadChw newThread)
public teetime.framework.scheduling.globaltaskpool.TeeTimeTaskQueueThreadChw getOwningThreadSynched(AbstractStage stage)
public void uncaughtException(Thread thread, Throwable throwable)
uncaughtException
in interface Thread.UncaughtExceptionHandler
Copyright © 2015–2020. All rights reserved.