public class RandomTextSourceNode extends Object implements SourceNode
SourceNode
to be used for load testingModifier and Type | Field and Description |
---|---|
static int |
BIG_NB_NODES_FACTOR
Used to generate a big number of children nodes when
nonUniformRepartition is true . |
protected static Integer |
blobSizeInKB |
protected static boolean |
CACHE_CHILDREN |
protected List<SourceNode> |
cachedChildren |
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 |
static int |
DEFAULT_NB_DATA_NODES_PER_FOLDER |
protected boolean |
folderish |
protected static RandomTextGenerator |
gen |
protected Random |
hazard |
protected int |
idx |
protected int |
level |
static int |
MAX_DEPTH |
protected static int |
maxNode |
protected static int |
minFoldersPerNode |
protected static int |
minGlobalFolders |
protected String |
name |
protected static AtomicInteger |
nbFolders |
protected static AtomicInteger |
nbNodes |
protected static AtomicInteger |
nbVisitedFolders |
protected static boolean |
nonUniformRepartition
Used in
getMaxChildren() and getMaxFolderish() . |
protected boolean |
onlyText |
protected static AtomicLong |
size |
static int |
SMALL_NB_BODES_DIVIDER
Used to generate a small number of children nodes when
nonUniformRepartition is true . |
protected boolean |
withProperties |
Constructor and Description |
---|
RandomTextSourceNode(boolean folderish,
int level,
int idx,
boolean onlyText) |
RandomTextSourceNode(boolean folderish,
int level,
int idx,
boolean onlyText,
boolean withProperties) |
Modifier and Type | Method and Description |
---|---|
BlobHolder |
getBlobHolder() |
protected String |
getBlobMimeType() |
List<SourceNode> |
getChildren() |
protected String |
getGaussian(String[] words) |
int |
getLevel() |
protected int |
getMaxChildren() |
protected int |
getMaxFolderish() |
protected int |
getMidRandom(int target) |
String |
getName() |
static Integer |
getNbNodes() |
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() |
String |
getSourcePath() |
static RandomTextSourceNode |
init(int maxSize) |
static RandomTextSourceNode |
init(int maxSize,
Integer blobSizeInKB,
boolean onlyText) |
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 |
isFolderish() |
protected static RandomTextGenerator gen
protected static int maxNode
protected static boolean nonUniformRepartition
getMaxChildren()
and getMaxFolderish()
.public static final int MAX_DEPTH
public static final int DEFAULT_NB_DATA_NODES_PER_FOLDER
public static final int BIG_NB_NODES_FACTOR
nonUniformRepartition
is true
.public static final int SMALL_NB_BODES_DIVIDER
nonUniformRepartition
is true
.protected static int minGlobalFolders
protected static int minFoldersPerNode
protected static AtomicInteger nbNodes
protected static AtomicInteger nbFolders
protected static AtomicInteger nbVisitedFolders
protected static AtomicLong size
protected boolean folderish
protected int level
protected int idx
protected static Integer blobSizeInKB
protected List<SourceNode> cachedChildren
protected static final boolean CACHE_CHILDREN
protected boolean onlyText
protected boolean withProperties
protected static final String[] DC_SUBJECTS
protected static final String[] DC_LANGUAGE
protected static final String[] DC_COVERAGE
public RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText, boolean withProperties)
public RandomTextSourceNode(boolean folderish, int level, int idx, boolean onlyText)
public static RandomTextSourceNode init(int maxSize)
public static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText)
public static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText, boolean nonUniform, boolean withProperties, String lang)
public static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText, DictionaryHolder dictionaryHolder, boolean nonUniform, boolean withProperties)
protected String getBlobMimeType()
public BlobHolder getBlobHolder()
getBlobHolder
in interface SourceNode
protected Map<String,Serializable> getRandomProperties(String content)
protected String getGaussian(String[] words)
protected int getMidRandom(int target)
protected int getNonUniform(int target, boolean folderish)
SMALL_NB_BODES_DIVIDER
.BIG_NB_NODES_FACTOR
.protected int getMaxChildren()
protected int getMaxFolderish()
public List<SourceNode> getChildren()
getChildren
in interface SourceNode
public String getName()
getName
in interface SourceNode
public boolean isFolderish()
isFolderish
in interface SourceNode
public static Integer getNbNodes()
public int getLevel()
public String getSourcePath()
getSourcePath
in interface SourceNode
Copyright © 2018 Nuxeo. All rights reserved.