-
-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add construct()
methods to specify the milliseconds being used for time-based UUID generation
#84
Conversation
…ed UUID generation. This is useful for migrating existing sets of data which include a timestamp, but don't use ordered UUID values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will check again later on and merge unless I find concerns (unlikely but just in case).
return generate(_clock.currentTimeMillis()); | ||
} | ||
|
||
public UUID generate(long rawTimestamp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this as construct()
, since it's not fully generating any more.
Also add Javadoc with @since 4.3
to indicate addition.
return generate(rawTimestamp); | ||
} | ||
|
||
public UUID generate(long rawTimestamp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here as above.
Plus can avoid assignment and just call construct(_timer.getTimestamp());
Ok, aside from 2 comments one missing thing: With those I'm happy to merge this! |
- add @SInCE in javadoc - rename generate to construct - include new api in TimeBasedReorderedGenerator
Have made updates based on PR review. |
construct()
methods to specify the milliseconds being used for time-based UUID generation
This is useful for migrating existing sets of data which include a timestamp, but don't use ordered UUID values.