public class RandomDocumentMessageProducer extends AbstractProducer<DocumentMessage>
Modifier and Type | Field and Description |
---|---|
protected static String[] |
DC_COVERAGE |
protected static String[] |
DC_LANGUAGE |
protected static String[] |
DC_NATURE |
protected static String[] |
DC_RIGHTS |
protected static String[] |
DC_SOURCE |
protected static String[] |
DC_SUBJECTS |
Constructor and Description |
---|
RandomDocumentMessageProducer(int producerId,
long nbDocuments,
String lang,
Path blobInfoDirectory) |
Modifier and Type | Method and Description |
---|---|
RandomDocumentMessageProducer |
countFolderAsDocument(boolean value) |
protected String |
getGaussian(String[] words) |
int |
getPartition(DocumentMessage message,
int partitions)
Returns a partition associated with the
Message . |
protected HashMap<String,Serializable> |
getRandomProperties(String title) |
boolean |
hasNext() |
DocumentMessage |
next() |
RandomDocumentMessageProducer |
setMaxDocumentsPerFolder(int max) |
RandomDocumentMessageProducer |
setMaxFoldersPerFolder(int max) |
RandomDocumentMessageProducer |
withBlob(int sizeKB,
boolean onlyText) |
close, getProducerId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
remove
forEachRemaining
protected static final String[] DC_SUBJECTS
protected static final String[] DC_LANGUAGE
protected static final String[] DC_COVERAGE
public RandomDocumentMessageProducer(int producerId, long nbDocuments, String lang, Path blobInfoDirectory)
public RandomDocumentMessageProducer setMaxFoldersPerFolder(int max)
public RandomDocumentMessageProducer setMaxDocumentsPerFolder(int max)
public RandomDocumentMessageProducer countFolderAsDocument(boolean value)
public RandomDocumentMessageProducer withBlob(int sizeKB, boolean onlyText)
public int getPartition(DocumentMessage 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 DocumentMessage next()
protected HashMap<String,Serializable> getRandomProperties(String title)
protected String getGaussian(String[] words)
Copyright © 2017 Nuxeo. All rights reserved.