Class RandomTextSourceNode

java.lang.Object
org.nuxeo.ecm.platform.importer.source.RandomTextSourceNode
All Implemented Interfaces:
SourceNode

public class RandomTextSourceNode extends Object implements SourceNode
Random SourceNode to be used for load testing
Author:
Thierry Delprat
  • Field Details

    • gen

      protected static RandomTextGenerator gen
    • maxNode

      protected static int maxNode
    • nonUniformRepartition

      protected static boolean nonUniformRepartition
    • 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_FACTOR
      Used to generate a big number of children nodes when nonUniformRepartition is true.
      See Also:
    • SMALL_NB_BODES_DIVIDER

      public static final int SMALL_NB_BODES_DIVIDER
      Used to generate a small number of children nodes when nonUniformRepartition is true.
      See Also:
    • minGlobalFolders

      protected static int minGlobalFolders
    • minFoldersPerNode

      protected static int minFoldersPerNode
    • nbNodes

      protected static AtomicInteger nbNodes
    • nbFolders

      protected static AtomicInteger nbFolders
    • nbVisitedFolders

      protected static AtomicInteger nbVisitedFolders
    • size

      protected static AtomicLong size
    • RANDOM

      protected static final Random RANDOM
    • name

      protected String name
    • folderish

      protected boolean folderish
    • level

      protected int level
    • idx

      protected int idx
    • blobSizeInKB

      protected static Integer blobSizeInKB
    • cachedChildren

      protected List<SourceNode> cachedChildren
    • CACHE_CHILDREN

      protected static final boolean CACHE_CHILDREN
      See Also:
    • onlyText

      protected boolean onlyText
    • withProperties

      protected boolean withProperties
    • DC_NATURE

      protected static final String[] DC_NATURE
    • DC_SUBJECTS

      protected static final String[] DC_SUBJECTS
    • DC_RIGHTS

      protected static final String[] DC_RIGHTS
    • DC_LANGUAGE

      protected static final String[] DC_LANGUAGE
    • DC_SOURCE

      protected static final String[] DC_SOURCE
    • DC_COVERAGE

      protected static final String[] 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

      public static RandomTextSourceNode init(int maxSize)
    • init

      public static RandomTextSourceNode init(int maxSize, Integer blobSizeInKB, boolean onlyText)
    • 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

      protected String getBlobMimeType()
    • getBlobHolder

      public BlobHolder getBlobHolder()
      Specified by:
      getBlobHolder in interface SourceNode
    • getRandomProperties

      protected Map<String,Serializable> getRandomProperties(String content)
    • getGaussian

      protected String getGaussian(String[] words)
    • 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:
    • getMaxChildren

      protected int getMaxChildren()
    • getMaxFolderish

      protected int getMaxFolderish()
    • getChildren

      public List<SourceNode> getChildren()
      Specified by:
      getChildren in interface SourceNode
    • getName

      public String getName()
      Specified by:
      getName in interface SourceNode
    • isFolderish

      public boolean isFolderish()
      Specified by:
      isFolderish in interface SourceNode
    • getNbNodes

      public static Integer getNbNodes()
    • getSize

      public static Long getSize()
    • getLevel

      public int getLevel()
    • getSourcePath

      public String getSourcePath()
      Specified by:
      getSourcePath in interface SourceNode