|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.tool.Scan.PayloadAccumulator
protected static class Scan.PayloadAccumulator
An accumulator for payloads.
This class is essentially a stripped-down version of Scan
that just accumulate
payloads in a bitstream and releases them in batches. The main difference is that neither
sizes nor occurrencies are saved (as they would not make much sense).
Field Summary | |
---|---|
protected IntArrayList |
cutPoints
The cutpoints of the batches (for building later a ContiguousDocumentalStrategy ). |
Constructor Summary | |
---|---|
Scan.PayloadAccumulator(IOFactory ioFactory,
String basename,
Payload payload,
String field,
Scan.IndexingType indexingType,
int documentsPerBatch,
File batchDir)
Creates a new accumulator. |
Method Summary | |
---|---|
void |
close()
Closes this accumulator, releasing all resources. |
void |
processData(int documentPointer,
Object content)
Processes the payload of a given document. |
protected void |
writeData()
Writes in compressed form the data currently accumulated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final IntArrayList cutPoints
ContiguousDocumentalStrategy
).
Constructor Detail |
---|
public Scan.PayloadAccumulator(IOFactory ioFactory, String basename, Payload payload, String field, Scan.IndexingType indexingType, int documentsPerBatch, File batchDir)
ioFactory
- the factory that will be used to perform I/O.basename
- the basename (usually a global filename followed by the field name,
separated by a dash).payload
- the payload stored by this accumulator.field
- the name of the accumulated field.indexingType
- the type of indexing procedure.documentsPerBatch
- the number of documents in each batch.batchDir
- a directory for batch files; batch names will be relativised to this
directory if it is not null
.Method Detail |
---|
protected void writeData() throws IOException, ConfigurationException
IOException
ConfigurationException
public void processData(int documentPointer, Object content) throws IOException
documentPointer
- the document pointer.content
- the payload.
IOException
public void close() throws ConfigurationException, IOException
ConfigurationException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |