org.wikidata.wdtk.datamodel.interfaces.EntityDocumentDumpProcessor, org.wikidata.wdtk.datamodel.interfaces.EntityDocumentProcessorpublic class EntityTimerProcessor
extends java.lang.Object
implements org.wikidata.wdtk.datamodel.interfaces.EntityDocumentDumpProcessor
EntityDocumentProcessor for basic counting and time keeping.
It will print statistics on elapsed time and processed entities once in a
while. The class also supports a timeout mechanism: if a timeout time (in
seconds) is given, then a EntityTimerProcessor.TimeoutException
(unchecked) will be thrown soon after this many seconds have passed. This can
be used to abort processing in a relatively clean way by catching this
exception at a higher level.| Modifier and Type | Class | Description |
|---|---|---|
class |
EntityTimerProcessor.TimeoutException |
| Constructor | Description |
|---|---|
EntityTimerProcessor(int timeout) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Stops the processing and prints the final time.
|
void |
open() |
|
void |
processItemDocument(org.wikidata.wdtk.datamodel.interfaces.ItemDocument itemDocument) |
|
void |
processPropertyDocument(org.wikidata.wdtk.datamodel.interfaces.PropertyDocument propertyDocument) |
|
void |
setReportInterval(int seconds) |
Sets the interval after which the timer should report progress.
|
public EntityTimerProcessor(int timeout)
timeout - the timeout in seconds or 0 if no timeout should be usedpublic void setReportInterval(int seconds)
seconds - time after which progress should be reported.public void processItemDocument(org.wikidata.wdtk.datamodel.interfaces.ItemDocument itemDocument)
processItemDocument in interface org.wikidata.wdtk.datamodel.interfaces.EntityDocumentProcessorpublic void processPropertyDocument(org.wikidata.wdtk.datamodel.interfaces.PropertyDocument propertyDocument)
processPropertyDocument in interface org.wikidata.wdtk.datamodel.interfaces.EntityDocumentProcessorpublic void open()
open in interface org.wikidata.wdtk.datamodel.interfaces.EntityDocumentDumpProcessorpublic void close()
close in interface org.wikidata.wdtk.datamodel.interfaces.EntityDocumentDumpProcessorCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage