humengyu2012 commented on code in PR #2354: URL: https://github.com/apache/incubator-paimon/pull/2354#discussion_r1400259910
##########
paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java:
##########
@@ -551,33 +555,97 @@ private Lock lock(Identifier identifier) {
return Lock.fromCatalog(lock, identifier);
}
- private static final List<Class<?>[]> GET_PROXY_PARAMS =
- Arrays.asList(
+ private static final Map<Class<?>[], HiveMetastoreProxySupplier>
PROXY_SUPPLIERS =
+ ImmutableMap.<Class<?>[], HiveMetastoreProxySupplier>builder()
+ // for hive 1.x
+ .put(
+ new Class<?>[] {
+ HiveConf.class,
+ HiveMetaHookLoader.class,
+ ConcurrentHashMap.class,
+ String.class
+ },
+ (getProxyMethod, hiveConf, clientClassName) ->
+ (IMetaStoreClient)
+ getProxyMethod.invoke(
+ null,
+ hiveConf,
+ (HiveMetaHookLoader) (tbl
-> null),
+ new ConcurrentHashMap<>(),
+ clientClassName))
// for hive 2.x
- new Class<?>[] {
- HiveConf.class,
- HiveMetaHookLoader.class,
- ConcurrentHashMap.class,
- String.class,
- Boolean.TYPE
- },
+ .put(
+ new Class<?>[] {
+ HiveConf.class,
+ HiveMetaHookLoader.class,
+ ConcurrentHashMap.class,
+ String.class,
+ Boolean.TYPE
+ },
+ (getProxyMethod, hiveConf, clientClassName) ->
+ (IMetaStoreClient)
+ getProxyMethod.invoke(
+ null,
+ hiveConf,
+ (HiveMetaHookLoader) (tbl
-> null),
+ new ConcurrentHashMap<>(),
+ clientClassName,
+ true))
// for hive 3.x
- new Class<?>[] {
- Configuration.class,
- HiveMetaHookLoader.class,
- ConcurrentHashMap.class,
- String.class,
- Boolean.TYPE
- });
+ .put(
+ new Class<?>[] {
+ Configuration.class,
+ HiveMetaHookLoader.class,
+ ConcurrentHashMap.class,
+ String.class,
+ Boolean.TYPE
+ },
+ (getProxyMethod, hiveConf, clientClassName) ->
+ (IMetaStoreClient)
+ getProxyMethod.invoke(
+ null,
+ hiveConf,
+ (HiveMetaHookLoader) (tbl
-> null),
+ new ConcurrentHashMap<>(),
+ clientClassName,
+ true))
+ .build();
+ // If clientClassName is HiveMetaStoreClient,
Review Comment:
done
--
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]
