|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.creole.AbstractController
gate.creole.SerialController
gate.creole.SerialAnalyserController
gate.creole.RealtimeCorpusController
@CreoleResource(name="Real-Time Corpus Pipeline",
comment="A serial controller for PR pipelines over corpora which limits the run time of each PR.",
icon="application-realtime",
helpURL="http://gate.ac.uk/userguide/sec:creole-model:applications")
public class RealtimeCorpusControllerA custom GATE controller that interrupts the execution over a document when a specified amount of time has elapsed. It also ignores all errors/exceptions that may occur during execution and simply carries on with the next document when that happens.
| Nested Class Summary | |
|---|---|
protected class |
RealtimeCorpusController.DocRunner
|
| Nested classes/interfaces inherited from class gate.creole.AbstractController |
|---|
AbstractController.InternalStatusListener, AbstractController.IntervalProgressListener |
| Field Summary | |
|---|---|
protected Thread |
currentWorkingThread
The tread currently running the document processing. |
protected Long |
graceful
The timeout in milliseconds before execution on a document is gracefully stopped. |
protected Profiler |
prof
Profiler to track PR execute time |
protected ExecutorService |
threadSource
An executor service used to execute the PRs over the document . |
protected HashMap<String,Long> |
timeMap
|
protected Long |
timeout
The timeout in milliseconds before execution on a document is forcibly stopped (forcibly stopping execution may result in memory leaks and/or unexpected behaviour). |
| Fields inherited from class gate.creole.SerialAnalyserController |
|---|
corpus, document |
| Fields inherited from class gate.creole.SerialController |
|---|
log, prList, prTimeMap, sListener |
| Fields inherited from class gate.creole.AbstractController |
|---|
benchmarkFeatures, benchmarkID, interrupted, name |
| Fields inherited from class gate.util.AbstractFeatureBearer |
|---|
features |
| Constructor Summary | |
|---|---|
RealtimeCorpusController()
|
|
| Method Summary | |
|---|---|
void |
cleanup()
Cleans the internal data and prepares this object to be collected |
void |
executeImpl()
Run the Processing Resources in sequence. |
Long |
getGracefulTimeout()
Gets the timeout in milliseconds before execution on a document is gracefully stopped. |
Long |
getTimeout()
Gets the timeout in milliseconds before execution on a document is forcibly stopped (forcibly stopping execution may result in memory leaks and/or unexpected behaviour). |
Resource |
init()
Initialise this resource, and return it. |
void |
setGracefulTimeout(Long graceful)
Sets the timeout in milliseconds before execution on a document is gracefully stopped. |
void |
setTimeout(Long timeout)
Sets the timeout in milliseconds before execution on a document is forcibly stopped (forcibly stopping execution may result in memory leaks and/or unexpected behaviour). |
| Methods inherited from class gate.creole.SerialAnalyserController |
|---|
add, add, checkLanguageAnalyser, getCorpus, getDocument, getOffendingPocessingResources, resourceUnloaded, setCorpus, setDocToPrs, setDocument |
| Methods inherited from class gate.creole.SerialController |
|---|
checkParameters, datastoreClosed, datastoreCreated, datastoreOpened, duplicate, getPRs, getPrTimeMap, remove, remove, resetPrTimeMap, resourceLoaded, resourceRenamed, runComponent, set, setPRs |
| Methods inherited from class gate.creole.AbstractResource |
|---|
checkParameterValues, getBeanInfo, getParameterValue, getParameterValue, removeResourceListeners, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
| Methods inherited from class gate.util.AbstractFeatureBearer |
|---|
getFeatures, setFeatures |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gate.Controller |
|---|
execute, getPRs, setPRs |
| Methods inherited from interface gate.ProcessingResource |
|---|
reInit |
| Methods inherited from interface gate.Resource |
|---|
getParameterValue, setParameterValue, setParameterValues |
| Methods inherited from interface gate.Executable |
|---|
interrupt, isInterrupted |
| Field Detail |
|---|
protected Profiler prof
protected HashMap<String,Long> timeMap
protected ExecutorService threadSource
protected volatile Thread currentWorkingThread
protected Long timeout
protected Long graceful
| Constructor Detail |
|---|
public RealtimeCorpusController()
| Method Detail |
|---|
public void cleanup()
SerialController
cleanup in interface Resourcecleanup in class SerialController
public Resource init()
throws ResourceInstantiationException
AbstractController
init in interface Resourceinit in class AbstractControllerResourceInstantiationException
public void executeImpl()
throws ExecutionException
executeImpl in class SerialAnalyserControllerExecutionExceptionpublic Long getTimeout()
@CreoleParameter(defaultValue="60000",
comment="Timeout in milliseconds before execution on a document is forcibly stopped (forcibly stopping execution may result in memory leaks and/or unexpected behaviour)")
public void setTimeout(Long timeout)
timeout - public Long getGracefulTimeout()
@CreoleParameter(defaultValue="-1",
comment="Timeout in milliseconds before execution on a document is gracefully stopped. Defaults to -1 which disables this functionality and relies, as previously, on forcibly stoping execution.")
public void setGracefulTimeout(Long graceful)
graceful -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||