Package org.apache.solr.bench.generators
Class DatesDSL
java.lang.Object
org.apache.solr.bench.generators.DatesDSL
A Class for creating Date Sources that will produce Dates based on the number of milliseconds
since epoch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()withMilliseconds(long millisecondsFromEpoch) Generates Dates inclusively bounded between January 1, 1970, 00:00:00 GMT and new Date(milliSecondsFromEpoch).withMillisecondsBetween(long millisecondsFromEpochStartInclusive, long millisecondsFromEpochEndInclusive) Generates Dates inclusively bounded between new Date(millisecondsFromEpochStartInclusive) and new Date(millisecondsFromEpochEndInclusive).
-
Constructor Details
-
DatesDSL
public DatesDSL()
-
-
Method Details
-
all
-
withMilliseconds
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
-