Skip to content

Commit

Permalink
[hive] bugfix jdbc paimon hive client pool (apache#3004)
Browse files Browse the repository at this point in the history
  • Loading branch information
坤泰 committed Aug 22, 2024
1 parent 6c82e52 commit fbee176
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import static org.apache.paimon.hive.HiveCatalogOptions.CLIENT_POOL_CACHE_EVICTION_INTERVAL_MS;
import static org.apache.paimon.hive.HiveCatalogOptions.CLIENT_POOL_CACHE_KEYS;
Expand Down Expand Up @@ -270,11 +269,6 @@ public int hashCode() {
}
return hashCode;
}

@Override
public String toString() {
return elements.stream().map(Object::toString).collect(Collectors.joining(","));
}
}

static class ConfElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,9 @@ public void testLoginHive() throws Exception {
options.set(
"hive.metastore.uris",
"thrift://30.150.24.155:9083");
options.set("client-pool-cache.keys", "user_name,conf:*");
options.set(
"client-pool-cache.keys",
"user_name,conf:*");

// hive config
HiveConf hiveConf = new HiveConf();
Expand Down Expand Up @@ -465,9 +467,11 @@ private void checkCurrentUser(HiveConf conf) {

@Test
public void testUgi() throws IOException {
UserGroupInformation user1 = UserGroupInformation.createProxyUser("hive", UserGroupInformation.getCurrentUser());
UserGroupInformation user2 = UserGroupInformation.createProxyUser("hive", UserGroupInformation.getCurrentUser());
System.out.println(user1.hashCode()==user2.hashCode());
UserGroupInformation user1 =
UserGroupInformation.createProxyUser("hive", UserGroupInformation.getCurrentUser());
UserGroupInformation user2 =
UserGroupInformation.createProxyUser("hive", UserGroupInformation.getCurrentUser());
System.out.println(user1.hashCode() == user2.hashCode());
System.out.println(user1.equals(user2));
}
}

0 comments on commit fbee176

Please sign in to comment.