public class RandomDocumentMessageProducer extends AbstractProducer<DocumentMessage>
Modifier and Type | Class and Description |
---|---|
protected static class |
RandomDocumentMessageProducer.DocType |
Modifier and Type | Field and Description |
---|---|
protected BlobInfoFetcher |
blobInfoFetcher |
protected boolean |
blobOnlyText |
protected int |
blobSizeKB |
protected Set<String> |
children |
protected boolean |
countFolderAsDocument |
protected RandomDocumentMessageProducer.DocType |
currentType |
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 |
protected int |
documentCount |
protected int |
documentInCurrentFolderCount |
protected int |
documentInCurrentFolderLimit |
protected int |
folderCount |
protected List<String> |
folderishChildren |
protected int |
foldersInCurrentFolderLimit |
protected static RandomTextGenerator |
gen |
protected int |
maxDocumentsPerFolder |
protected int |
maxFoldersPerFolder |
protected long |
nbDocuments |
protected int |
parentIndex |
protected List<String> |
parents |
protected Random |
rand |
producerId
Constructor and Description |
---|
RandomDocumentMessageProducer(int producerId,
long nbDocuments,
String lang,
BlobInfoFetcher blobInfoFetcher) |
getProducerId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
remove
forEachRemaining
protected final long nbDocuments
protected final BlobInfoFetcher blobInfoFetcher
protected boolean countFolderAsDocument
protected int maxFoldersPerFolder
protected int maxDocumentsPerFolder
protected int blobSizeKB
protected boolean blobOnlyText
protected int documentCount
protected int folderCount
protected static RandomTextGenerator gen
protected static final String[] DC_SUBJECTS
protected static final String[] DC_LANGUAGE
protected static final String[] DC_COVERAGE
protected int foldersInCurrentFolderLimit
protected int documentInCurrentFolderLimit
protected RandomDocumentMessageProducer.DocType currentType
protected int parentIndex
protected List<String> folderishChildren
protected int documentInCurrentFolderCount
public RandomDocumentMessageProducer(int producerId, long nbDocuments, String lang, BlobInfoFetcher blobInfoFetcher)
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 DocumentMessage createRoot()
protected DocumentMessage createFolder(String parentPath, Set<String> exclude)
protected DocumentMessage createDocument(String parentPath, Set<String> exclude)
protected DocumentMessage getRandomNodeWithExclusion(String type, String parentPath, boolean withBlob, Set<String> exclude)
protected DocumentMessage getRandomNode(String type, String parentPath, boolean withBlob)
protected String getDocumentTypeForMimeType(String mimeType)
protected DocumentMessage getRandomNodeWithPrefix(String prefix, String type, String parentPath)
protected Blob getRandomBlob()
protected String getBlobMimeType()
protected String capitalize(String line)
protected HashMap<String,Serializable> getRandomProperties(String title)
protected String getGaussian(String[] words)
public void close() throws Exception
close
in interface AutoCloseable
close
in class AbstractProducer<DocumentMessage>
Exception
Copyright © 2019 Nuxeo. All rights reserved.