@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, runningAsSubPipeline
log, prList, prTimeMap, sListener
benchmarkFeatures, benchmarkID, controllerCallbacksEnabled, interrupted
name
features
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, setDocument
checkParameters, datastoreClosed, datastoreCreated, datastoreOpened, duplicate, getPRs, getPrTimeMap, remove, remove, resetPrTimeMap, resourceLoaded, resourceRenamed, runComponent, set, setPRs
addControllerListener, addProgressListener, addStatusListener, fireProcessFinished, fireProgressChanged, fireResourceAdded, fireResourceRemoved, fireStatusChanged, getBenchmarkId, getControllerAwarePRs, interrupt, isInterrupted, reInit, removeControllerListener, removeProgressListener, removeStatusListener, setBenchmarkId, setControllerCallbacksEnabled
checkParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toString
getFeatures, setFeatures
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getPRs, setPRs
reInit
getParameterValue, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
interrupt, isInterrupted
protected 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()
SerialController
cleanup
in interface Resource
cleanup
in class SerialController
public Resource init() throws ResourceInstantiationException
AbstractController
init
in interface Resource
init
in class AbstractController
ResourceInstantiationException
public void executeImpl() throws ExecutionException
executeImpl
in class SerialAnalyserController
ExecutionException
public 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.