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() |
getProducerId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
remove
forEachRemaining
protected 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)
ProducerIterator
Message
. 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 AutoCloseable
close
in class AbstractProducer<BlobMessage>
Exception
public boolean hasNext()
public BlobMessage next()
Copyright © 2018 Nuxeo. All rights reserved.