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>

public class FileBlobMessageProducer extends AbstractProducer<BlobMessage>
Use a listing file to generate BlobMessage.
Since:
9.1
  • Field Details

    • listFile

      protected final File listFile
    • basePath

      protected final String basePath
    • count

      protected long count
    • nbBlobs

      protected final long nbBlobs
    • fileIterator

      protected Iterator<String> fileIterator
    • lines

      protected Stream<String> lines
  • Constructor Details

    • FileBlobMessageProducer

      public FileBlobMessageProducer(int producerId, File listFile, String basePath, long nbBlobs)
  • Method Details

    • getFileIterator

      protected void getFileIterator()
    • 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
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class AbstractProducer<BlobMessage>
      Throws:
      Exception
    • hasNext

      public boolean hasNext()
    • next

      public BlobMessage next()