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
Modifier and TypeFieldDescriptionprotected final int
protected long
protected static final String
protected static RandomTextGenerator
protected final String
protected final String
protected final long
protected final ThreadLocalRandom
Fields inherited from class org.nuxeo.lib.stream.pattern.producer.AbstractProducer
producerId
-
Constructor Summary
ConstructorDescriptionRandomStringBlobMessageProducer
(int producerId, long nbBlobs, String lang, int averageSizeKB, String marker) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
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
close, 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
-
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: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
-
hasNext
public boolean hasNext() -
next
-
generateFilename
-
generateContent
-