Class RandomTextSourceNode
java.lang.Object
org.nuxeo.ecm.platform.importer.source.RandomTextSourceNode
- All Implemented Interfaces:
- SourceNode
Random 
SourceNode to be used for load testing- Author:
- Thierry Delprat
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intUsed to generate a big number of children nodes whennonUniformRepartitionistrue.protected static Integerprotected static final booleanprotected List<SourceNode>protected static final String[]protected static final String[]protected static final String[]protected static final String[]protected static final String[]protected static final String[]static final intprotected booleanprotected static RandomTextGeneratorprotected intprotected intstatic final intprotected static intprotected static intprotected static intprotected Stringprotected static AtomicIntegerprotected static AtomicIntegerprotected static AtomicIntegerprotected static booleanUsed ingetMaxChildren()andgetMaxFolderish().protected booleanprotected static final Randomprotected static AtomicLongstatic final intUsed to generate a small number of children nodes whennonUniformRepartitionistrue.protected boolean
- 
Constructor SummaryConstructorsConstructorDescriptionRandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText) RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText, boolean withProperties) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected Stringprotected StringgetGaussian(String[] words) intgetLevel()protected intprotected intprotected intgetMidRandom(int target) getName()static Integerprotected intgetNonUniform(int target, boolean folderish) Allows to get a non uniform distribution of the number of nodes per folder.protected Map<String,Serializable> getRandomProperties(String content) static LonggetSize()static RandomTextSourceNodeinit(int maxSize) static RandomTextSourceNodestatic RandomTextSourceNodeinit(int maxSize, Integer blobSizeInKB, boolean onlyText, boolean nonUniform, boolean withProperties, String lang) static RandomTextSourceNodeinit(int maxSize, Integer blobSizeInKB, boolean onlyText, DictionaryHolder dictionaryHolder, boolean nonUniform, boolean withProperties) boolean
- 
Field Details- 
gen
- 
maxNodeprotected static int maxNode
- 
nonUniformRepartitionprotected static boolean nonUniformRepartitionUsed ingetMaxChildren()andgetMaxFolderish().
- 
MAX_DEPTHpublic static final int MAX_DEPTH- See Also:
 
- 
DEFAULT_NB_DATA_NODES_PER_FOLDERpublic static final int DEFAULT_NB_DATA_NODES_PER_FOLDER- See Also:
 
- 
BIG_NB_NODES_FACTORpublic static final int BIG_NB_NODES_FACTORUsed to generate a big number of children nodes whennonUniformRepartitionistrue.- See Also:
 
- 
SMALL_NB_BODES_DIVIDERpublic static final int SMALL_NB_BODES_DIVIDERUsed to generate a small number of children nodes whennonUniformRepartitionistrue.- See Also:
 
- 
minGlobalFoldersprotected static int minGlobalFolders
- 
minFoldersPerNodeprotected static int minFoldersPerNode
- 
nbNodes
- 
nbFolders
- 
nbVisitedFolders
- 
size
- 
RANDOM
- 
name
- 
folderishprotected boolean folderish
- 
levelprotected int level
- 
idxprotected int idx
- 
blobSizeInKB
- 
cachedChildren
- 
CACHE_CHILDRENprotected static final boolean CACHE_CHILDREN- See Also:
 
- 
onlyTextprotected boolean onlyText
- 
withPropertiesprotected boolean withProperties
- 
DC_NATURE
- 
DC_SUBJECTS
- 
DC_RIGHTS
- 
DC_LANGUAGE
- 
DC_SOURCE
- 
DC_COVERAGE
 
- 
- 
Constructor Details- 
RandomTextSourceNodepublic RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText, boolean withProperties) 
- 
RandomTextSourceNodepublic RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText) 
 
- 
- 
Method Details- 
init
- 
init
- 
initpublic static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText, boolean nonUniform, boolean withProperties, String lang) 
- 
initpublic static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText, DictionaryHolder dictionaryHolder, boolean nonUniform, boolean withProperties) 
- 
getBlobMimeType
- 
getBlobHolder- Specified by:
- getBlobHolderin interface- SourceNode
 
- 
getRandomProperties
- 
getGaussian
- 
getMidRandomprotected int getMidRandom(int target) 
- 
getNonUniformprotected int getNonUniform(int target, boolean folderish) Allows to get a non uniform distribution of the number of nodes per folder. Returns:- A small number of nodes 10% of the time, see SMALL_NB_BODES_DIVIDER.
- A big number of nodes 10% of the time, see BIG_NB_NODES_FACTOR.
- A random variation of the target number of nodes 80% of the time.
 
- A small number of nodes 10% of the time, see 
- 
getMaxChildrenprotected int getMaxChildren()
- 
getMaxFolderishprotected int getMaxFolderish()
- 
getChildren- Specified by:
- getChildrenin interface- SourceNode
 
- 
getName- Specified by:
- getNamein interface- SourceNode
 
- 
isFolderishpublic boolean isFolderish()- Specified by:
- isFolderishin interface- SourceNode
 
- 
getNbNodes
- 
getSize
- 
getLevelpublic int getLevel()
- 
getSourcePath- Specified by:
- getSourcePathin interface- SourceNode
 
 
-