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>
public class FileBlobMessageProducer extends AbstractProducer<BlobMessage>
Use a listing file to generate BlobMessage.- Since:
 - 9.1
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected StringbasePathprotected longcountprotected Iterator<String>fileIteratorprotected Stream<String>linesprotected FilelistFileprotected longnbBlobs- 
Fields inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
producerId 
 - 
 
- 
Constructor Summary
Constructors Constructor Description FileBlobMessageProducer(int producerId, File listFile, String basePath, long nbBlobs) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidgetFileIterator()intgetPartition(BlobMessage message, int partitions)Returns a partition associated with theMessage.booleanhasNext()BlobMessagenext()- 
Methods inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
getProducerId 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface java.util.Iterator
forEachRemaining 
- 
Methods inherited from interface org.nuxeo.lib.stream.pattern.producer.ProducerIterator
remove 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
FileBlobMessageProducer
public FileBlobMessageProducer(int producerId, File listFile, String basePath, long nbBlobs)
 
 - 
 
- 
Method Detail
- 
getFileIterator
protected void getFileIterator()
 
- 
getPartition
public int getPartition(BlobMessage message, int partitions)
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
public void close() throws Exception
- Specified by:
 closein interfaceAutoCloseable- Overrides:
 closein classAbstractProducer<BlobMessage>- Throws:
 Exception
 
- 
hasNext
public boolean hasNext()
 
- 
next
public BlobMessage next()
 
 - 
 
 -