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
Modifier and TypeFieldDescriptionprotected final String
protected long
protected final File
protected final long
Fields inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
producerId
-
Constructor Summary
ConstructorDescriptionFileBlobMessageProducer
(int producerId, File listFile, String basePath, long nbBlobs) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
int
getPartition
(BlobMessage message, int partitions) Returns a partition associated with theMessage
.boolean
hasNext()
next()
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
-
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:ProducerIterator
Returns 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:
close
in interfaceAutoCloseable
- Overrides:
close
in classAbstractProducer<BlobMessage>
- Throws:
Exception
-
hasNext
public boolean hasNext() -
next
-