jonvex commented on code in PR #11649:
URL: https://github.com/apache/hudi/pull/11649#discussion_r1752478244
##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HoodieArrayWritableAvroUtils.java:
##########
@@ -37,12 +38,17 @@ public class HoodieArrayWritableAvroUtils {
private static final Cache<String, ObjectInspectorCache>
OBJECT_INSPECTOR_TABLE_CACHE =
Caffeine.newBuilder().maximumSize(1000).build();
- public static ObjectInspectorCache getCacheForTable(String table, Schema
tableSchema, JobConf jobConf) {
- ObjectInspectorCache cache =
OBJECT_INSPECTOR_TABLE_CACHE.getIfPresent(table);
- if (cache == null) {
- cache = new ObjectInspectorCache(tableSchema, jobConf);
- }
- return cache;
+ public static ObjectInspectorCache getCacheForTable(String table) {
+ return OBJECT_INSPECTOR_TABLE_CACHE.getIfPresent(table);
+ }
+
+ public static ObjectInspectorCache initCacheForTable(String table, Schema
tableSchema, JobConf jobConf) {
+ return OBJECT_INSPECTOR_TABLE_CACHE.get(table, t -> new
ObjectInspectorCache(tableSchema, jobConf));
+ }
+
+ @VisibleForTesting
+ public static void resetCache() {
+ OBJECT_INSPECTOR_TABLE_CACHE.invalidateAll();
Review Comment:
ok, got rid of the cache
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]