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>

public class RandomStringBlobMessageProducer extends AbstractProducer<BlobMessage>
Build random StringBlob message.
Since:
9.1
  • Field Details

    • DEFAULT_MIME_TYPE

      protected static final String DEFAULT_MIME_TYPE
      See Also:
    • nbBlobs

      protected final long nbBlobs
    • averageSizeKB

      protected final int averageSizeKB
    • rand

      protected final ThreadLocalRandom rand
    • marker

      protected final String marker
    • count

      protected long count
    • gen

      protected static RandomTextGenerator gen
    • mimetype

      protected final String mimetype
  • Constructor Details

    • RandomStringBlobMessageProducer

      public RandomStringBlobMessageProducer(int producerId, long nbBlobs, String lang, int averageSizeKB, String marker)
  • Method Details

    • getPartition

      public int getPartition(BlobMessage message, int partitions)
      Description copied from interface: ProducerIterator
      Returns a partition associated with the Message. The value returned must be between 0 and lower than partitions.
      Parameters:
      message - the message to shard
      partitions - the number of partitions
    • hasNext

      public boolean hasNext()
    • next

      public BlobMessage next()
    • generateFilename

      protected String generateFilename()
    • generateContent

      protected String generateContent()