public abstract class AbstractConsumer extends AbstractTaskRunner implements Consumer
Modifier and Type | Field and Description |
---|---|
protected Batch |
batch |
protected static long |
CHECK_INTERVAL |
protected ImportStat |
importStat |
protected long |
lastCheckTime |
protected long |
lastCount |
protected double |
lastImediatThroughput |
protected ImporterLogger |
log |
protected String |
originatingUsername |
protected BlockingQueue<SourceNode> |
queue |
protected String |
repositoryName |
protected DocumentRef |
rootRef |
protected long |
startTime |
canStop, completed, error, mustStop, nbProcessed, started
Constructor and Description |
---|
AbstractConsumer(ImporterLogger log,
DocumentModel root,
int batchSize,
BlockingQueue<SourceNode> queue) |
Modifier and Type | Method and Description |
---|---|
protected void |
commit(CoreSession session) |
protected void |
commitIfNeeded(CoreSession session) |
double |
getImmediateThroughput() |
ImportStat |
getImportStat() |
String |
getOriginatingUsername() |
double |
getThroughput() |
protected void |
onSourceNodeException(SourceNode node,
Exception e)
Override if you want to do more that logging the error.
|
protected void |
onSourceNodeRollBack(SourceNode node)
Override if you want to do more that logging the error.
|
protected abstract void |
process(CoreSession session,
SourceNode bh) |
void |
run() |
void |
setOriginatingUsername(String originatingUsername) |
canStop, getError, getNbProcessed, incrementProcessed, isCompleted, isTerminated, mustStop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNbDocsCreated
canStop, getError, getNbProcessed, isCompleted, isTerminated, mustStop
protected final String repositoryName
protected final BlockingQueue<SourceNode> queue
protected final DocumentRef rootRef
protected long startTime
protected long lastCheckTime
protected long lastCount
protected static final long CHECK_INTERVAL
protected double lastImediatThroughput
protected final ImportStat importStat
protected String originatingUsername
protected ImporterLogger log
public AbstractConsumer(ImporterLogger log, DocumentModel root, int batchSize, BlockingQueue<SourceNode> queue)
protected abstract void process(CoreSession session, SourceNode bh) throws Exception
Exception
protected void commitIfNeeded(CoreSession session)
protected void commit(CoreSession session)
protected void onSourceNodeException(SourceNode node, Exception e)
node
- e
- protected void onSourceNodeRollBack(SourceNode node)
node
- e
- public double getImmediateThroughput()
getImmediateThroughput
in interface Consumer
public double getThroughput()
getThroughput
in interface Consumer
public ImportStat getImportStat()
getImportStat
in interface Consumer
public String getOriginatingUsername()
public void setOriginatingUsername(String originatingUsername)
Copyright © 2016 Nuxeo SA. All rights reserved.