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 Summary
FieldsModifier 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 Summary
ConstructorsConstructorDescriptionRandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText) RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText, boolean withProperties) -
Method Summary
Modifier 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
-
maxNode
protected static int maxNode -
nonUniformRepartition
protected static boolean nonUniformRepartitionUsed ingetMaxChildren()andgetMaxFolderish(). -
MAX_DEPTH
public static final int MAX_DEPTH- See Also:
-
DEFAULT_NB_DATA_NODES_PER_FOLDER
public static final int DEFAULT_NB_DATA_NODES_PER_FOLDER- See Also:
-
BIG_NB_NODES_FACTOR
public static final int BIG_NB_NODES_FACTORUsed to generate a big number of children nodes whennonUniformRepartitionistrue.- See Also:
-
SMALL_NB_BODES_DIVIDER
public static final int SMALL_NB_BODES_DIVIDERUsed to generate a small number of children nodes whennonUniformRepartitionistrue.- See Also:
-
minGlobalFolders
protected static int minGlobalFolders -
minFoldersPerNode
protected static int minFoldersPerNode -
nbNodes
-
nbFolders
-
nbVisitedFolders
-
size
-
RANDOM
-
name
-
folderish
protected boolean folderish -
level
protected int level -
idx
protected int idx -
blobSizeInKB
-
cachedChildren
-
CACHE_CHILDREN
protected static final boolean CACHE_CHILDREN- See Also:
-
onlyText
protected boolean onlyText -
withProperties
protected boolean withProperties -
DC_NATURE
-
DC_SUBJECTS
-
DC_RIGHTS
-
DC_LANGUAGE
-
DC_SOURCE
-
DC_COVERAGE
-
-
Constructor Details
-
RandomTextSourceNode
public RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText, boolean withProperties) -
RandomTextSourceNode
public RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText)
-
-
Method Details
-
init
-
init
-
init
public static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText, boolean nonUniform, boolean withProperties, String lang) -
init
public static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText, DictionaryHolder dictionaryHolder, boolean nonUniform, boolean withProperties) -
getBlobMimeType
-
getBlobHolder
- Specified by:
getBlobHolderin interfaceSourceNode
-
getRandomProperties
-
getGaussian
-
getMidRandom
protected int getMidRandom(int target) -
getNonUniform
protected 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
-
getMaxChildren
protected int getMaxChildren() -
getMaxFolderish
protected int getMaxFolderish() -
getChildren
- Specified by:
getChildrenin interfaceSourceNode
-
getName
- Specified by:
getNamein interfaceSourceNode
-
isFolderish
public boolean isFolderish()- Specified by:
isFolderishin interfaceSourceNode
-
getNbNodes
-
getSize
-
getLevel
public int getLevel() -
getSourcePath
- Specified by:
getSourcePathin interfaceSourceNode
-