Class DataGenerator
- java.lang.Object
-
- org.apache.druid.segment.generator.DataGenerator
-
public class DataGenerator extends Object
-
-
Constructor Summary
Constructors Constructor Description DataGenerator(List<GeneratorColumnSchema> columnSchemas, long seed, long startTime, int numConsecutiveTimestamps, Double timestampIncrement)DataGenerator(List<GeneratorColumnSchema> columnSchemas, long seed, org.joda.time.Interval interval, int numRows)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddStreamToIndex(Stream<InputRow> stream, IncrementalIndex index)Add rows from any generator to an index.voidaddToIndex(IncrementalIndex index, int numOfRows)Add rows from this generator to an index.Map<String,Object>nextRaw()Map<String,Object>nextRaw(String timestampColumn)InputRownextRow()DataGeneratorreset(long seed)Reset this generator to start from the begining of the interval with a new seed.List<InputRow>toList(int numOfRows)Put rows from this generator to a list.
-
-
-
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
-
nextRow
public InputRow nextRow()
-
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 addindex- 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 tonumOfRows- the number of rows to add
-
-