Skip to content

Commit e7a35b7

Browse files
committed
Merge branch 'master' into multi-path
2 parents ba408dd + 080a810 commit e7a35b7

102 files changed

Lines changed: 2476 additions & 473 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ IoTDB official website:https://iotdb.apache.org/
2727

2828
Code library:https://github.com/apache/iotdb/tree/master
2929

30-
Get started quickly:https://iotdb.apache.org/UserGuide/Master/QuickStart/QuickStart.html
30+
Get started quickly:https://iotdb.apache.org/UserGuide/latest/QuickStart/QuickStart.html
3131

3232
## Subscribe to mailing list
3333

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ For the latest information about IoTDB, please visit [IoTDB official website](ht
8383

8484
# Quick Start
8585

86-
This short guide will walk you through the basic process of using IoTDB. For a more detailed introduction, please visit our website's [User Guide](https://iotdb.apache.org/UserGuide/Master/QuickStart/QuickStart.html).
86+
This short guide will walk you through the basic process of using IoTDB. For a more detailed introduction, please visit our website's [User Guide](https://iotdb.apache.org/UserGuide/latest/QuickStart/QuickStart.html).
8787

8888
## Prerequisites
8989

@@ -220,7 +220,7 @@ IoTDB provides three installation methods, you can refer to the following sugges
220220
* Using Docker:The path to the dockerfile is [here](https://github.com/apache/iotdb/tree/master/docker/src/main).
221221
222222
223-
Here in the Quick Start, we give a brief introduction of using source code to install IoTDB. For further information, please refer to [User Guide](https://iotdb.apache.org/UserGuide/Master/QuickStart/QuickStart.html).
223+
Here in the Quick Start, we give a brief introduction of using source code to install IoTDB. For further information, please refer to [User Guide](https://iotdb.apache.org/UserGuide/latest/QuickStart/QuickStart.html).
224224
225225
## Build from source
226226
@@ -307,10 +307,10 @@ you run `mvn package` successfully.**
307307
Configuration files are under the "conf" folder.
308308
309309
* environment config module (`datanode-env.bat`, `datanode-env.sh`),
310-
* system config module (`iotdb-datanode.properties`)
310+
* system config module (`iotdb-system.properties`)
311311
* log config module (`logback.xml`).
312312
313-
For more information, please see [Config Manual](https://iotdb.apache.org/UserGuide/Master/Reference/DataNode-Config-Manual.html).
313+
For more information, please see [Config Manual](https://iotdb.apache.org/UserGuide/latest/Reference/DataNode-Config-Manual.html).
314314
315315
## Start
316316
@@ -482,7 +482,7 @@ or
482482
IoTDB> exit
483483
```
484484
485-
For more information about the commands supported by IoTDB SQL, please see [User Guide](https://iotdb.apache.org/UserGuide/Master/QuickStart/QuickStart.html).
485+
For more information about the commands supported by IoTDB SQL, please see [User Guide](https://iotdb.apache.org/UserGuide/latest/QuickStart/QuickStart.html).
486486
487487
### Stop IoTDB
488488
@@ -496,12 +496,14 @@ The server can be stopped with "ctrl-C" or the following script:
496496
> sbin\stop-standalone.bat
497497
```
498498
499-
# The use of CSV Import and Export Tool
499+
# The use of Data Import and Export Tool
500+
501+
see [The use of Data Import Tool](https://iotdb.apache.org/UserGuide/latest/Tools-System/Data-Import-Tool.html)
502+
see [The use of Data Export Tool](https://iotdb.apache.org/UserGuide/latest/Tools-System/Data-Export-Tool.html)
500503
501-
see [The use of CSV Import and Export Tool](https://iotdb.apache.org/UserGuide/latest/Tools-System/Import-Export-Tool.html)
502504
503505
# Frequent Questions for Compiling
504-
see [Frequent Questions when Compiling the Source Code](https://iotdb.apache.org/Development/ContributeGuide.html#_Frequent-Questions-when-Compiling-the-Source-Code)
506+
see [Frequent Questions when Compiling the Source Code](https://iotdb.apache.org/Community/Development-Guide.html#frequently-asked-questions)
505507
506508
# Contact Us
507509

README_ZH.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ IoTDB的主要特点如下:
8181

8282
# 快速开始
8383

84-
这篇简短的指南将带您了解使用IoTDB的基本过程。如需更详细的介绍,请访问我们的网站[用户指南](https://iotdb.apache.org/zh/UserGuide/Master/QuickStart/QuickStart.html)
84+
这篇简短的指南将带您了解使用IoTDB的基本过程。如需更详细的介绍,请访问我们的网站[用户指南](https://iotdb.apache.org/zh/UserGuide/latest/QuickStart/QuickStart.html)
8585

8686
## 环境准备
8787

@@ -108,7 +108,7 @@ IoTDB提供了三种安装方法,您可以参考以下建议,选择最适合
108108
109109
* 使用Docker: dockerfile的路径是https://github.com/apache/iotdb/tree/master/docker/src/main
110110
111-
在这篇《快速入门》中,我们简要介绍如何使用源代码安装IoTDB。如需进一步资料,请参阅官网[用户指南](https://iotdb.apache.org/zh/UserGuide/Master/QuickStart/QuickStart.html)。
111+
在这篇《快速入门》中,我们简要介绍如何使用源代码安装IoTDB。如需进一步资料,请参阅官网[用户指南](https://iotdb.apache.org/zh/UserGuide/latest/QuickStart/QuickStart.html)。
112112
113113
## 从源码构建
114114
@@ -182,10 +182,10 @@ git checkout rel/x.x
182182
183183
配置文件在"conf"文件夹下
184184
* 环境配置模块(`datanode-env.bat`, `datanode-env.sh`),
185-
* 系统配置模块(`iotdb-datanode.properties`)
185+
* 系统配置模块(`iotdb-system.properties`)
186186
* 日志配置模块(`logback.xml`)。
187187
188-
有关详细信息,请参见[配置参数](https://iotdb.apache.org/zh/UserGuide/Master/Reference/DataNode-Config-Manual.html)。
188+
有关详细信息,请参见[配置参数](https://iotdb.apache.org/zh/UserGuide/latest/Reference/DataNode-Config-Manual.html)。
189189
190190
## 开始
191191
@@ -364,7 +364,7 @@ or
364364
IoTDB> exit
365365
```
366366
367-
有关IoTDB SQL支持的命令的更多信息,请参见[用户指南](https://iotdb.apache.org/zh/UserGuide/Master/QuickStart/QuickStart.html)。
367+
有关IoTDB SQL支持的命令的更多信息,请参见[用户指南](https://iotdb.apache.org/zh/UserGuide/latest/QuickStart/QuickStart.html)。
368368
369369
### 停止 IoTDB
370370
@@ -378,12 +378,13 @@ server 可以使用 "ctrl-C" 或者执行下面的脚本:
378378
> sbin\stop-standalone.bat
379379
```
380380
381-
# 导入导出CSV工具
381+
# 数据导入导出工具
382382
383-
查看 [导入导出CSV工具](https://iotdb.apache.org/zh/UserGuide/latest/Tools-System/Import-Export-Tool.html)
383+
查看 [数据导入工具](https://iotdb.apache.org/zh/UserGuide/latest/Tools-System/Data-Import-Tool.html)
384+
查看 [数据导出工具](https://iotdb.apache.org/zh/UserGuide/latest/Tools-System/Data-Export-Tool.html)
384385
385386
# 常见编译错误
386-
查看 [常见编译错误](https://iotdb.apache.org/zh/Community/Development-Guide.html)
387+
查看 [常见编译错误](https://iotdb.apache.org/zh/Community/Development-Guide.html#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98)
387388
388389
# 联系我们
389390
### QQ群

docker/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ docker run -d --name iotdb -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 5555:5555
8181
```shell
8282
docker run -d --name iotdb -p 6667:6667 -p 31999:31999 -p 8181:8181 -p 5555:5555 -p 9003:9003 -p 40010:40010 apache/iotdb:<version>
8383
```
84-
Since 1.0.0, see [offical documents.](https://iotdb.apache.org/UserGuide/Master/QuickStart/WayToGetIoTDB.html)
84+
Since 1.0.0, see [offical documents.](https://iotdb.apache.org/UserGuide/latest/QuickStart/QuickStart.html)
8585

8686
# How to register AINode to IoTDB cluster
8787

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ public Connection getConnection(
679679
? new ClusterTestConnection(
680680
getWriteConnection(version, username, password, sqlDialect),
681681
getReadConnections(version, username, password, sqlDialect))
682-
: getWriteConnection(version, username, password, sqlDialect).getUnderlyingConnecton();
682+
: getWriteConnection(version, username, password, sqlDialect).getUnderlyingConnection();
683683
}
684684

685685
@Override

integration-test/src/main/java/org/apache/iotdb/itbase/runtime/ClusterTestConnection.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
/** The implementation of {@link Connection} in cluster test. */
4444
public class ClusterTestConnection implements Connection {
4545

46-
private final NodeConnection writeConnection;
47-
private final List<NodeConnection> readConnections;
46+
public final NodeConnection writeConnection;
47+
public final List<NodeConnection> readConnections;
4848
private boolean isClosed;
4949

5050
public ClusterTestConnection(
@@ -110,7 +110,7 @@ public boolean isClosed() {
110110

111111
@Override
112112
public DatabaseMetaData getMetaData() throws SQLException {
113-
return writeConnection.getUnderlyingConnecton().getMetaData();
113+
return writeConnection.getUnderlyingConnection().getMetaData();
114114
}
115115

116116
@Override
@@ -269,9 +269,9 @@ public boolean isValid(int timeout) {
269269

270270
@Override
271271
public void setClientInfo(String name, String value) throws SQLClientInfoException {
272-
writeConnection.getUnderlyingConnecton().setClientInfo(name, value);
272+
writeConnection.getUnderlyingConnection().setClientInfo(name, value);
273273
for (NodeConnection conn : readConnections) {
274-
conn.getUnderlyingConnecton().setClientInfo(name, value);
274+
conn.getUnderlyingConnection().setClientInfo(name, value);
275275
}
276276
}
277277

integration-test/src/main/java/org/apache/iotdb/itbase/runtime/ClusterTestStatement.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class ClusterTestStatement implements Statement {
5151
public ClusterTestStatement(
5252
NodeConnection writeConnection, List<NodeConnection> readConnections) {
5353
try {
54-
this.writeStatement = writeConnection.getUnderlyingConnecton().createStatement();
54+
this.writeStatement = writeConnection.getUnderlyingConnection().createStatement();
5555
updateConfig(writeStatement, 0);
5656
writEndpoint = writeConnection.toString();
5757
} catch (SQLException e) {
@@ -60,7 +60,7 @@ public ClusterTestStatement(
6060

6161
for (NodeConnection readConnection : readConnections) {
6262
try {
63-
Statement readStatement = readConnection.getUnderlyingConnecton().createStatement();
63+
Statement readStatement = readConnection.getUnderlyingConnection().createStatement();
6464
this.readStatements.add(readStatement);
6565
this.readEndpoints.add(readConnection.toString());
6666
updateConfig(readStatement, queryTimeout);

integration-test/src/main/java/org/apache/iotdb/itbase/runtime/NodeConnection.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ public class NodeConnection {
3333
private final String endpoint;
3434
private final NodeRole nodeRole;
3535
private final ConnectionRole connectionRole;
36-
private final Connection underlyingConnecton;
36+
private final Connection underlyingConnection;
3737

3838
public NodeConnection(
3939
String endpoint,
4040
NodeRole nodeRole,
4141
ConnectionRole connectionRole,
42-
Connection underlyingConnecton) {
42+
Connection underlyingConnection) {
4343
this.endpoint = endpoint;
4444
this.nodeRole = nodeRole;
4545
this.connectionRole = connectionRole;
46-
this.underlyingConnecton = underlyingConnecton;
46+
this.underlyingConnection = underlyingConnection;
4747
}
4848

4949
public String getEndpoint() {
@@ -58,13 +58,13 @@ public ConnectionRole getConnectionRole() {
5858
return connectionRole;
5959
}
6060

61-
public Connection getUnderlyingConnecton() {
62-
return underlyingConnecton;
61+
public Connection getUnderlyingConnection() {
62+
return underlyingConnection;
6363
}
6464

6565
public void close() {
6666
try {
67-
underlyingConnecton.close();
67+
underlyingConnection.close();
6868
} catch (SQLException e) {
6969
logger.error("Close connection {} error", this, e);
7070
}

integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentInferenceIT.java

Lines changed: 70 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,35 @@
2222
import org.apache.iotdb.it.env.EnvFactory;
2323
import org.apache.iotdb.itbase.env.BaseEnv;
2424

25+
import com.google.common.collect.ImmutableMap;
26+
import com.google.common.collect.ImmutableSet;
2527
import org.junit.AfterClass;
28+
import org.junit.Assert;
2629
import org.junit.BeforeClass;
2730
import org.junit.Test;
2831
import org.slf4j.Logger;
2932
import org.slf4j.LoggerFactory;
3033

3134
import java.sql.Connection;
35+
import java.sql.ResultSet;
3236
import java.sql.SQLException;
3337
import java.sql.Statement;
38+
import java.util.HashSet;
39+
import java.util.Map;
40+
import java.util.Set;
41+
import java.util.concurrent.TimeUnit;
3442

3543
import static org.apache.iotdb.ainode.utils.AINodeTestUtils.concurrentInference;
3644

3745
public class AINodeConcurrentInferenceIT {
3846

3947
private static final Logger LOGGER = LoggerFactory.getLogger(AINodeConcurrentInferenceIT.class);
4048

49+
private static final Map<String, String> MODEL_ID_TO_TYPE_MAP =
50+
ImmutableMap.of(
51+
"timer_xl", "Timer-XL",
52+
"sundial", "Timer-Sundial");
53+
4154
@BeforeClass
4255
public static void setUp() throws Exception {
4356
// Init 1C1D1A cluster environment
@@ -91,12 +104,17 @@ private void concurrentCPUCallInferenceTest(String modelId)
91104
Statement statement = connection.createStatement()) {
92105
final int threadCnt = 4;
93106
final int loop = 10;
107+
final int predictLength = 96;
94108
statement.execute(String.format("LOAD MODEL %s TO DEVICES \"cpu\"", modelId));
109+
checkModelOnSpecifiedDevice(statement, MODEL_ID_TO_TYPE_MAP.get(modelId), "cpu");
95110
concurrentInference(
96111
statement,
97-
String.format("CALL INFERENCE(%s, \"SELECT s FROM root.AI\")", modelId),
112+
String.format(
113+
"CALL INFERENCE(%s, \"SELECT s FROM root.AI\", predict_length=%d)",
114+
modelId, predictLength),
98115
threadCnt,
99-
loop);
116+
loop,
117+
predictLength);
100118
statement.execute(String.format("UNLOAD MODEL %s FROM DEVICES \"cpu\"", modelId));
101119
}
102120
}
@@ -111,14 +129,20 @@ private void concurrentGPUCallInferenceTest(String modelId)
111129
throws SQLException, InterruptedException {
112130
try (Connection connection = EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
113131
Statement statement = connection.createStatement()) {
114-
final int threadCnt = 4;
115-
final int loop = 10;
116-
statement.execute(String.format("LOAD MODEL %s TO DEVICES \"0,1\"", modelId));
132+
final int threadCnt = 10;
133+
final int loop = 100;
134+
final int predictLength = 512;
135+
final String devices = "0,1";
136+
statement.execute(String.format("LOAD MODEL %s TO DEVICES \"%s\"", modelId, devices));
137+
checkModelOnSpecifiedDevice(statement, MODEL_ID_TO_TYPE_MAP.get(modelId), devices);
117138
concurrentInference(
118139
statement,
119-
String.format("CALL INFERENCE(%s, \"SELECT s FROM root.AI\")", modelId),
140+
String.format(
141+
"CALL INFERENCE(%s, \"SELECT s FROM root.AI\", predict_length=%d)",
142+
modelId, predictLength),
120143
threadCnt,
121-
loop);
144+
loop,
145+
predictLength);
122146
statement.execute(String.format("UNLOAD MODEL %s FROM DEVICES \"0,1\"", modelId));
123147
}
124148
}
@@ -134,15 +158,18 @@ private void concurrentCPUForecastTest(String modelId) throws SQLException, Inte
134158
Statement statement = connection.createStatement()) {
135159
final int threadCnt = 4;
136160
final int loop = 10;
161+
final int predictLength = 96;
137162
statement.execute(String.format("LOAD MODEL %s TO DEVICES \"cpu\"", modelId));
163+
checkModelOnSpecifiedDevice(statement, MODEL_ID_TO_TYPE_MAP.get(modelId), "cpu");
138164
long startTime = System.currentTimeMillis();
139165
concurrentInference(
140166
statement,
141167
String.format(
142-
"SELECT * FROM FORECAST(model_id=>'%s', input=>(SELECT time,s FROM root.AI) ORDER BY time)",
143-
modelId),
168+
"SELECT * FROM FORECAST(model_id=>'%s', input=>(SELECT time,s FROM root.AI) ORDER BY time), predict_length=>%d",
169+
modelId, predictLength),
144170
threadCnt,
145-
loop);
171+
loop,
172+
predictLength);
146173
long endTime = System.currentTimeMillis();
147174
LOGGER.info(
148175
String.format(
@@ -163,15 +190,19 @@ public void concurrentGPUForecastTest(String modelId) throws SQLException, Inter
163190
Statement statement = connection.createStatement()) {
164191
final int threadCnt = 10;
165192
final int loop = 100;
166-
statement.execute(String.format("LOAD MODEL %s TO DEVICES \"0,1\"", modelId));
193+
final int predictLength = 512;
194+
final String devices = "0,1";
195+
statement.execute(String.format("LOAD MODEL %s TO DEVICES \"%s\"", modelId, devices));
196+
checkModelOnSpecifiedDevice(statement, MODEL_ID_TO_TYPE_MAP.get(modelId), devices);
167197
long startTime = System.currentTimeMillis();
168198
concurrentInference(
169199
statement,
170200
String.format(
171-
"SELECT * FROM FORECAST(model_id=>'%s', input=>(SELECT time,s FROM root.AI) ORDER BY time)",
172-
modelId),
201+
"SELECT * FROM FORECAST(model_id=>'%s', input=>(SELECT time,s FROM root.AI) ORDER BY time), predict_length=>%d",
202+
modelId, predictLength),
173203
threadCnt,
174-
loop);
204+
loop,
205+
predictLength);
175206
long endTime = System.currentTimeMillis();
176207
LOGGER.info(
177208
String.format(
@@ -180,4 +211,29 @@ public void concurrentGPUForecastTest(String modelId) throws SQLException, Inter
180211
statement.execute(String.format("UNLOAD MODEL %s FROM DEVICES \"0,1\"", modelId));
181212
}
182213
}
214+
215+
private void checkModelOnSpecifiedDevice(Statement statement, String modelType, String device)
216+
throws SQLException, InterruptedException {
217+
for (int retry = 0; retry < 10; retry++) {
218+
Set<String> targetDevices = ImmutableSet.copyOf(device.split(","));
219+
Set<String> foundDevices = new HashSet<>();
220+
try (final ResultSet resultSet =
221+
statement.executeQuery(String.format("SHOW LOADED MODELS %s", device))) {
222+
while (resultSet.next()) {
223+
String deviceId = resultSet.getString(1);
224+
String loadedModelType = resultSet.getString(2);
225+
int count = resultSet.getInt(3);
226+
if (loadedModelType.equals(modelType) && targetDevices.contains(deviceId)) {
227+
Assert.assertTrue(count > 1);
228+
foundDevices.add(deviceId);
229+
}
230+
}
231+
if (foundDevices.containsAll(targetDevices)) {
232+
return;
233+
}
234+
}
235+
TimeUnit.SECONDS.sleep(3);
236+
}
237+
Assert.fail("Model " + modelType + " is not loaded on device " + device);
238+
}
183239
}

0 commit comments

Comments
 (0)