From c52aaf419259c31de38fd3a75e21df5f90d42e35 Mon Sep 17 00:00:00 2001 From: "mingye.jmy" Date: Mon, 11 Nov 2024 15:18:49 +0800 Subject: [PATCH] format --- .../apache/paimon/hive/HiveCatalogTest.java | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java b/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java index 4341798d0a8a..dcd770c57f51 100644 --- a/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java +++ b/paimon-hive/paimon-hive-catalog/src/test/java/org/apache/paimon/hive/HiveCatalogTest.java @@ -273,7 +273,7 @@ public void testAlterHiveTableParameters() { } @Test - public void testHiveClient() { + public void testListTablesLock() { try { String databaseName = "test_db"; catalog.createDatabase(databaseName, false); @@ -300,22 +300,28 @@ public void testHiveClient() { List tables1 = new ArrayList<>(); List tables2 = new ArrayList<>(); - Thread thread1 = new Thread(() -> { - System.out.println("First thread started at " + System.currentTimeMillis()); - try { - tables1.addAll(catalog.listTables(databaseName)); - } catch (Catalog.DatabaseNotExistException e) { - throw new RuntimeException(e); - } - }); - Thread thread2 = new Thread(() -> { - System.out.println("Second thread started at " + System.currentTimeMillis()); - try { - tables2.addAll(catalog.listTables(databaseName)); - } catch (Catalog.DatabaseNotExistException e) { - throw new RuntimeException(e); - } - }); + Thread thread1 = + new Thread( + () -> { + System.out.println( + "First thread started at " + System.currentTimeMillis()); + try { + tables1.addAll(catalog.listTables(databaseName)); + } catch (Catalog.DatabaseNotExistException e) { + throw new RuntimeException(e); + } + }); + Thread thread2 = + new Thread( + () -> { + System.out.println( + "Second thread started at " + System.currentTimeMillis()); + try { + tables2.addAll(catalog.listTables(databaseName)); + } catch (Catalog.DatabaseNotExistException e) { + throw new RuntimeException(e); + } + }); thread1.start(); thread2.start(); @@ -339,7 +345,6 @@ public void testHiveClient() { assertThat(tables1).size().isEqualTo(100); assertThat(tables1).containsAll(tables2); assertThat(tables2).containsAll(tables1); - } catch (Exception e) { throw new RuntimeException(e); }