Sets the end time for the query. If this isn't set, the system time will be used when the query is executed or #getEndTime is called @param timestamp Unix epoch timestamp in seconds or milliseconds @throws IllegalArgumentException if the timestamp is invalid or less than the start time (if s
(final long timestamp)
| 296 | * than the start time (if set) |
| 297 | */ |
| 298 | @Override |
| 299 | public void setEndTime(final long timestamp) { |
| 300 | if (timestamp < 0 || ((timestamp & Const.SECOND_MASK) != 0 && |
| 301 | timestamp > 9999999999999L)) { |
| 302 | throw new IllegalArgumentException("Invalid timestamp: " + timestamp); |
| 303 | } else if (start_time != UNSET && timestamp <= getStartTime()) { |
| 304 | throw new IllegalArgumentException("new end time (" + timestamp |
| 305 | + ") is less than or equal to start time: " + getStartTime()); |
| 306 | } |
| 307 | end_time = timestamp; |
| 308 | } |
| 309 | |
| 310 | /** @return the configured end time. If the end time hasn't been set, the |
| 311 | * current system time will be stored and returned. |