Class RandomStringBlobMessageProducer
java.lang.Object
org.nuxeo.lib.stream.pattern.producer.AbstractProducer<BlobMessage>
org.nuxeo.importer.stream.producer.RandomStringBlobMessageProducer
- All Implemented Interfaces:
AutoCloseable,Iterator<BlobMessage>,ProducerIterator<BlobMessage>
Build random StringBlob message.
- Since:
- 9.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intprotected longprotected static final Stringprotected static RandomTextGeneratorprotected final Stringprotected final Stringprotected final longprotected final ThreadLocalRandomFields inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
producerId -
Constructor Summary
ConstructorsConstructorDescriptionRandomStringBlobMessageProducer(int producerId, long nbBlobs, String lang, int averageSizeKB, String marker) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected StringintgetPartition(BlobMessage message, int partitions) Returns a partition associated with theMessage.booleanhasNext()next()Methods inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
close, 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
-
DEFAULT_MIME_TYPE
- See Also:
-
nbBlobs
protected final long nbBlobs -
averageSizeKB
protected final int averageSizeKB -
rand
-
marker
-
count
protected long count -
gen
-
mimetype
-
-
Constructor Details
-
RandomStringBlobMessageProducer
-
-
Method Details
-
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
-
hasNext
public boolean hasNext() -
next
-
generateFilename
-
generateContent
-