Class DataGenerator


  • public class DataGenerator
    extends Object
    • Constructor Detail

      • DataGenerator

        public DataGenerator​(List<GeneratorColumnSchema> columnSchemas,
                             long seed,
                             long startTime,
                             int numConsecutiveTimestamps,
                             Double timestampIncrement)
      • DataGenerator

        public DataGenerator​(List<GeneratorColumnSchema> columnSchemas,
                             long seed,
                             org.joda.time.Interval interval,
                             int numRows)
    • Method Detail

      • reset

        public DataGenerator reset​(long seed)
        Reset this generator to start from the begining of the interval with a new seed.
        Parameters:
        seed - the new seed to generate rows from
      • addStreamToIndex

        public static void addStreamToIndex​(Stream<InputRow> stream,
                                            IncrementalIndex index)
        Add rows from any generator to an index.
        Parameters:
        stream - the stream of rows to add
        index - the index to add rows to
      • addToIndex

        public void addToIndex​(IncrementalIndex index,
                               int numOfRows)
        Add rows from this generator to an index.
        Parameters:
        index - the index to add rows to
        numOfRows - the number of rows to add
      • toList

        public List<InputRow> toList​(int numOfRows)
        Put rows from this generator to a list.
        Parameters:
        numOfRows - the number of rows to put in the list
        Returns:
        a List of InputRow