String dbPath = "dfs://test";
String tableName = "pt";
int threadCount = 10;
DBConnectionPool connPool = new ExclusiveDBConnectionPool(host, port, username, password, threadCount, false, false);
PartitionedTableAppender appender = new PartitionedTableAppender(dbPath, tableName, "symbol", connPool);
BasicTable data = (BasicTable) conn.run("select * from t limit 10000");
int rows = appender.append(data);
System.out.println(rows + " rows inserted.");
connPool.waitForThreadCompletion();
可以调用 waitForThreadCompletion() 进行同步等待。