Class FileBlobMessageProducer
java.lang.Object
org.nuxeo.lib.stream.pattern.producer.AbstractProducer<BlobMessage>
org.nuxeo.importer.stream.producer.FileBlobMessageProducer
- All Implemented Interfaces:
AutoCloseable,Iterator<BlobMessage>,ProducerIterator<BlobMessage>
Use a listing file to generate BlobMessage.
- Since:
- 9.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected longprotected final Fileprotected final longFields inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
producerId -
Constructor Summary
ConstructorsConstructorDescriptionFileBlobMessageProducer(int producerId, File listFile, String basePath, long nbBlobs) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidintgetPartition(BlobMessage message, int partitions) Returns a partition associated with theMessage.booleanhasNext()next()Methods inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
getProducerIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemainingMethods inherited from interface org.nuxeo.lib.stream.pattern.producer.ProducerIterator
remove
-
Field Details
-
listFile
-
basePath
-
count
protected long count -
nbBlobs
protected final long nbBlobs -
fileIterator
-
lines
-
-
Constructor Details
-
FileBlobMessageProducer
-
-
Method Details
-
getFileIterator
protected void getFileIterator() -
getPartition
Description copied from interface:ProducerIteratorReturns a partition associated with theMessage. The value returned must be between 0 and lower than partitions.- Parameters:
message- the message to shardpartitions- the number of partitions
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classAbstractProducer<BlobMessage>- Throws:
Exception
-
hasNext
public boolean hasNext() -
next
-