Skip to content
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

feat: introduce java.time methods and variables #1671

Merged
merged 6 commits into from
Nov 28, 2024

Conversation

diegomarquezp
Copy link
Contributor

This PR introduces java.time alternatives to existing org.threeten.bp.* methods, as well as switching internal variables (if any) to java.time

The main constraint is to keep the changes backwards compatible, so for each existing threeten method "method1(org.threeten.bp.Duration)" we will add an alternative with a Duration (or Timestamp when applicable) suffix: "method1Duration(java.time.Duration)".

For most cases, the implementation will be held in the java.time method and the old threeten method will just delegate the call to it. However, for the case of abstract classes, the implementation will be kept in the threeten method to avoid breaking changes (i.e. users that already overloaded the method in their user code).

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: datastore Issues related to the googleapis/java-datastore API. labels Nov 19, 2024
@diegomarquezp diegomarquezp marked this pull request as ready for review November 19, 2024 19:05
@diegomarquezp diegomarquezp requested review from a team as code owners November 19, 2024 19:05
/** Returns the total time to execute the query in the backend. */
public Duration getExecutionDuration() {
public java.time.Duration getExecutionDurationDuration() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see DurationDuration here as well. Hmm, let's see if we can a way to work around this.

Copy link
Contributor Author

@diegomarquezp diegomarquezp Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a couple ideas:

  • getExecutionDurationJavaTime
  • getExecutionDurationJT
  • getExecutionJavaTimeDuration

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think either getExecutionDurationJavaTime or getExecutionJavaTimeDuration should work. JT might be confusing to know that JT references java.time.

I think getExecutionDurationJavaTime actually sounds better since it keeps the original method name together getExecutionTime. Let's get Cindy and the Storage SME to agree since I think we should be consistent on the choice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like getExecutionJavaTimeDuration the best since it has the same suffix as other methods. But either getExecutionJavaTimeDuration or getExecutionDurationJavaTime sounds good to me. We can follow the same decision for Java-storage.

Copy link
Contributor

@lqiu96 lqiu96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once we settle JavaTimeDuration or DurationJavaTime

@diegomarquezp diegomarquezp added the automerge Merge the pull request once unit tests and other checks pass. label Nov 27, 2024
@gcf-merge-on-green gcf-merge-on-green bot merged commit 5a78a80 into main Nov 28, 2024
23 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Nov 28, 2024
@gcf-merge-on-green gcf-merge-on-green bot deleted the introduce-java-time branch November 28, 2024 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/java-datastore API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants