public class FileBlobMessageProducer extends AbstractProducer<BlobMessage>
| Modifier and Type | Field and Description |
|---|---|
protected String |
basePath |
protected long |
count |
protected Iterator<String> |
fileIterator |
protected Stream<String> |
lines |
protected File |
listFile |
protected long |
nbBlobs |
producerId| Constructor and Description |
|---|
FileBlobMessageProducer(int producerId,
File listFile,
String basePath,
long nbBlobs) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
getFileIterator() |
int |
getPartition(BlobMessage message,
int partitions)
Returns a partition associated with the
Message. |
boolean |
hasNext() |
BlobMessage |
next() |
getProducerIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitremoveforEachRemainingprotected long count
protected final long nbBlobs
protected Iterator<String> fileIterator
public FileBlobMessageProducer(int producerId, File listFile, String basePath, long nbBlobs)
protected void getFileIterator()
public int getPartition(BlobMessage message, int partitions)
ProducerIteratorMessage. The value returned must be between 0 and lower than
partitions.message - the message to shardpartitions - the number of partitionspublic void close() throws Exception
close in interface AutoCloseableclose in class AbstractProducer<BlobMessage>Exceptionpublic boolean hasNext()
public BlobMessage next()
Copyright © 2019 Nuxeo. All rights reserved.