public class RandomStringBlobMessageProducer extends AbstractProducer<BlobMessage>
Modifier and Type | Field and Description |
---|---|
protected int |
averageSizeKB |
protected long |
count |
protected static String |
DEFAULT_MIME_TYPE |
protected static RandomTextGenerator |
gen |
protected String |
marker |
protected String |
mimetype |
protected long |
nbBlobs |
protected ThreadLocalRandom |
rand |
producerId
Constructor and Description |
---|
RandomStringBlobMessageProducer(int producerId,
long nbBlobs,
String lang,
int averageSizeKB,
String marker) |
Modifier and Type | Method and Description |
---|---|
protected String |
generateContent() |
protected String |
generateFilename() |
int |
getPartition(BlobMessage message,
int partitions)
Returns a partition associated with the
Message . |
boolean |
hasNext() |
BlobMessage |
next() |
close, getProducerId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
remove
forEachRemaining
protected static final String DEFAULT_MIME_TYPE
protected final long nbBlobs
protected final int averageSizeKB
protected final ThreadLocalRandom rand
protected long count
protected static RandomTextGenerator gen
public RandomStringBlobMessageProducer(int producerId, long nbBlobs, String lang, int averageSizeKB, String marker)
public int getPartition(BlobMessage message, int partitions)
ProducerIterator
Message
. The value returned must be between 0 and lower than
partitions.message
- the message to shardpartitions
- the number of partitionspublic boolean hasNext()
public BlobMessage next()
protected String generateFilename()
protected String generateContent()
Copyright © 2018 Nuxeo. All rights reserved.