未验证 提交 6c162991 编写于 作者: B Bo Ding 提交者: GitHub

docs: fix high volume example (#14260)

上级 c7919a29
......@@ -66,7 +66,7 @@ class ReadTask {
while (it.hasNext()) {
String line = it.next();
String tbName = line.substring(0, line.indexOf(','));
int writeTaskId = tbName.hashCode() % numberWriteTask;
int writeTaskId = Math.abs(tbName.hashCode()) % numberWriteTask;
writeTasks.get(writeTaskId).put(line);
}
} catch (InterruptedException e) {
......
......@@ -11,7 +11,6 @@ import java.util.concurrent.LinkedBlockingDeque;
// ANCHOR: WriteTask
class WriteTask {
// How many records will trigger writing before queue
final static int maxBatchSize = 500;
//
final static int taskQueueCapacity = 1000;
......@@ -36,7 +35,7 @@ class WriteTask {
}
private static Connection getConnection() throws SQLException {
String jdbcUrl = "jdbc:TAOS-RS://localhost:6041?user=root&password=taosdata";
String jdbcUrl = "jdbc:TAOS://localhost:6030?user=root&password=taosdata";
return DriverManager.getConnection(jdbcUrl);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册