|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.apache.uima.collection.impl.cpm.engine.ArtifactProducer
public class ArtifactProducer
Component responsible for continuously filling a work queue with bundles containing Cas'es. The queue is shared with a Processing Pipeline that consumes bundles of Cas. As soon as the the bundle is removed from the queue, this component fetches data from configured Collection Reader and enques it onto the queue. This component facilitates asynchronous reading and processing of CAS by seperate threads running in the CPE. When end of processing is reached due to CPM shutdown or max number of entities are processed a special token, called EOFToken is placed onto a queue. It marks end of processing for Processing Units. No more data is expected to be placed on the work queue. The Processing Threads upon seeing the EOFToken are expected to complete processing and do necessary cleanup.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
int |
threadState
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ArtifactProducer(CPMEngine acpm)
Instantiates and initializes this instance. |
|
ArtifactProducer(CPMEngine acpm,
CPECasPool aPool)
Construct instance of this class with a reference to the cpe engine and a pool of cas'es. |
Method Summary | |
---|---|
void |
cleanup()
Null out fields of this object. |
void |
fillQueue()
Fills the queue up to capacity. |
long |
getCollectionReaderTotalFetchTime()
Returns total time spent when fetching entities from a CollectionReader. |
java.lang.String |
getLastDocId()
|
void |
invalidate(CAS[] aCasList)
|
boolean |
isRunning()
|
void |
run()
Runs this thread until the CPM halts or the CollectionReader has no more entities. |
void |
setCollectionReader(BaseCollectionReader aCollectionReader)
Assign CollectionReader to be used for reading |
void |
setCPMStatTable(java.util.Map aStatTable)
Add table that will contain statistics gathered while reading entities from a Collection This table is used for non-uima reports. |
void |
setNumEntitiesToProcess(long aNumToProcess)
Assign total number of entities to process |
void |
setProcessTrace(ProcessTrace aProcTrace)
|
void |
setUimaTimer(UimaTimer aTimer)
Plug in Custom Timer to time events |
void |
setWorkQueue(BoundedWorkQueue aQueue)
Assigns a queue where the artifacts produced by this component will be deposited |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int threadState
Constructor Detail |
---|
public ArtifactProducer(CPMEngine acpm)
acpm
- public ArtifactProducer(CPMEngine acpm, CPECasPool aPool)
acpm
- -
reference to the cpeaPool
- -
pool of casesMethod Detail |
---|
public boolean isRunning()
public void setUimaTimer(UimaTimer aTimer)
aTimer
- -
custom timerpublic void setProcessTrace(ProcessTrace aProcTrace)
public long getCollectionReaderTotalFetchTime()
public void cleanup()
public void setNumEntitiesToProcess(long aNumToProcess)
aNumToProcess
- -
number of entities to read from the Collection Readerpublic void setCollectionReader(BaseCollectionReader aCollectionReader)
aCollectionReader
- -
collection reader as source of datapublic void setWorkQueue(BoundedWorkQueue aQueue)
aQueue
- -
queue for the artifacts this class is producingpublic void setCPMStatTable(java.util.Map aStatTable)
aStatTable
- public void fillQueue() throws java.lang.Exception
java.lang.Exception
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String getLastDocId()
public void invalidate(CAS[] aCasList)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |