Avoid MIN_VALUE
and MAX_VALUE
from Timestamps
#1544
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset addresses test code, which used easily-reached constants
Timestamps.MIN_VALUE
andTimestamps.MAX_VALUE
.The problem with using these constants is that on a Storage level, we convert those to nanoseconds — as it is a part of our mechanism on providing signal ordering within a single JVM (see emulated nanos in
Time
). But the mentioned constants defined byTimestamps
cannot be converted to nanos, as the proposed Java type islong
, and it is not long enough to store such values.Ultimately, in Storage implementations, using these constants led to
long
overflow.Besides,
MIN_VALUE
corresponds to 1 CE, andMAX_VALUE
corresponds to year 9999. Both of which aren't widely used in event-sourced applications at the moment. We'll see how it goes, but for now it's definitely an overkill.This PR migrates the test code to using more meaningful
Timestamp
values.