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) |
protected HashMap<String,Serializable> |
getRandomProperties(String title) |
int |
getShard(DocumentMessage message,
int shards)
Returns a shard index associated with the
Message . |
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 getShard(DocumentMessage message, int shards)
ProducerIterator
Message
.
The value returned must be between 0 and lower than shards.message
- the message to shardshards
- the number of shardspublic boolean hasNext()
public DocumentMessage next()
protected HashMap<String,Serializable> getRandomProperties(String title)
protected String getGaussian(String[] words)
Copyright © 2017 Nuxeo. All rights reserved.