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
Modifier and TypeFieldDescriptionstatic final int
Used to generate a big number of children nodes whennonUniformRepartition
istrue
.protected static Integer
protected static final boolean
protected 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 int
protected boolean
protected static RandomTextGenerator
protected int
protected int
static final int
protected static int
protected static int
protected static int
protected String
protected static AtomicInteger
protected static AtomicInteger
protected static AtomicInteger
protected static boolean
Used ingetMaxChildren()
andgetMaxFolderish()
.protected boolean
protected static final Random
protected static AtomicLong
static final int
Used to generate a small number of children nodes whennonUniformRepartition
istrue
.protected boolean
-
Constructor Summary
ConstructorDescriptionRandomTextSourceNode
(boolean folderish, int level, int idx, boolean onlyText) RandomTextSourceNode
(boolean folderish, int level, int idx, boolean onlyText, boolean withProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
getGaussian
(String[] words) int
getLevel()
protected int
protected int
protected int
getMidRandom
(int target) getName()
static Integer
protected int
getNonUniform
(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 Long
getSize()
static RandomTextSourceNode
init
(int maxSize) static RandomTextSourceNode
static RandomTextSourceNode
init
(int maxSize, Integer blobSizeInKB, boolean onlyText, boolean nonUniform, boolean withProperties, String lang) static RandomTextSourceNode
init
(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 whennonUniformRepartition
istrue
.- See Also:
-
SMALL_NB_BODES_DIVIDER
public static final int SMALL_NB_BODES_DIVIDERUsed to generate a small number of children nodes whennonUniformRepartition
istrue
.- 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:
getBlobHolder
in 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:
getChildren
in interfaceSourceNode
-
getName
- Specified by:
getName
in interfaceSourceNode
-
isFolderish
public boolean isFolderish()- Specified by:
isFolderish
in interfaceSourceNode
-
getNbNodes
-
getSize
-
getLevel
public int getLevel() -
getSourcePath
- Specified by:
getSourcePath
in interfaceSourceNode
-