Skip to content

Commit da37046

Browse files
author
Chong Gao
committed
Remove deprecated GpuTimeZoneDB methods
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>
1 parent b4d5cbf commit da37046

File tree

2 files changed

+3
-42
lines changed

2 files changed

+3
-42
lines changed

src/main/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDB.java

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,9 @@ public class GpuTimeZoneDB {
9696
private static volatile HostColumnVector tzNameToIndexMap;
9797

9898
/**
99-
* This is deprecated, will be removed.
100-
*/
101-
public static void cacheDatabaseAsync(int maxYear) {
102-
// start a new thread to load
103-
Runnable runnable = () -> {
104-
try {
105-
cacheDatabaseImpl();
106-
} catch (Exception e) {
107-
log.error("cache timezone info cache failed", e);
108-
}
109-
};
110-
Thread thread = Executors.defaultThreadFactory().newThread(runnable);
111-
thread.setName("gpu-timezone-database-0");
112-
thread.setDaemon(true);
113-
thread.start();
114-
}
115-
116-
/**
117-
* This is the replacement of the above function.
99+
* Load the timezone database asynchronously.
118100
* This should be called on startup of an executor.
119-
* Runs in a thread asynchronously.
120-
* If `shutdown` was called ever, then will not load the cache
101+
* If `shutdown` was called ever, then this will not reload the cache.
121102
*/
122103
public static void cacheDatabaseAsync() {
123104
// start a new thread to load
@@ -154,14 +135,6 @@ public static void verifyDatabaseCached() {
154135
}
155136

156137
/**
157-
* This is deprecated, will be removed.
158-
*/
159-
public static void cacheDatabase(int maxYear) {
160-
cacheDatabaseImpl();
161-
}
162-
163-
/**
164-
* This is the replacement of the above function
165138
* Cache the database. This will take some time like several seconds.
166139
* If one `cacheDatabase` is running, other `cacheDatabase` will wait until
167140
* caching is done.
@@ -421,18 +394,6 @@ private static HostColumnVector.DataType getDstDataType() {
421394
}
422395

423396
/**
424-
* This is deprecated, will be removed.
425-
* Renamed to `getTimezoneInfo`.
426-
*/
427-
public static synchronized Table getTransitions() {
428-
verifyDatabaseCached();
429-
try (ColumnVector fixedInfo = fixedTransitions.copyToDevice();
430-
ColumnVector dstInfo = dstRules.copyToDevice()) {
431-
return new Table(fixedInfo, dstInfo);
432-
}
433-
}
434-
435-
/**
436397
* Get the timezone info table, which contains two columns:
437398
* - fixed transitions: LIST<STRUCT<utcInstant: int64, localInstant: int64,
438399
* offset: int32>>

src/test/java/com/nvidia/spark/rapids/jni/GpuTimeZoneDBTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private static ColumnVector convertOrcTimezonesOnCPU(
6262

6363
@Test
6464
void testConvertOrcTimezones() {
65-
GpuTimeZoneDB.cacheDatabase(2200);
65+
GpuTimeZoneDB.cacheDatabase();
6666
GpuTimeZoneDB.verifyDatabaseCached();
6767

6868
// test time range: (0001-01-01 00:00:00, 9999-12-31 23:59:59)

0 commit comments

Comments
 (0)