@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 RealtimeCorpusController extends SerialAnalyserController
| Modifier and Type | Class and Description |
|---|---|
protected class |
RealtimeCorpusController.DocRunner |
AbstractController.InternalStatusListener, AbstractController.IntervalProgressListener| Modifier and Type | Field and Description |
|---|---|
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 boolean |
suppressExceptions |
protected boolean |
threadDying |
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).
|
corpus, document, runningAsSubPipelinelog, prList, prTimeMap, sListenerbenchmarkFeatures, benchmarkID, controllerCallbacksEnabled, interruptednamefeatures| Constructor and Description |
|---|
RealtimeCorpusController() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
Boolean |
getSuppressExceptions() |
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 |
setSuppressExceptions(Boolean yesno)
If true, suppresses all exceptions.
|
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).
|
add, add, checkLanguageAnalyser, controllerExecutionAborted, controllerExecutionFinished, controllerExecutionStarted, execute, getCorpus, getDocument, getOffendingPocessingResources, invokeControllerExecutionAborted, invokeControllerExecutionFinished, invokeControllerExecutionStarted, resourceUnloaded, setCorpus, setDocToPrs, setDocumentcheckParameters, datastoreClosed, datastoreCreated, datastoreOpened, duplicate, getPRs, getPrTimeMap, remove, remove, resetPrTimeMap, resourceLoaded, resourceRenamed, runComponent, set, setPRsaddControllerListener, addProgressListener, addStatusListener, fireProcessFinished, fireProgressChanged, fireResourceAdded, fireResourceRemoved, fireStatusChanged, getBenchmarkId, getControllerAwarePRs, interrupt, isInterrupted, reInit, removeControllerListener, removeProgressListener, removeStatusListener, setBenchmarkId, setControllerCallbacksEnabledcheckParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toStringgetFeatures, setFeaturesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPRs, setPRsreInitgetParameterValue, setParameterValue, setParameterValuesgetFeatures, setFeaturesgetName, setNameinterrupt, isInterruptedprotected Profiler prof
protected ExecutorService threadSource
protected volatile Thread currentWorkingThread
protected volatile boolean threadDying
protected Long timeout
protected Long graceful
protected boolean suppressExceptions
public void cleanup()
SerialControllercleanup in interface Resourcecleanup in class SerialControllerpublic Resource init() throws ResourceInstantiationException
AbstractControllerinit in interface Resourceinit in class AbstractControllerResourceInstantiationExceptionpublic 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 - in milliseconds before execution is forcibly stoppedpublic 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 - timeout in milliseconds before execution is gracefully stopped@Optional @CreoleParameter(defaultValue="true", comment="Should all exceptions be suppressed and just a message be written to standard logger.info?") public void setSuppressExceptions(Boolean yesno)
public Boolean getSuppressExceptions()
Copyright © 2024 GATE. All rights reserved.