Skip to content

Remove deprecated GpuTimeZoneDB methods#4422

Merged
res-life merged 1 commit intoNVIDIA:mainfrom
res-life:chongg/remove-deprecated-gputimezonedb-methods
Apr 2, 2026
Merged

Remove deprecated GpuTimeZoneDB methods#4422
res-life merged 1 commit intoNVIDIA:mainfrom
res-life:chongg/remove-deprecated-gputimezonedb-methods

Conversation

@res-life
Copy link
Copy Markdown
Collaborator

@res-life res-life commented Mar 31, 2026

Summary

  • remove the deprecated GpuTimeZoneDB.cacheDatabaseAsync(int), cacheDatabase(int), and getTransitions() methods
  • update the remaining timezone DB test to use the supported no-arg cache API

Related change

Drop the deprecated timezone cache overloads and renamed transition accessor now that the codebase no longer references them. Update the remaining timezone DB test to use the supported cache API.

Made-with: Cursor
Signed-off-by: Chong Gao <res_life@163.com>
@res-life res-life force-pushed the chongg/remove-deprecated-gputimezonedb-methods branch from 7a4a8db to da37046 Compare March 31, 2026 08:23
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 31, 2026

Greptile Summary

This PR removes three deprecated public methods from GpuTimeZoneDBcacheDatabaseAsync(int maxYear), cacheDatabase(int maxYear), and getTransitions() — which were already stub/wrapper methods that either ignored their parameter or simply delegated to the current preferred API. The test is updated to call the no-arg cacheDatabase() in place of the removed cacheDatabase(2200). No functional behaviour changes are made to any remaining API.

Key changes:

  • Removed cacheDatabaseAsync(int): was an async loader that ignored maxYear and was identical to cacheDatabaseAsync().
  • Removed cacheDatabase(int): simply called cacheDatabaseImpl(), ignoring maxYear.
  • Removed getTransitions(): was a rename of getTimezoneInfo() with identical logic.
  • Refreshed Javadoc on cacheDatabaseAsync() and cacheDatabase() to remove "deprecated/replacement" language.
  • testConvertOrcTimezones updated to call cacheDatabase() (no-arg).

Confidence Score: 5/5

Safe to merge — purely removes deprecated stubs with no functional impact on remaining APIs.

All three removed methods were already no-ops with respect to their extra parameter (maxYear was never used) or direct renames of the current API (getTransitions == getTimezoneInfo). No caller logic is affected in this repository and the companion spark-rapids PR (#14500) handles the consuming side. The single test change is correct. No P1/P0 findings.

No files require special attention.

Important Files Changed

Filename Overview
src/main/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDB.java Removes three deprecated methods (cacheDatabaseAsync(int), cacheDatabase(int), getTransitions()) and updates Javadoc; the removed methods were no-ops with respect to the maxYear parameter and getTransitions() was already superseded by getTimezoneInfo().
src/test/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDBTest.java Updates the single test to call the no-arg cacheDatabase() instead of the now-removed cacheDatabase(2200); no other changes.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant GpuTimeZoneDB

    Note over Caller,GpuTimeZoneDB: Removed (deprecated) API surface
    Caller->>GpuTimeZoneDB: ~~cacheDatabaseAsync(int maxYear)~~
    Caller->>GpuTimeZoneDB: ~~cacheDatabase(int maxYear)~~
    Caller->>GpuTimeZoneDB: ~~getTransitions()~~

    Note over Caller,GpuTimeZoneDB: Current (supported) API surface
    Caller->>GpuTimeZoneDB: cacheDatabaseAsync()
    GpuTimeZoneDB->>GpuTimeZoneDB: cacheDatabaseImpl() [in new daemon thread]
    Caller->>GpuTimeZoneDB: cacheDatabase()
    GpuTimeZoneDB->>GpuTimeZoneDB: cacheDatabaseImpl() [synchronous]
    Caller->>GpuTimeZoneDB: getTimezoneInfo()
    GpuTimeZoneDB-->>Caller: Table(fixedTransitions, dstRules)
Loading

Reviews (3): Last reviewed commit: "Remove deprecated GpuTimeZoneDB methods" | Re-trigger Greptile

@res-life
Copy link
Copy Markdown
Collaborator Author

Should first merge NVIDIA/spark-rapids#14500, then merge this.

@res-life res-life requested a review from thirtiseven March 31, 2026 08:36
@res-life
Copy link
Copy Markdown
Collaborator Author

build

@res-life res-life requested a review from firestarman March 31, 2026 08:38
Copy link
Copy Markdown
Collaborator

@firestarman firestarman left a comment

Choose a reason for hiding this comment

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

One nit but OK to merge it as is for me.

/**
* This is deprecated, will be removed.
*/
public static void cacheDatabaseAsync(int maxYear) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

NIT:
Since this is an API of a Java library, we may have comments that this is deprecated, and the maxYear is ignored, because it calls cacheDatabaseAsync internally than just removing it.

public static void cacheDatabaseAsync(int maxYear) {
  cacheDatabaseAsync()
}

res-life added a commit to NVIDIA/spark-rapids that referenced this pull request Apr 1, 2026
### Description

Previously,  we use hybrid mode:
- before 2200 year, generate a transition cache for DST timezone, and
run on GPU for timezone rebasing.
This mehod wastes GPU memories.
- after 2200 year, use CPU to do timezone rebasing.
This is slow.

Currently, we do not use hybrid mode any more, so remove the deprecated
methods.

- Replace deprecated `GpuTimeZoneDB.cacheDatabaseAsync(int)` and
`cacheDatabase(int)` usage with the no-arg APIs.
- Remove the now-unused `spark.rapids.timezone.transitionCache.maxYear`
config and obsolete docs entry.
- Update timezone perf and cast tests to call the replacement API.

## Related change
* NVIDIA/spark-rapids-jni#4422

### Checklists
- [x] This PR has added documentation for new or modified features or
behaviors.
- [x] This PR has added new tests or modified existing tests to cover
new code paths.
(Updated existing timezone perf and cast tests to exercise the
replacement API entry points.)
- [ ] Performance testing has been performed and its results are added
in the PR description. Or, an issue has been filed with a link in the PR
description.

Signed-off-by: Chong Gao <chongg@nvidia.com>

Signed-off-by: Chong Gao <res_life@163.com>
Co-authored-by: Chong Gao <res_life@163.com>
@res-life res-life marked this pull request as ready for review April 1, 2026 07:58
@res-life
Copy link
Copy Markdown
Collaborator Author

res-life commented Apr 1, 2026

build

@res-life res-life merged commit a0d85bd into NVIDIA:main Apr 2, 2026
5 checks passed
@res-life res-life deleted the chongg/remove-deprecated-gputimezonedb-methods branch April 2, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants