Package org.apache.solr.bench.generators
Class DatesDSL
- java.lang.Object
-
- org.apache.solr.bench.generators.DatesDSL
-
public class DatesDSL extends Object
A Class for creating Date Sources that will produce Dates based on the number of milliseconds since epoch
-
-
Constructor Summary
Constructors Constructor Description DatesDSL()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SolrGen<Date>
all()
SolrGen<Date>
withMilliseconds(long millisecondsFromEpoch)
Generates Dates inclusively bounded between January 1, 1970, 00:00:00 GMT and new Date(milliSecondsFromEpoch).SolrGen<Date>
withMillisecondsBetween(long millisecondsFromEpochStartInclusive, long millisecondsFromEpochEndInclusive)
Generates Dates inclusively bounded between new Date(millisecondsFromEpochStartInclusive) and new Date(millisecondsFromEpochEndInclusive).
-
-
-
Method Detail
-
withMilliseconds
public SolrGen<Date> withMilliseconds(long millisecondsFromEpoch)
Generates Dates inclusively bounded between January 1, 1970, 00:00:00 GMT and new Date(milliSecondsFromEpoch). The Source restricts Date generation, so that no Dates before 1970 can be created. The Source is weighted, so it is likely to produce new Date(millisecondsFromEpoch) one or more times.- Parameters:
millisecondsFromEpoch
- the number of milliseconds from the epoch such that Dates are generated within this interval.- Returns:
- a Source of type Date
-
withMillisecondsBetween
public SolrGen<Date> withMillisecondsBetween(long millisecondsFromEpochStartInclusive, long millisecondsFromEpochEndInclusive)
Generates Dates inclusively bounded between new Date(millisecondsFromEpochStartInclusive) and new Date(millisecondsFromEpochEndInclusive).- Parameters:
millisecondsFromEpochStartInclusive
- the number of milliseconds from epoch for the desired older DatemillisecondsFromEpochEndInclusive
- the number of milliseconds from epoch for the desired more recent Date- Returns:
- a source of Dates
-
-