提交 8ab016fd 编写于 作者: D dapan1121

Merge remote-tracking branch 'origin/3.0' into feat/caseWhen

...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
IF (DEFINED VERNUMBER) IF (DEFINED VERNUMBER)
SET(TD_VER_NUMBER ${VERNUMBER}) SET(TD_VER_NUMBER ${VERNUMBER})
ELSE () ELSE ()
SET(TD_VER_NUMBER "3.0.1.2") SET(TD_VER_NUMBER "3.0.1.4")
ENDIF () ENDIF ()
IF (DEFINED VERCOMPATIBLE) IF (DEFINED VERCOMPATIBLE)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# taos-tools # taos-tools
ExternalProject_Add(taos-tools ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
GIT_TAG cf1df1c GIT_TAG 70f5a1c
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR "" BINARY_DIR ""
#BUILD_IN_SOURCE TRUE #BUILD_IN_SOURCE TRUE
......
...@@ -37,7 +37,8 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 ...@@ -37,7 +37,8 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0
- All the data in `tag_set` will be converted to nchar type automatically . - All the data in `tag_set` will be converted to nchar type automatically .
- Each data in `field_set` must be self-descriptive for its data type. For example 1.2f32 means a value 1.2 of float type. Without the "f" type suffix, it will be treated as type double. - Each data in `field_set` must be self-descriptive for its data type. For example 1.2f32 means a value 1.2 of float type. Without the "f" type suffix, it will be treated as type double.
- Multiple kinds of precision can be used for the `timestamp` field. Time precision can be from nanosecond (ns) to hour (h). - Multiple kinds of precision can be used for the `timestamp` field. Time precision can be from nanosecond (ns) to hour (h).
- You can configure smlChildTableName in taos.cfg to specify table names, for example, `smlChildTableName=tname`. You can insert `st,tname=cpul,t1=4 c1=3 1626006833639000000` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored.
- It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3)
::: :::
For more details please refer to [InfluxDB Line Protocol](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) and [TDengine Schemaless](/reference/schemaless/#Schemaless-Line-Protocol) For more details please refer to [InfluxDB Line Protocol](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) and [TDengine Schemaless](/reference/schemaless/#Schemaless-Line-Protocol)
...@@ -64,3 +65,7 @@ For more details please refer to [InfluxDB Line Protocol](https://docs.influxdat ...@@ -64,3 +65,7 @@ For more details please refer to [InfluxDB Line Protocol](https://docs.influxdat
<CLine /> <CLine />
</TabItem> </TabItem>
</Tabs> </Tabs>
## Query Examples
If you want query the data of `location=California.LosAngeles,groupid=2`,here is the query sql:
select * from `meters.voltage` where location="California.LosAngeles" and groupid=2
...@@ -31,7 +31,7 @@ For example: ...@@ -31,7 +31,7 @@ For example:
```txt ```txt
meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3 meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3
``` ```
- The defult child table name is generated by rules.You can configure smlChildTableName in taos.cfg to specify chile table names, for example, `smlChildTableName=tname`. You can insert `meters.current 1648432611250 11.3 tname=cpu1 location=California.LosAngeles groupid=3` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored.
Please refer to [OpenTSDB Telnet API](http://opentsdb.net/docs/build/html/api_telnet/put.html) for more details. Please refer to [OpenTSDB Telnet API](http://opentsdb.net/docs/build/html/api_telnet/put.html) for more details.
## Examples ## Examples
...@@ -64,10 +64,10 @@ taos> use test; ...@@ -64,10 +64,10 @@ taos> use test;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
meters.current | 2022-03-30 17:04:10.877 | 2 | 2 | 2 | meters.current |
meters.voltage | 2022-03-30 17:04:10.882 | 2 | 2 | 2 | meters.voltage |
Query OK, 2 row(s) in set (0.002544s) Query OK, 2 row(s) in set (0.002544s)
taos> select tbname, * from `meters.current`; taos> select tbname, * from `meters.current`;
...@@ -79,3 +79,6 @@ taos> select tbname, * from `meters.current`; ...@@ -79,3 +79,6 @@ taos> select tbname, * from `meters.current`;
t_7e7b26dd860280242c6492a16... | 2022-03-28 09:56:51.250 | 12.600000000 | 2 | California.SanFrancisco | t_7e7b26dd860280242c6492a16... | 2022-03-28 09:56:51.250 | 12.600000000 | 2 | California.SanFrancisco |
Query OK, 4 row(s) in set (0.005399s) Query OK, 4 row(s) in set (0.005399s)
``` ```
## Query Examples
If you want query the data of `location=California.LosAngeles groupid=3`,here is the query sql:
select * from `meters.voltage` where location="California.LosAngeles" and groupid=3
...@@ -48,7 +48,7 @@ Please refer to [OpenTSDB HTTP API](http://opentsdb.net/docs/build/html/api_http ...@@ -48,7 +48,7 @@ Please refer to [OpenTSDB HTTP API](http://opentsdb.net/docs/build/html/api_http
- In JSON protocol, strings will be converted to nchar type and numeric values will be converted to double type. - In JSON protocol, strings will be converted to nchar type and numeric values will be converted to double type.
- Only data in array format is accepted and so an array must be used even if there is only one row. - Only data in array format is accepted and so an array must be used even if there is only one row.
- The defult child table name is generated by rules.You can configure smlChildTableName in taos.cfg to specify chile table names, for example, `smlChildTableName=tname`. You can insert `"tags": { "host": "web02","dc": "lga","tname":"cpu1"}` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored.
::: :::
## Examples ## Examples
...@@ -81,10 +81,10 @@ taos> use test; ...@@ -81,10 +81,10 @@ taos> use test;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
meters.current | 2022-03-29 16:05:25.193 | 2 | 2 | 1 | meters.current |
meters.voltage | 2022-03-29 16:05:25.200 | 2 | 2 | 1 | meters.voltage |
Query OK, 2 row(s) in set (0.001954s) Query OK, 2 row(s) in set (0.001954s)
taos> select * from `meters.current`; taos> select * from `meters.current`;
...@@ -94,3 +94,6 @@ taos> select * from `meters.current`; ...@@ -94,3 +94,6 @@ taos> select * from `meters.current`;
2022-03-28 09:56:51.250 | 12.600000000 | 2.000000000 | California.SanFrancisco | 2022-03-28 09:56:51.250 | 12.600000000 | 2.000000000 | California.SanFrancisco |
Query OK, 2 row(s) in set (0.004076s) Query OK, 2 row(s) in set (0.004076s)
``` ```
## Query Examples
If you want query the data of "tags": {"location": "California.LosAngeles", "groupid": 1},here is the query sql:
select * from `meters.voltage` where location="California.LosAngeles" and groupid=1
...@@ -181,6 +181,14 @@ In TDengine, the first column of all tables must be a timestamp. This column is ...@@ -181,6 +181,14 @@ In TDengine, the first column of all tables must be a timestamp. This column is
select _rowts, max(current) from meters; select _rowts, max(current) from meters;
``` ```
**\_IROWTS**
The \_IROWTS pseudocolumn can only be used with INTERP function. This pseudocolumn can be used to retrieve the corresponding timestamp column associated with the interpolation results.
```sql
select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear);
```
## Query Objects ## Query Objects
`FROM` can be followed by a number of tables or super tables, or can be followed by a sub-query. `FROM` can be followed by a number of tables or super tables, or can be followed by a sub-query.
......
此差异已折叠。
...@@ -343,6 +343,7 @@ The following list shows all reserved keywords: ...@@ -343,6 +343,7 @@ The following list shows all reserved keywords:
### \_ ### \_
- \_C0 - \_C0
- \_IROWTS
- \_QDURATION - \_QDURATION
- \_QEND - \_QEND
- \_QSTART - \_QSTART
......
...@@ -11,7 +11,15 @@ TDengine includes a built-in database named `INFORMATION_SCHEMA` to provide acce ...@@ -11,7 +11,15 @@ TDengine includes a built-in database named `INFORMATION_SCHEMA` to provide acce
4. Future versions of TDengine can add new columns to INFORMATION_SCHEMA tables without affecting existing business systems. 4. Future versions of TDengine can add new columns to INFORMATION_SCHEMA tables without affecting existing business systems.
5. It is easier for users coming from other database management systems. For example, Oracle users can query data dictionary tables. 5. It is easier for users coming from other database management systems. For example, Oracle users can query data dictionary tables.
Note: SHOW statements are still supported for the convenience of existing users. :::info
- SHOW statements are still supported for the convenience of existing users.
- Some columns in the system table may be keywords, and you need to use the escape character '\`' when querying, for example, to query the VGROUPS in the database `test`:
```sql
select `vgroups` from ins_databases where name = 'test';
```
:::
This document introduces the tables of INFORMATION_SCHEMA and their structure. This document introduces the tables of INFORMATION_SCHEMA and their structure.
...@@ -102,7 +110,11 @@ Provides information about user-created databases. Similar to SHOW DATABASES. ...@@ -102,7 +110,11 @@ Provides information about user-created databases. Similar to SHOW DATABASES.
| 24 | wal_retention_period | INT | WAL retention period | | 24 | wal_retention_period | INT | WAL retention period |
| 25 | wal_retention_size | INT | Maximum WAL size | | 25 | wal_retention_size | INT | Maximum WAL size |
| 26 | wal_roll_period | INT | WAL rotation period | | 26 | wal_roll_period | INT | WAL rotation period |
| 27 | wal_segment_size | WAL file size | | 27 | wal_segment_size | BIGINT | WAL file size |
| 28 | stt_trigger | SMALLINT | The threshold for number of files to trigger file merging |
| 29 | table_prefix | SMALLINT | The prefix length in the table name that is ignored when distributing table to vnode based on table name |
| 30 | table_suffix | SMALLINT | The suffix length in the table name that is ignored when distributing table to vnode based on table name |
| 31 | tsdb_pagesize | INT | The page size for internal storage engine, its unit is KB |
## INS_FUNCTIONS ## INS_FUNCTIONS
......
...@@ -11,12 +11,13 @@ description: "This document explains how TDengine SQL has changed in version 3.0 ...@@ -11,12 +11,13 @@ description: "This document explains how TDengine SQL has changed in version 3.0
| 1 | VARCHAR | Added | Alias of BINARY. | 1 | VARCHAR | Added | Alias of BINARY.
| 2 | TIMESTAMP literal | Added | TIMESTAMP 'timestamp format' syntax now supported. | 2 | TIMESTAMP literal | Added | TIMESTAMP 'timestamp format' syntax now supported.
| 3 | _ROWTS pseudocolumn | Added | Indicates the primary key. Alias of _C0. | 3 | _ROWTS pseudocolumn | Added | Indicates the primary key. Alias of _C0.
| 4 | INFORMATION_SCHEMA | Added | Database for system metadata containing all schema definitions | 4 | _IROWTS pseudocolumn | Added | Used to retrieve timestamps with INTERP function.
| 5 | PERFORMANCE_SCHEMA | Added | Database for system performance information. | 5 | INFORMATION_SCHEMA | Added | Database for system metadata containing all schema definitions
| 6 | Connection queries | Deprecated | Connection queries are no longer supported. The syntax and interfaces are deprecated. | 6 | PERFORMANCE_SCHEMA | Added | Database for system performance information.
| 7 | Mixed operations | Enhanced | Mixing scalar and vector operations in queries has been enhanced and is supported in all SELECT clauses. | 7 | Connection queries | Deprecated | Connection queries are no longer supported. The syntax and interfaces are deprecated.
| 8 | Tag operations | Added | Tag columns can be used in queries and clauses like data columns. | 8 | Mixed operations | Enhanced | Mixing scalar and vector operations in queries has been enhanced and is supported in all SELECT clauses.
| 9 | Timeline clauses and time functions in supertables | Enhanced | When PARTITION BY is not used, data in supertables is merged into a single timeline. | 9 | Tag operations | Added | Tag columns can be used in queries and clauses like data columns.
| 10 | Timeline clauses and time functions in supertables | Enhanced | When PARTITION BY is not used, data in supertables is merged into a single timeline.
## SQL Syntax ## SQL Syntax
......
...@@ -109,7 +109,7 @@ TDengine's JDBC URL specification format is: ...@@ -109,7 +109,7 @@ TDengine's JDBC URL specification format is:
For establishing connections, native connections differ slightly from REST connections. For establishing connections, native connections differ slightly from REST connections.
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection"> <TabItem value="native" label="native connection">
```java ```java
......
...@@ -113,7 +113,7 @@ username:password@protocol(address)/dbname?param=value ...@@ -113,7 +113,7 @@ username:password@protocol(address)/dbname?param=value
``` ```
### Connecting via connector ### Connecting via connector
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection"> <TabItem value="native" label="native connection">
_taosSql_ implements Go's `database/sql/driver` interface via cgo. You can use the [`database/sql`](https://golang.org/pkg/database/sql/) interface by simply introducing the driver. _taosSql_ implements Go's `database/sql/driver` interface via cgo. You can use the [`database/sql`](https://golang.org/pkg/database/sql/) interface by simply introducing the driver.
......
...@@ -55,26 +55,28 @@ taos = "*" ...@@ -55,26 +55,28 @@ taos = "*"
</TabItem> </TabItem>
<TabItem value="native" label="native connection only"> <TabItem value="rest" label="Websocket only">
In `cargo.toml`, add [taos][taos] and enable the native feature: In `cargo.toml`, add [taos][taos] and enable the ws feature:
```toml ```toml
[dependencies] [dependencies]
taos = { version = "*", default-features = false, features = ["native"] } taos = { version = "*", default-features = false, features = ["ws"] }
``` ```
</TabItem> </TabItem>
<TabItem value="rest" label="Websocket only">
In `cargo.toml`, add [taos][taos] and enable the ws feature: <TabItem value="native" label="native connection only">
In `cargo.toml`, add [taos][taos] and enable the native feature:
```toml ```toml
[dependencies] [dependencies]
taos = { version = "*", default-features = false, features = ["ws"] } taos = { version = "*", default-features = false, features = ["native"] }
``` ```
</TabItem> </TabItem>
</Tabs> </Tabs>
## Establishing a connection ## Establishing a connection
......
...@@ -80,7 +80,7 @@ pip3 install git+https://github.com/taosdata/taos-connector-python.git ...@@ -80,7 +80,7 @@ pip3 install git+https://github.com/taosdata/taos-connector-python.git
### Verify ### Verify
<Tabs groupId="connect" default="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection"> <TabItem value="native" label="native connection">
For native connection, you need to verify that both the client driver and the Python connector itself are installed correctly. The client driver and Python connector have been installed properly if you can successfully import the `taos` module. In the Python Interactive Shell, you can type. For native connection, you need to verify that both the client driver and the Python connector itself are installed correctly. The client driver and Python connector have been installed properly if you can successfully import the `taos` module. In the Python Interactive Shell, you can type.
...@@ -118,7 +118,7 @@ Requirement already satisfied: taospy in c:\users\username\appdata\local\program ...@@ -118,7 +118,7 @@ Requirement already satisfied: taospy in c:\users\username\appdata\local\program
Before establishing a connection with the connector, we recommend testing the connectivity of the local TDengine CLI to the TDengine cluster. Before establishing a connection with the connector, we recommend testing the connectivity of the local TDengine CLI to the TDengine cluster.
<Tabs> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection"> <TabItem value="native" label="native connection">
Ensure that the TDengine instance is up and that the FQDN of the machines in the cluster (the FQDN defaults to hostname if you are starting a standalone version) can be resolved locally, by testing with the `ping` command. Ensure that the TDengine instance is up and that the FQDN of the machines in the cluster (the FQDN defaults to hostname if you are starting a standalone version) can be resolved locally, by testing with the `ping` command.
...@@ -173,7 +173,7 @@ If the test is successful, it will output the server version information, e.g. ...@@ -173,7 +173,7 @@ If the test is successful, it will output the server version information, e.g.
The following example code assumes that TDengine is installed locally and that the default configuration is used for both FQDN and serverPort. The following example code assumes that TDengine is installed locally and that the default configuration is used for both FQDN and serverPort.
<Tabs> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection" groupId="connect"> <TabItem value="native" label="native connection" groupId="connect">
```python ```python
...@@ -219,7 +219,7 @@ All arguments to the `connect()` function are optional keyword arguments. The fo ...@@ -219,7 +219,7 @@ All arguments to the `connect()` function are optional keyword arguments. The fo
### Basic Usage ### Basic Usage
<Tabs default="native" groupId="connect"> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection"> <TabItem value="native" label="native connection">
##### TaosConnection class ##### TaosConnection class
...@@ -289,7 +289,7 @@ For a more detailed description of the `sql()` method, please refer to [RestClie ...@@ -289,7 +289,7 @@ For a more detailed description of the `sql()` method, please refer to [RestClie
### Used with pandas ### Used with pandas
<Tabs default="native" groupId="connect"> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection"> <TabItem value="native" label="native connection">
```python ```python
......
...@@ -85,7 +85,7 @@ If using ARM64 Node.js on Windows 10 ARM, you must add "Visual C++ compilers and ...@@ -85,7 +85,7 @@ If using ARM64 Node.js on Windows 10 ARM, you must add "Visual C++ compilers and
### Install via npm ### Install via npm
<Tabs defaultValue="install_native"> <Tabs defaultValue="install_rest">
<TabItem value="install_native" label="Install native connector"> <TabItem value="install_native" label="Install native connector">
```bash ```bash
...@@ -124,7 +124,7 @@ node nodejsChecker.js host=localhost ...@@ -124,7 +124,7 @@ node nodejsChecker.js host=localhost
Please choose to use one of the connectors. Please choose to use one of the connectors.
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="native connection"> <TabItem value="native" label="native connection">
Install and import the `@tdengine/client` package. Install and import the `@tdengine/client` package.
......
...@@ -97,7 +97,7 @@ dotnet add exmaple.csproj reference src/TDengine.csproj ...@@ -97,7 +97,7 @@ dotnet add exmaple.csproj reference src/TDengine.csproj
## Establish a Connection ## Establish a Connection
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="Native Connection"> <TabItem value="native" label="Native Connection">
...@@ -173,7 +173,7 @@ ws://localhost:6041/test ...@@ -173,7 +173,7 @@ ws://localhost:6041/test
#### SQL Write #### SQL Write
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="Native Connection"> <TabItem value="native" label="Native Connection">
...@@ -204,7 +204,7 @@ ws://localhost:6041/test ...@@ -204,7 +204,7 @@ ws://localhost:6041/test
#### Parameter Binding #### Parameter Binding
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="Native Connection"> <TabItem value="native" label="Native Connection">
...@@ -227,7 +227,7 @@ ws://localhost:6041/test ...@@ -227,7 +227,7 @@ ws://localhost:6041/test
#### Synchronous Query #### Synchronous Query
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="Native Connection"> <TabItem value="native" label="Native Connection">
......
...@@ -4,11 +4,11 @@ Execute TDengine CLI program `taos` directly from the Linux shell to connect to ...@@ -4,11 +4,11 @@ Execute TDengine CLI program `taos` directly from the Linux shell to connect to
$ taos $ taos
taos> show databases; taos> show databases;
name | create_time | vgroups | ntables | replica | strict | duration | keep | buffer | pagesize | pages | minrows | maxrows | comp | precision | status | retention | single_stable | cachemodel | cachesize | wal_level | wal_fsync_period | wal_retention_period | wal_retention_size | wal_roll_period | wal_seg_size | name |
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================= =================================
information_schema | NULL | NULL | 14 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | ready | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | information_schema |
performance_schema | NULL | NULL | 3 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | ready | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | performance_schema |
db | 2022-08-04 14:14:49.385 | 2 | 4 | 1 | off | 14400m | 5254560m,5254560m,5254560m | 96 | 4 | 256 | 100 | 4096 | 2 | ms | ready | NULL | false | none | 1 | 1 | 3000 | 0 | 0 | 0 | 0 | db |
Query OK, 3 rows in database (0.019154s) Query OK, 3 rows in database (0.019154s)
taos> taos>
......
...@@ -2,12 +2,11 @@ Go to the `C:\TDengine` directory from `cmd` and execute TDengine CLI program `t ...@@ -2,12 +2,11 @@ Go to the `C:\TDengine` directory from `cmd` and execute TDengine CLI program `t
```text ```text
taos> show databases; taos> show databases;
name | create_time | vgroups | ntables | replica | strict | duration | keep | buffer | pagesize | pages | minrows | maxrows | comp | precision | status | retention | single_stable | cachemodel | cachesize | wal_level | wal_fsync_period | wal_retention_period | wal_retention_size | wal_roll_period | wal_seg_size | name |
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================= =================================
information_schema | NULL | NULL | 14 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | ready | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | information_schema |
performance_schema | NULL | NULL | 3 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | ready | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | performance_schema |
test | 2022-08-04 16:46:40.506 | 2 | 0 | 1 | off | 14400m | 5256000m,5256000m,5256000m | 96 | 4 | 256 | test |
100 | 4096 | 2 | ms | ready | NULL | false | none | 1 | 1 | 3000 | 0 | 0 | 0 | 0 |
Query OK, 3 rows in database (0.123000s) Query OK, 3 rows in database (0.123000s)
taos> taos>
......
...@@ -25,10 +25,11 @@ The TDengine client taos can be executed in this container to access TDengine us ...@@ -25,10 +25,11 @@ The TDengine client taos can be executed in this container to access TDengine us
$ docker exec -it tdengine taos $ docker exec -it tdengine taos
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
log | 2022-01-17 13:57:22.270 | 10 | 1 | 1 | 1 | 10 | 30 | 1 | 3 | 100 | 4096 | 1 | 3000 | 2 | 0 | us | 0 | ready | information_schema |
Query OK, 1 row(s) in set (0.002843s) performance_schema |
Query OK, 2 row(s) in set (0.002843s)
``` ```
The TDengine server running in the container uses the container's hostname to establish a connection. Using TDengine CLI or various connectors (such as JDBC-JNI) to access the TDengine inside the container from outside the container is more complicated. So the above is the simplest way to access the TDengine service in the container and is suitable for some simple scenarios. Please refer to the next section if you want to access the TDengine service in the container from outside the container using TDengine CLI or various connectors for complex scenarios. The TDengine server running in the container uses the container's hostname to establish a connection. Using TDengine CLI or various connectors (such as JDBC-JNI) to access the TDengine inside the container from outside the container is more complicated. So the above is the simplest way to access the TDengine service in the container and is suitable for some simple scenarios. Please refer to the next section if you want to access the TDengine service in the container from outside the container using TDengine CLI or various connectors for complex scenarios.
......
...@@ -177,12 +177,21 @@ The parameters described in this document by the effect that they have on the sy ...@@ -177,12 +177,21 @@ The parameters described in this document by the effect that they have on the sy
### maxNumOfDistinctRes ### maxNumOfDistinctRes
| Attribute | Description | | Attribute | Description |
| -------- | -------------------------------- | --- | | -------- | -------------------------------- |
| Applicable | Server Only | | Applicable | Server Only |
| Meaning | The maximum number of distinct rows returned | | Meaning | The maximum number of distinct rows returned |
| Value Range | [100,000 - 100,000,000] | | Value Range | [100,000 - 100,000,000] |
| Default Value | 100,000 | | Default Value | 100,000 |
### keepColumnName
| Attribute | Description |
| -------- | -------------------------------- |
| Applicable | Client only |
| Meaning | When the Last, First, LastRow function is queried, whether the returned column name contains the function name. |
| Value Range | 0 means including the function name, 1 means not including the function name. |
| Default Value | 0 |
## Locale Parameters ## Locale Parameters
### timezone ### timezone
......
...@@ -47,9 +47,8 @@ In the schemaless writing data line protocol, each data item in the field_set ne ...@@ -47,9 +47,8 @@ In the schemaless writing data line protocol, each data item in the field_set ne
- `t`, `T`, `true`, `True`, `TRUE`, `f`, `F`, `false`, and `False` will be handled directly as BOOL types. - `t`, `T`, `true`, `True`, `TRUE`, `f`, `F`, `false`, and `False` will be handled directly as BOOL types.
For example, the following data rows indicate that the t1 label is "3" (NCHAR), the t2 label is "4" (NCHAR), and the t3 label For example, the following data rows write c1 column as 3 (BIGINT), c2 column as false (BOOL), c3 column
is "t3" to the super table named `st` labeled "t3" (NCHAR), write c1 column as 3 (BIGINT), c2 column as false (BOOL), c3 column as "passit" (BINARY), c4 column as 4 (DOUBLE), and the primary key timestamp as 1626006833639000000 to child table with the t1 label as "3" (NCHAR), the t2 label as "4" (NCHAR), and the t3 label as "t3" (NCHAR) and the super table named `st`.
is "passit" (BINARY), c4 column is 4 (DOUBLE), and the primary key timestamp is 1626006833639000000 in one row.
```json ```json
st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000 st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000
...@@ -69,7 +68,7 @@ Schemaless writes process row data according to the following principles. ...@@ -69,7 +68,7 @@ Schemaless writes process row data according to the following principles.
Note that tag_key1, tag_key2 are not the original order of the tags entered by the user but the result of using the tag names in ascending order of the strings. Therefore, tag_key1 is not the first tag entered in the line protocol. Note that tag_key1, tag_key2 are not the original order of the tags entered by the user but the result of using the tag names in ascending order of the strings. Therefore, tag_key1 is not the first tag entered in the line protocol.
The string's MD5 hash value "md5_val" is calculated after the ranking is completed. The calculation result is then combined with the string to generate the table name: "t_md5_val". "t_" is a fixed prefix that every table generated by this mapping relationship has. The string's MD5 hash value "md5_val" is calculated after the ranking is completed. The calculation result is then combined with the string to generate the table name: "t_md5_val". "t_" is a fixed prefix that every table generated by this mapping relationship has.
You can configure smlChildTableName to specify table names, for example, `smlChildTableName=tname`. You can insert `st,tname=cpul,t1=4 c1=3 1626006833639000000` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored. You can configure smlChildTableName in taos.cfg to specify table names, for example, `smlChildTableName=tname`. You can insert `st,tname=cpul,t1=4 c1=3 1626006833639000000` and the cpu1 table will be automatically created. Note that if multiple rows have the same tname but different tag_set values, the tag_set of the first row is used to create the table and the others are ignored.
2. If the super table obtained by parsing the line protocol does not exist, this super table is created. 2. If the super table obtained by parsing the line protocol does not exist, this super table is created.
3. If the subtable obtained by the parse line protocol does not exist, Schemaless creates the sub-table according to the subtable name determined in steps 1 or 2. 3. If the subtable obtained by the parse line protocol does not exist, Schemaless creates the sub-table according to the subtable name determined in steps 1 or 2.
...@@ -78,7 +77,7 @@ You can configure smlChildTableName to specify table names, for example, `smlChi ...@@ -78,7 +77,7 @@ You can configure smlChildTableName to specify table names, for example, `smlChi
NULL. NULL.
6. For BINARY or NCHAR columns, if the length of the value provided in a data row exceeds the column type limit, the maximum length of characters allowed to be stored in the column is automatically increased (only incremented and not decremented) to ensure complete preservation of the data. 6. For BINARY or NCHAR columns, if the length of the value provided in a data row exceeds the column type limit, the maximum length of characters allowed to be stored in the column is automatically increased (only incremented and not decremented) to ensure complete preservation of the data.
7. Errors encountered throughout the processing will interrupt the writing process and return an error code. 7. Errors encountered throughout the processing will interrupt the writing process and return an error code.
8. It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat to false. Otherwise, data will be written out of order and a database error will occur. 8. It is assumed that the order of field_set in a supertable is consistent, meaning that the first record contains all fields and subsequent records store fields in the same order. If the order is not consistent, set smlDataFormat in taos.cfg to false. Otherwise, data will be written out of order and a database error will occur.(smlDataFormat in taos.cfg default to false after version of 3.0.1.3)
:::tip :::tip
All processing logic of schemaless will still follow TDengine's underlying restrictions on data structures, such as the total length of each row of data cannot exceed All processing logic of schemaless will still follow TDengine's underlying restrictions on data structures, such as the total length of each row of data cannot exceed
......
...@@ -51,5 +51,6 @@ port: 8125 ...@@ -51,5 +51,6 @@ port: 8125
Start StatsD after adding the following (assuming the config file is modified to config.js) Start StatsD after adding the following (assuming the config file is modified to config.js)
``` ```
npm install
node stats.js config.js & node stats.js config.js &
``` ```
...@@ -22,5 +22,4 @@ An example is as follows. ...@@ -22,5 +22,4 @@ An example is as follows.
username = "root" username = "root"
password = "taosdata" password = "taosdata"
data_format = "influx" data_format = "influx"
influx_max_line_bytes = 250
``` ```
...@@ -30,21 +30,20 @@ After restarting Prometheus, you can refer to the following example to verify th ...@@ -30,21 +30,20 @@ After restarting Prometheus, you can refer to the following example to verify th
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
test | 2022-04-12 08:07:58.756 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 2 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
prometheus_data | 2022-04-20 07:21:09.202 | 158 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | prometheus_data |
db | 2022-04-15 06:37:08.512 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | Query OK, 3 row(s) in set (0.000585s)
Query OK, 4 row(s) in set (0.000585s)
taos> use prometheus_data; taos> use prometheus_data;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
metrics | 2022-04-20 07:21:09.209 | 2 | 1 | 1389 | metrics |
Query OK, 1 row(s) in set (0.000487s) Query OK, 1 row(s) in set (0.000487s)
taos> select * from metrics limit 10; taos> select * from metrics limit 10;
...@@ -89,3 +88,7 @@ VALUE TIMESTAMP ...@@ -89,3 +88,7 @@ VALUE TIMESTAMP
``` ```
:::note
- TDengine will automatically create unique IDs for sub-table names by the rule.
:::
...@@ -15,6 +15,7 @@ To write Telegraf data to TDengine requires the following preparations. ...@@ -15,6 +15,7 @@ To write Telegraf data to TDengine requires the following preparations.
- The TDengine cluster is deployed and functioning properly - The TDengine cluster is deployed and functioning properly
- taosAdapter is installed and running properly. Please refer to the [taosAdapter manual](/reference/taosadapter) for details. - taosAdapter is installed and running properly. Please refer to the [taosAdapter manual](/reference/taosadapter) for details.
- Telegraf has been installed. Please refer to the [official documentation](https://docs.influxdata.com/telegraf/v1.22/install/) for Telegraf installation. - Telegraf has been installed. Please refer to the [official documentation](https://docs.influxdata.com/telegraf/v1.22/install/) for Telegraf installation.
- Telegraf collects the running status measurements of current system. You can enable [input plugins](https://docs.influxdata.com/telegraf/v1.22/plugins/) to insert [other formats](https://docs.influxdata.com/telegraf/v1.24/data_formats/input/) data to Telegraf then forward to TDengine.
## Configuration steps ## Configuration steps
<Telegraf /> <Telegraf />
...@@ -31,26 +32,27 @@ Use TDengine CLI to verify Telegraf correctly writing data to TDengine and read ...@@ -31,26 +32,27 @@ Use TDengine CLI to verify Telegraf correctly writing data to TDengine and read
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
telegraf | 2022-04-20 08:47:53.488 | 22 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 9 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
Query OK, 2 row(s) in set (0.002401s) telegraf |
Query OK, 3 rows in database (0.010568s)
taos> use telegraf; taos> use telegraf;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
swap | 2022-04-20 08:47:53.532 | 7 | 1 | 1 | swap |
cpu | 2022-04-20 08:48:03.488 | 11 | 2 | 5 | cpu |
system | 2022-04-20 08:47:53.512 | 8 | 1 | 1 | system |
diskio | 2022-04-20 08:47:53.550 | 12 | 2 | 15 | diskio |
kernel | 2022-04-20 08:47:53.503 | 6 | 1 | 1 | kernel |
mem | 2022-04-20 08:47:53.521 | 35 | 1 | 1 | mem |
processes | 2022-04-20 08:47:53.555 | 12 | 1 | 1 | processes |
disk | 2022-04-20 08:47:53.541 | 8 | 5 | 2 | disk |
Query OK, 8 row(s) in set (0.000521s) Query OK, 8 row(s) in set (0.000521s)
taos> select * from telegraf.system limit 10; taos> select * from telegraf.system limit 10;
...@@ -65,3 +67,11 @@ taos> select * from telegraf.system limit 10; ...@@ -65,3 +67,11 @@ taos> select * from telegraf.system limit 10;
| |
Query OK, 3 row(s) in set (0.013269s) Query OK, 3 row(s) in set (0.013269s)
``` ```
:::note
- TDengine take influxdb format data and create unique ID for table names by the rule.
The user can configure `smlChildTableName` parameter to generate specified table names if he/she needs. And he/she also need to insert data with specified data format.
For example, Add `smlChildTableName=tname` in the taos.cfg file. Insert data `st,tname=cpu1,t1=4 c1=3 1626006833639000000` then the table name will be cpu1. If there are multiple lines has same tname but different tag_set, the first line's tag_set will be used to automatically creating table and ignore other lines. Please refer to [TDengine Schemaless](/reference/schemaless/#Schemaless-Line-Protocol)
:::
...@@ -32,28 +32,29 @@ Use the TDengine CLI to verify that collectd's data is written to TDengine and c ...@@ -32,28 +32,29 @@ Use the TDengine CLI to verify that collectd's data is written to TDengine and c
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
collectd | 2022-04-20 09:27:45.460 | 95 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
Query OK, 2 row(s) in set (0.003266s) collectd |
Query OK, 3 row(s) in set (0.003266s)
taos> use collectd; taos> use collectd;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
load_1 | 2022-04-20 09:27:45.492 | 2 | 2 | 1 | load_1 |
memory_value | 2022-04-20 09:27:45.463 | 2 | 3 | 6 | memory_value |
df_value | 2022-04-20 09:27:45.463 | 2 | 4 | 25 | df_value |
load_2 | 2022-04-20 09:27:45.501 | 2 | 2 | 1 | load_2 |
load_0 | 2022-04-20 09:27:45.485 | 2 | 2 | 1 | load_0 |
interface_1 | 2022-04-20 09:27:45.488 | 2 | 3 | 12 | interface_1 |
irq_value | 2022-04-20 09:27:45.476 | 2 | 3 | 31 | irq_value |
interface_0 | 2022-04-20 09:27:45.480 | 2 | 3 | 12 | interface_0 |
entropy_value | 2022-04-20 09:27:45.473 | 2 | 2 | 1 | entropy_value |
swap_value | 2022-04-20 09:27:45.477 | 2 | 3 | 5 | swap_value |
Query OK, 10 row(s) in set (0.002236s) Query OK, 10 row(s) in set (0.002236s)
taos> select * from collectd.memory_value limit 10; taos> select * from collectd.memory_value limit 10;
...@@ -72,3 +73,7 @@ taos> select * from collectd.memory_value limit 10; ...@@ -72,3 +73,7 @@ taos> select * from collectd.memory_value limit 10;
Query OK, 10 row(s) in set (0.010348s) Query OK, 10 row(s) in set (0.010348s)
``` ```
:::note
- TDengine will automatically create unique IDs for sub-table names by the rule.
:::
...@@ -26,7 +26,7 @@ Start StatsD: ...@@ -26,7 +26,7 @@ Start StatsD:
``` ```
$ node stats.js config.js & $ node stats.js config.js &
[1] 8546 [1] 8546
$ 20 Apr 09:54:41 - [8546] reading config file: exampleConfig.js $ 20 Apr 09:54:41 - [8546] reading config file: config.js
20 Apr 09:54:41 - server is up INFO 20 Apr 09:54:41 - server is up INFO
``` ```
...@@ -40,19 +40,20 @@ Use the TDengine CLI to verify that StatsD data is written to TDengine and can r ...@@ -40,19 +40,20 @@ Use the TDengine CLI to verify that StatsD data is written to TDengine and can r
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | information_schema |
statsd | 2022-04-20 09:54:51.220 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | performance_schema |
Query OK, 2 row(s) in set (0.003142s) statsd |
Query OK, 3 row(s) in set (0.003142s)
taos> use statsd; taos> use statsd;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
foo | 2022-04-20 09:54:51.234 | 2 | 1 | 1 | foo |
Query OK, 1 row(s) in set (0.002161s) Query OK, 1 row(s) in set (0.002161s)
taos> select * from foo; taos> select * from foo;
...@@ -63,3 +64,8 @@ Query OK, 1 row(s) in set (0.004179s) ...@@ -63,3 +64,8 @@ Query OK, 1 row(s) in set (0.004179s)
taos> taos>
``` ```
:::note
- TDengine will automatically create unique IDs for sub-table names by the rule.
:::
...@@ -36,39 +36,45 @@ After waiting about 10 seconds, use the TDengine CLI to query TDengine to verify ...@@ -36,39 +36,45 @@ After waiting about 10 seconds, use the TDengine CLI to query TDengine to verify
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | information_schema |
icinga2 | 2022-04-20 12:11:39.697 | 13 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | performance_schema |
Query OK, 2 row(s) in set (0.001867s) icinga2 |
Query OK, 3 row(s) in set (0.001867s)
taos> use icinga2; taos> use icinga2;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
icinga.service.users.state_... | 2022-04-20 12:11:39.726 | 2 | 1 | 1 | icinga.service.users.state_... |
icinga.service.users.acknow... | 2022-04-20 12:11:39.756 | 2 | 1 | 1 | icinga.service.users.acknow... |
icinga.service.procs.downti... | 2022-04-20 12:11:44.541 | 2 | 1 | 1 | icinga.service.procs.downti... |
icinga.service.users.users | 2022-04-20 12:11:39.770 | 2 | 1 | 1 | icinga.service.users.users |
icinga.service.procs.procs_min | 2022-04-20 12:11:44.599 | 2 | 1 | 1 | icinga.service.procs.procs_min |
icinga.service.users.users_min | 2022-04-20 12:11:39.809 | 2 | 1 | 1 | icinga.service.users.users_min |
icinga.check.max_check_atte... | 2022-04-20 12:11:39.847 | 2 | 3 | 2 | icinga.check.max_check_atte... |
icinga.service.procs.state_... | 2022-04-20 12:11:44.522 | 2 | 1 | 1 | icinga.service.procs.state_... |
icinga.service.procs.procs_... | 2022-04-20 12:11:44.576 | 2 | 1 | 1 | icinga.service.procs.procs_... |
icinga.service.users.users_... | 2022-04-20 12:11:39.796 | 2 | 1 | 1 | icinga.service.users.users_... |
icinga.check.latency | 2022-04-20 12:11:39.869 | 2 | 3 | 2 | icinga.check.latency |
icinga.service.procs.procs_... | 2022-04-20 12:11:44.588 | 2 | 1 | 1 | icinga.service.procs.procs_... |
icinga.service.users.downti... | 2022-04-20 12:11:39.746 | 2 | 1 | 1 | icinga.service.users.downti... |
icinga.service.users.users_... | 2022-04-20 12:11:39.783 | 2 | 1 | 1 | icinga.service.users.users_... |
icinga.service.users.reachable | 2022-04-20 12:11:39.736 | 2 | 1 | 1 | icinga.service.users.reachable |
icinga.service.procs.procs | 2022-04-20 12:11:44.565 | 2 | 1 | 1 | icinga.service.procs.procs |
icinga.service.procs.acknow... | 2022-04-20 12:11:44.554 | 2 | 1 | 1 | icinga.service.procs.acknow... |
icinga.service.procs.state | 2022-04-20 12:11:44.509 | 2 | 1 | 1 | icinga.service.procs.state |
icinga.service.procs.reachable | 2022-04-20 12:11:44.532 | 2 | 1 | 1 | icinga.service.procs.reachable |
icinga.check.current_attempt | 2022-04-20 12:11:39.825 | 2 | 3 | 2 | icinga.check.current_attempt |
icinga.check.execution_time | 2022-04-20 12:11:39.898 | 2 | 3 | 2 | icinga.check.execution_time |
icinga.service.users.state | 2022-04-20 12:11:39.704 | 2 | 1 | 1 | icinga.service.users.state |
Query OK, 22 row(s) in set (0.002317s) Query OK, 22 row(s) in set (0.002317s)
``` ```
:::note
- TDengine will automatically create unique IDs for sub-table names by the rule.
:::
...@@ -33,35 +33,41 @@ Wait for a few seconds and then use the TDengine CLI to query whether the corres ...@@ -33,35 +33,41 @@ Wait for a few seconds and then use the TDengine CLI to query whether the corres
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
tcollector | 2022-04-20 12:44:49.604 | 88 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
Query OK, 2 row(s) in set (0.002679s) tcollector |
Query OK, 3 rows in database (0.001647s)
taos> use tcollector; taos> use tcollector;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
proc.meminfo.hugepages_rsvd | 2022-04-20 12:44:53.945 | 2 | 1 | 1 | proc.meminfo.hugepages_rsvd |
proc.meminfo.directmap1g | 2022-04-20 12:44:54.110 | 2 | 1 | 1 | proc.meminfo.directmap1g |
proc.meminfo.vmallocchunk | 2022-04-20 12:44:53.724 | 2 | 1 | 1 | proc.meminfo.vmallocchunk |
proc.meminfo.hugepagesize | 2022-04-20 12:44:54.004 | 2 | 1 | 1 | proc.meminfo.hugepagesize |
tcollector.reader.lines_dro... | 2022-04-20 12:44:49.675 | 2 | 1 | 1 | tcollector.reader.lines_dro... |
proc.meminfo.sunreclaim | 2022-04-20 12:44:53.437 | 2 | 1 | 1 | proc.meminfo.sunreclaim |
proc.stat.ctxt | 2022-04-20 12:44:55.363 | 2 | 1 | 1 | proc.stat.ctxt |
proc.meminfo.swaptotal | 2022-04-20 12:44:53.158 | 2 | 1 | 1 | proc.meminfo.swaptotal |
proc.uptime.total | 2022-04-20 12:44:52.813 | 2 | 1 | 1 | proc.uptime.total |
tcollector.collector.lines_... | 2022-04-20 12:44:49.895 | 2 | 2 | 51 | tcollector.collector.lines_... |
proc.meminfo.vmallocused | 2022-04-20 12:44:53.704 | 2 | 1 | 1 | proc.meminfo.vmallocused |
proc.meminfo.memavailable | 2022-04-20 12:44:52.939 | 2 | 1 | 1 | proc.meminfo.memavailable |
sys.numa.foreign_allocs | 2022-04-20 12:44:57.929 | 2 | 2 | 1 | sys.numa.foreign_allocs |
proc.meminfo.committed_as | 2022-04-20 12:44:53.639 | 2 | 1 | 1 | proc.meminfo.committed_as |
proc.vmstat.pswpin | 2022-04-20 12:44:54.177 | 2 | 1 | 1 | proc.vmstat.pswpin |
proc.meminfo.cmafree | 2022-04-20 12:44:53.865 | 2 | 1 | 1 | proc.meminfo.cmafree |
proc.meminfo.mapped | 2022-04-20 12:44:53.349 | 2 | 1 | 1 | proc.meminfo.mapped |
proc.vmstat.pgmajfault | 2022-04-20 12:44:54.251 | 2 | 1 | 1 | proc.vmstat.pgmajfault |
... ...
``` ```
:::note
- TDengine will automatically create unique IDs for sub-table names by the rule.
:::
...@@ -60,7 +60,6 @@ For the configuration method, add the following text to `/etc/telegraf/telegraf. ...@@ -60,7 +60,6 @@ For the configuration method, add the following text to `/etc/telegraf/telegraf.
username = "<TDengine's username>" username = "<TDengine's username>"
password = "<TDengine's password>" password = "<TDengine's password>"
data_format = "influx" data_format = "influx"
influx_max_line_bytes = 250
``` ```
Then restart telegraf: Then restart telegraf:
......
...@@ -6,6 +6,14 @@ description: TDengine release history, Release Notes and download links. ...@@ -6,6 +6,14 @@ description: TDengine release history, Release Notes and download links.
import Release from "/components/ReleaseV3"; import Release from "/components/ReleaseV3";
## 3.0.1.4
<Release type="tdengine" version="3.0.1.4" />
## 3.0.1.3
<Release type="tdengine" version="3.0.1.3" />
## 3.0.1.2 ## 3.0.1.2
<Release type="tdengine" version="3.0.1.2" /> <Release type="tdengine" version="3.0.1.2" />
......
...@@ -6,6 +6,14 @@ description: taosTools release history, Release Notes, download links. ...@@ -6,6 +6,14 @@ description: taosTools release history, Release Notes, download links.
import Release from "/components/ReleaseV3"; import Release from "/components/ReleaseV3";
## 2.2.4
<Release type="tools" version="2.2.4" />
## 2.2.3
<Release type="tools" version="2.2.3" />
## 2.2.2 ## 2.2.2
<Release type="tools" version="2.2.2" /> <Release type="tools" version="2.2.2" />
......
...@@ -37,7 +37,9 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 ...@@ -37,7 +37,9 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0
- tag_set 中的所有的数据自动转化为 nchar 数据类型; - tag_set 中的所有的数据自动转化为 nchar 数据类型;
- field_set 中的每个数据项都需要对自身的数据类型进行描述, 比如 1.2f32 代表 float 类型的数值 1.2, 如果不带类型后缀会被当作 double 处理; - field_set 中的每个数据项都需要对自身的数据类型进行描述, 比如 1.2f32 代表 float 类型的数值 1.2, 如果不带类型后缀会被当作 double 处理;
- timestamp 支持多种时间精度。写入数据的时候需要用参数指定时间精度,支持从小时到纳秒的 6 种时间精度。 - timestamp 支持多种时间精度。写入数据的时候需要用参数指定时间精度,支持从小时到纳秒的 6 种时间精度。
- 为了提高写入的效率,默认假设同一个超级表中 field_set 的顺序是一样的(第一条数据包含所有的 field,后面的数据按照这个顺序),如果顺序不一样,需要配置参数 smlDataFormat 为 false,否则,数据写入按照相同顺序写入,库中数据会异常。(3.0.1.3之后的版本 smlDataFormat 默认为 false) [TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议)
- 默认生产的子表名是根据规则生成的唯一ID值。为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。
举例如下:配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。[TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议)
::: :::
要了解更多可参考:[InfluxDB Line 协议官方文档](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) 和 [TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议) 要了解更多可参考:[InfluxDB Line 协议官方文档](https://docs.influxdata.com/influxdb/v2.0/reference/syntax/line-protocol/) 和 [TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议)
...@@ -64,3 +66,7 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0 ...@@ -64,3 +66,7 @@ meters,location=California.LosAngeles,groupid=2 current=13.4,voltage=223,phase=0
<CLine /> <CLine />
</TabItem> </TabItem>
</Tabs> </Tabs>
## 查询示例
比如查询 location=California.LosAngeles,groupid=2 子表的数据可以通过如下sql:
select * from meters where location=California.LosAngeles and groupid=2
...@@ -32,6 +32,8 @@ OpenTSDB 行协议同样采用一行字符串来表示一行数据。OpenTSDB ...@@ -32,6 +32,8 @@ OpenTSDB 行协议同样采用一行字符串来表示一行数据。OpenTSDB
meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3 meters.current 1648432611250 11.3 location=California.LosAngeles groupid=3
``` ```
- 默认生产的子表名是根据规则生成的唯一ID值。为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。
举例如下:配置 smlChildTableName=tname 插入数据为 meters.current 1648432611250 11.3 tname=cpu1 location=California.LosAngeles groupid=3 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。
参考[OpenTSDB Telnet API 文档](http://opentsdb.net/docs/build/html/api_telnet/put.html)。 参考[OpenTSDB Telnet API 文档](http://opentsdb.net/docs/build/html/api_telnet/put.html)。
## 示例代码 ## 示例代码
...@@ -64,10 +66,10 @@ taos> use test; ...@@ -64,10 +66,10 @@ taos> use test;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
meters.current | 2022-03-30 17:04:10.877 | 2 | 2 | 2 | meters.current |
meters.voltage | 2022-03-30 17:04:10.882 | 2 | 2 | 2 | meters.voltage |
Query OK, 2 row(s) in set (0.002544s) Query OK, 2 row(s) in set (0.002544s)
taos> select tbname, * from `meters.current`; taos> select tbname, * from `meters.current`;
...@@ -79,3 +81,6 @@ taos> select tbname, * from `meters.current`; ...@@ -79,3 +81,6 @@ taos> select tbname, * from `meters.current`;
t_7e7b26dd860280242c6492a16... | 2022-03-28 09:56:51.250 | 12.600000000 | 2 | California.SanFrancisco | t_7e7b26dd860280242c6492a16... | 2022-03-28 09:56:51.250 | 12.600000000 | 2 | California.SanFrancisco |
Query OK, 4 row(s) in set (0.005399s) Query OK, 4 row(s) in set (0.005399s)
``` ```
## 查询示例:
想要查询 location=California.LosAngeles groupid=3 的数据,可以通过如下sql:
select * from `meters.voltage` where location="California.LosAngeles" and groupid=3
...@@ -48,7 +48,8 @@ OpenTSDB JSON 格式协议采用一个 JSON 字符串表示一行或多行数据 ...@@ -48,7 +48,8 @@ OpenTSDB JSON 格式协议采用一个 JSON 字符串表示一行或多行数据
- 对于 JSON 格式协议,TDengine 并不会自动把所有标签转成 nchar 类型, 字符串将将转为 nchar 类型, 数值将同样转换为 double 类型。 - 对于 JSON 格式协议,TDengine 并不会自动把所有标签转成 nchar 类型, 字符串将将转为 nchar 类型, 数值将同样转换为 double 类型。
- TDengine 只接收 JSON **数组格式**的字符串,即使一行数据也需要转换成数组形式。 - TDengine 只接收 JSON **数组格式**的字符串,即使一行数据也需要转换成数组形式。
- 默认生产的子表名是根据规则生成的唯一ID值。为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。
举例如下:配置 smlChildTableName=tname 插入数据为 "tags": { "host": "web02","dc": "lga","tname":"cpu1"} 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。
::: :::
## 示例代码 ## 示例代码
...@@ -81,10 +82,10 @@ taos> use test; ...@@ -81,10 +82,10 @@ taos> use test;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
meters.current | 2022-03-29 16:05:25.193 | 2 | 2 | 1 | meters.current |
meters.voltage | 2022-03-29 16:05:25.200 | 2 | 2 | 1 | meters.voltage |
Query OK, 2 row(s) in set (0.001954s) Query OK, 2 row(s) in set (0.001954s)
taos> select * from `meters.current`; taos> select * from `meters.current`;
...@@ -94,3 +95,7 @@ taos> select * from `meters.current`; ...@@ -94,3 +95,7 @@ taos> select * from `meters.current`;
2022-03-28 09:56:51.250 | 12.600000000 | 2.000000000 | California.SanFrancisco | 2022-03-28 09:56:51.250 | 12.600000000 | 2.000000000 | California.SanFrancisco |
Query OK, 2 row(s) in set (0.004076s) Query OK, 2 row(s) in set (0.004076s)
``` ```
## 查询示例
想要查询"tags": {"location": "California.LosAngeles", "groupid": 1} 的数据,可以通过如下sql:
select * from `meters.voltage` where location="California.LosAngeles" and groupid=1
...@@ -109,7 +109,7 @@ TDengine 的 JDBC URL 规范格式为: ...@@ -109,7 +109,7 @@ TDengine 的 JDBC URL 规范格式为:
对于建立连接,原生连接与 REST 连接有细微不同。 对于建立连接,原生连接与 REST 连接有细微不同。
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
```java ```java
......
...@@ -114,7 +114,7 @@ username:password@protocol(address)/dbname?param=value ...@@ -114,7 +114,7 @@ username:password@protocol(address)/dbname?param=value
``` ```
### 使用连接器进行连接 ### 使用连接器进行连接
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
_taosSql_ 通过 cgo 实现了 Go `database/sql/driver` 接口。只需要引入驱动就可以使用 [`database/sql`](https://golang.org/pkg/database/sql/) 的接口。 _taosSql_ 通过 cgo 实现了 Go `database/sql/driver` 接口。只需要引入驱动就可以使用 [`database/sql`](https://golang.org/pkg/database/sql/) 的接口。
......
...@@ -55,23 +55,24 @@ taos = "*" ...@@ -55,23 +55,24 @@ taos = "*"
</TabItem> </TabItem>
<TabItem value="native" label="仅原生连接"> <TabItem value="rest" label="仅 Websocket">
在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `native` 特性: 在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `ws` 特性。
```toml ```toml
[dependencies] [dependencies]
taos = { version = "*", default-features = false, features = ["native"] } taos = { version = "*", default-features = false, features = ["ws"] }
``` ```
</TabItem> </TabItem>
<TabItem value="rest" label="仅 Websocket">
在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `ws` 特性。 <TabItem value="native" label="仅原生连接">
在 `Cargo.toml` 文件中添加 [taos][taos],并启用 `native` 特性:
```toml ```toml
[dependencies] [dependencies]
taos = { version = "*", default-features = false, features = ["ws"] } taos = { version = "*", default-features = false, features = ["native"] }
``` ```
</TabItem> </TabItem>
......
...@@ -80,7 +80,7 @@ pip3 install git+https://github.com/taosdata/taos-connector-python.git ...@@ -80,7 +80,7 @@ pip3 install git+https://github.com/taosdata/taos-connector-python.git
### 安装验证 ### 安装验证
<Tabs groupId="connect" default="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
对于原生连接,需要验证客户端驱动和 Python 连接器本身是否都正确安装。如果能成功导入 `taos` 模块,则说明已经正确安装了客户端驱动和 Python 连接器。可在 Python 交互式 Shell 中输入: 对于原生连接,需要验证客户端驱动和 Python 连接器本身是否都正确安装。如果能成功导入 `taos` 模块,则说明已经正确安装了客户端驱动和 Python 连接器。可在 Python 交互式 Shell 中输入:
...@@ -118,7 +118,7 @@ Requirement already satisfied: taospy in c:\users\username\appdata\local\program ...@@ -118,7 +118,7 @@ Requirement already satisfied: taospy in c:\users\username\appdata\local\program
在用连接器建立连接之前,建议先测试本地 TDengine CLI 到 TDengine 集群的连通性。 在用连接器建立连接之前,建议先测试本地 TDengine CLI 到 TDengine 集群的连通性。
<Tabs> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
请确保 TDengine 集群已经启动, 且集群中机器的 FQDN (如果启动的是单机版,FQDN 默认为 hostname)在本机能够解析, 可用 `ping` 命令进行测试: 请确保 TDengine 集群已经启动, 且集群中机器的 FQDN (如果启动的是单机版,FQDN 默认为 hostname)在本机能够解析, 可用 `ping` 命令进行测试:
...@@ -173,7 +173,7 @@ curl -u root:taosdata http://<FQDN>:<PORT>/rest/sql -d "select server_version()" ...@@ -173,7 +173,7 @@ curl -u root:taosdata http://<FQDN>:<PORT>/rest/sql -d "select server_version()"
以下示例代码假设 TDengine 安装在本机, 且 FQDN 和 serverPort 都使用了默认配置。 以下示例代码假设 TDengine 安装在本机, 且 FQDN 和 serverPort 都使用了默认配置。
<Tabs> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接" groupId="connect"> <TabItem value="native" label="原生连接" groupId="connect">
```python ```python
...@@ -219,7 +219,7 @@ curl -u root:taosdata http://<FQDN>:<PORT>/rest/sql -d "select server_version()" ...@@ -219,7 +219,7 @@ curl -u root:taosdata http://<FQDN>:<PORT>/rest/sql -d "select server_version()"
### 基本使用 ### 基本使用
<Tabs default="native" groupId="connect"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
##### TaosConnection 类的使用 ##### TaosConnection 类的使用
...@@ -289,7 +289,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线 ...@@ -289,7 +289,7 @@ TaosCursor 类使用原生连接进行写入、查询操作。在客户端多线
### 与 pandas 一起使用 ### 与 pandas 一起使用
<Tabs default="native" groupId="connect"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
```python ```python
......
...@@ -85,7 +85,7 @@ REST 连接器支持所有能运行 Node.js 的平台。 ...@@ -85,7 +85,7 @@ REST 连接器支持所有能运行 Node.js 的平台。
### 使用 npm 安装 ### 使用 npm 安装
<Tabs defaultValue="install_native"> <Tabs defaultValue="install_rest">
<TabItem value="install_native" label="安装原生连接器"> <TabItem value="install_native" label="安装原生连接器">
```bash ```bash
...@@ -124,7 +124,7 @@ node nodejsChecker.js host=localhost ...@@ -124,7 +124,7 @@ node nodejsChecker.js host=localhost
请选择使用一种连接器。 请选择使用一种连接器。
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
安装并引用 `@tdengine/client` 包。 安装并引用 `@tdengine/client` 包。
......
...@@ -35,7 +35,7 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx" ...@@ -35,7 +35,7 @@ import CSAsyncQuery from "../07-develop/04-query-data/_cs_async.mdx"
## 支持的功能特性 ## 支持的功能特性
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
...@@ -96,7 +96,7 @@ dotnet add exmaple.csproj reference src/TDengine.csproj ...@@ -96,7 +96,7 @@ dotnet add exmaple.csproj reference src/TDengine.csproj
## 建立连接 ## 建立连接
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
...@@ -171,7 +171,7 @@ namespace TDengineExample ...@@ -171,7 +171,7 @@ namespace TDengineExample
#### SQL 写入 #### SQL 写入
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
...@@ -203,7 +203,7 @@ namespace TDengineExample ...@@ -203,7 +203,7 @@ namespace TDengineExample
#### 参数绑定 #### 参数绑定
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
...@@ -227,7 +227,7 @@ namespace TDengineExample ...@@ -227,7 +227,7 @@ namespace TDengineExample
#### 同步查询 #### 同步查询
<Tabs defaultValue="native"> <Tabs defaultValue="rest">
<TabItem value="native" label="原生连接"> <TabItem value="native" label="原生连接">
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
$ taos $ taos
taos> show databases; taos> show databases;
name | create_time | vgroups | ntables | replica | strict | duration | keep | buffer | pagesize | pages | minrows | maxrows | comp | precision | status | retention | single_stable | cachemodel | cachesize | wal_level | wal_fsync_period | wal_retention_period | wal_retention_size | wal_roll_period | wal_seg_size | name |
========================================================================================================================================================================================================================================================================================================================================================================================================================================================================= =================================
information_schema | NULL | NULL | 14 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | ready | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | information_schema |
performance_schema | NULL | NULL | 3 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | ready | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | performance_schema |
db | 2022-08-04 14:14:49.385 | 2 | 4 | 1 | off | 14400m | 5254560m,5254560m,5254560m | 96 | 4 | 256 | 100 | 4096 | 2 | ms | ready | NULL | false | none | 1 | 1 | 3000 | 0 | 0 | 0 | 0 | db |
Query OK, 3 rows in database (0.019154s) Query OK, 3 rows in database (0.019154s)
taos> taos>
......
...@@ -182,6 +182,14 @@ TDengine 中,所有表的第一列都必须是时间戳类型,且为其主 ...@@ -182,6 +182,14 @@ TDengine 中,所有表的第一列都必须是时间戳类型,且为其主
select _rowts, max(current) from meters; select _rowts, max(current) from meters;
``` ```
**\_IROWTS**
\_irowts 伪列只能与 interp 函数一起使用,用于返回 interp 函数插值结果对应的时间戳列。
```sql
select _irowts, interp(current) from meters range('2020-01-01 10:00:00', '2020-01-01 10:30:00') every(1s) fill(linear);
```
## 查询对象 ## 查询对象
FROM 关键字后面可以是若干个表(超级表)列表,也可以是子查询的结果。 FROM 关键字后面可以是若干个表(超级表)列表,也可以是子查询的结果。
......
此差异已折叠。
...@@ -344,6 +344,7 @@ description: TDengine 保留关键字的详细列表 ...@@ -344,6 +344,7 @@ description: TDengine 保留关键字的详细列表
### \_ ### \_
- \_C0 - \_C0
- \_IROWTS
- \_QDURATION - \_QDURATION
- \_QEND - \_QEND
- \_QSTART - \_QSTART
......
...@@ -12,7 +12,15 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数 ...@@ -12,7 +12,15 @@ TDengine 内置了一个名为 `INFORMATION_SCHEMA` 的数据库,提供对数
4. TDengine 在后续演进中可以灵活的添加已有 INFORMATION_SCHEMA 中表的列,而不用担心对既有业务系统造成影响 4. TDengine 在后续演进中可以灵活的添加已有 INFORMATION_SCHEMA 中表的列,而不用担心对既有业务系统造成影响
5. 与其他数据库系统更具互操作性。例如,Oracle 数据库用户熟悉查询 Oracle 数据字典中的表 5. 与其他数据库系统更具互操作性。例如,Oracle 数据库用户熟悉查询 Oracle 数据字典中的表
Note: 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们仍然被保留。 :::info
- 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们仍然被保留。
- 系统表中的一些列可能是关键字,在查询时需要使用转义符'\`',例如查询数据库 test 有几个 VGROUP:
```sql
select `vgroups` from ins_databases where name = 'test';
```
:::
本章将详细介绍 `INFORMATION_SCHEMA` 这个内置元数据库中的表和表结构。 本章将详细介绍 `INFORMATION_SCHEMA` 这个内置元数据库中的表和表结构。
...@@ -103,7 +111,11 @@ Note: 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们 ...@@ -103,7 +111,11 @@ Note: 由于 SHOW 语句已经被开发者熟悉和广泛使用,所以它们
| 24 | wal_retention_period | INT | WAL 的保存时长 | | 24 | wal_retention_period | INT | WAL 的保存时长 |
| 25 | wal_retention_size | INT | WAL 的保存上限 | | 25 | wal_retention_size | INT | WAL 的保存上限 |
| 26 | wal_roll_period | INT | wal 文件切换时长 | | 26 | wal_roll_period | INT | wal 文件切换时长 |
| 27 | wal_segment_size | wal 单个文件大小 | | 27 | wal_segment_size | BIGINT | wal 单个文件大小 |
| 28 | stt_trigger | SMALLINT | 触发文件合并的落盘文件的个数 |
| 29 | table_prefix | SMALLINT | 内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的前缀的长度 |
| 30 | table_suffix | SMALLINT | 内部存储引擎根据表名分配存储该表数据的 VNODE 时要忽略的后缀的长度 |
| 31 | tsdb_pagesize | INT | 时序数据存储引擎中的页大小 |
## INS_FUNCTIONS ## INS_FUNCTIONS
......
...@@ -11,12 +11,13 @@ description: "TDengine 3.0 版本的语法变更说明" ...@@ -11,12 +11,13 @@ description: "TDengine 3.0 版本的语法变更说明"
| 1 | VARCHAR | 新增 | BINARY类型的别名。 | 1 | VARCHAR | 新增 | BINARY类型的别名。
| 2 | TIMESTAMP字面量 | 新增 | 新增支持 TIMESTAMP 'timestamp format' 语法。 | 2 | TIMESTAMP字面量 | 新增 | 新增支持 TIMESTAMP 'timestamp format' 语法。
| 3 | _ROWTS伪列 | 新增 | 表示时间戳主键。是_C0伪列的别名。 | 3 | _ROWTS伪列 | 新增 | 表示时间戳主键。是_C0伪列的别名。
| 4 | INFORMATION_SCHEMA | 新增 | 包含各种SCHEMA定义的系统数据库。 | 4 | _IROWTS伪列 | 新增 | 用于返回 interp 函数插值结果对应的时间戳列。
| 5 | PERFORMANCE_SCHEMA | 新增 | 包含运行信息的系统数据库。 | 5 | INFORMATION_SCHEMA | 新增 | 包含各种SCHEMA定义的系统数据库。
| 6 | 连续查询 | 废除 | 不再支持连续查询。相关的各种语法和接口废除。 | 6 | PERFORMANCE_SCHEMA | 新增 | 包含运行信息的系统数据库。
| 7 | 混合运算 | 增强 | 查询中的混合运算(标量运算和矢量运算混合)全面增强,SELECT的各个子句均全面支持符合语法语义的混合运算。 | 7 | 连续查询 | 废除 | 不再支持连续查询。相关的各种语法和接口废除。
| 8 | 标签运算 | 新增 |在查询中,标签列可以像普通列一样参与各种运算,用于各种子句。 | 8 | 混合运算 | 增强 | 查询中的混合运算(标量运算和矢量运算混合)全面增强,SELECT的各个子句均全面支持符合语法语义的混合运算。
| 9 | 时间线子句和时间函数用于超级表查询 | 增强 |没有PARTITION BY时,超级表的数据会被合并成一条时间线。 | 9 | 标签运算 | 新增 |在查询中,标签列可以像普通列一样参与各种运算,用于各种子句。
| 10 | 时间线子句和时间函数用于超级表查询 | 增强 |没有PARTITION BY时,超级表的数据会被合并成一条时间线。
## SQL 语句变更 ## SQL 语句变更
......
...@@ -177,12 +177,21 @@ taos --dump-config ...@@ -177,12 +177,21 @@ taos --dump-config
### maxNumOfDistinctRes ### maxNumOfDistinctRes
| 属性 | 说明 | | 属性 | 说明 |
| -------- | -------------------------------- | --- | | -------- | -------------------------------- |
| 适用范围 | 仅服务端适用 | | 适用范围 | 仅服务端适用 |
| 含义 | 允许返回的 distinct 结果最大行数 | | 含义 | 允许返回的 distinct 结果最大行数 |
| 取值范围 | 默认值为 10 万,最大值 1 亿 | | 取值范围 | 默认值为 10 万,最大值 1 亿 |
| 缺省值 | 10 万 | | 缺省值 | 10 万 |
### keepColumnName
| 属性 | 说明 |
| -------- | -------------------------------- |
| 适用范围 | 仅客户端适用 |
| 含义 | Last、First、LastRow 函数查询时,返回的列名是否包含函数名。 |
| 取值范围 | 0 表示包含函数名,1 表示不包含函数名。 |
| 缺省值 | 0 |
## 区域相关 ## 区域相关
### timezone ### timezone
......
...@@ -67,9 +67,12 @@ st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000 ...@@ -67,9 +67,12 @@ st,t1=3,t2=4,t3=t3 c1=3i64,c3="passit",c2=false,c4=4f64 1626006833639000000
"measurement,tag_key1=tag_value1,tag_key2=tag_value2" "measurement,tag_key1=tag_value1,tag_key2=tag_value2"
``` ```
:::tip
需要注意的是,这里的 tag_key1, tag_key2 并不是用户输入的标签的原始顺序,而是使用了标签名称按照字符串升序排列后的结果。所以,tag_key1 并不是在行协议中输入的第一个标签。 需要注意的是,这里的 tag_key1, tag_key2 并不是用户输入的标签的原始顺序,而是使用了标签名称按照字符串升序排列后的结果。所以,tag_key1 并不是在行协议中输入的第一个标签。
排列完成以后计算该字符串的 MD5 散列值 "md5_val"。然后将计算的结果与字符串组合生成表名:“t_md5_val”。其中的 “t_” 是固定的前缀,每个通过该映射关系自动生成的表都具有该前缀。 排列完成以后计算该字符串的 MD5 散列值 "md5_val"。然后将计算的结果与字符串组合生成表名:“t_md5_val”。其中的 “t_” 是固定的前缀,每个通过该映射关系自动生成的表都具有该前缀。
为了让用户可以指定生成的表名,可以通过配置 smlChildTableName 来指定(比如 配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一次自动建表时指定的 tag_set,其他的会忽略)。 :::tip
为了让用户可以指定生成的表名,可以通过在taos.cfg里配置 smlChildTableName 参数来指定。
举例如下:配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1,注意如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。
2. 如果解析行协议获得的超级表不存在,则会创建这个超级表(不建议手动创建超级表,不然插入数据可能异常)。 2. 如果解析行协议获得的超级表不存在,则会创建这个超级表(不建议手动创建超级表,不然插入数据可能异常)。
3. 如果解析行协议获得子表不存在,则 Schemaless 会按照步骤 1 或 2 确定的子表名来创建子表。 3. 如果解析行协议获得子表不存在,则 Schemaless 会按照步骤 1 或 2 确定的子表名来创建子表。
......
...@@ -51,5 +51,6 @@ port: 8125 ...@@ -51,5 +51,6 @@ port: 8125
增加如下内容后启动 StatsD(假设配置文件修改为 config.js)。 增加如下内容后启动 StatsD(假设配置文件修改为 config.js)。
``` ```
npm install
node stats.js config.js & node stats.js config.js &
``` ```
...@@ -22,6 +22,5 @@ ...@@ -22,6 +22,5 @@
username = "root" username = "root"
password = "taosdata" password = "taosdata"
data_format = "influx" data_format = "influx"
influx_max_line_bytes = 250
``` ```
...@@ -29,21 +29,20 @@ Prometheus 提供了 `remote_write` 和 `remote_read` 接口来利用其它数 ...@@ -29,21 +29,20 @@ Prometheus 提供了 `remote_write` 和 `remote_read` 接口来利用其它数
### 使用 TDengine CLI 查询写入数据 ### 使用 TDengine CLI 查询写入数据
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
test | 2022-04-12 08:07:58.756 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 2 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
prometheus_data | 2022-04-20 07:21:09.202 | 158 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | prometheus_data |
db | 2022-04-15 06:37:08.512 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | Query OK, 3 row(s) in set (0.000585s)
Query OK, 4 row(s) in set (0.000585s)
taos> use prometheus_data; taos> use prometheus_data;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
metrics | 2022-04-20 07:21:09.209 | 2 | 1 | 1389 | metrics |
Query OK, 1 row(s) in set (0.000487s) Query OK, 1 row(s) in set (0.000487s)
taos> select * from metrics limit 10; taos> select * from metrics limit 10;
...@@ -88,3 +87,7 @@ VALUE TIMESTAMP ...@@ -88,3 +87,7 @@ VALUE TIMESTAMP
``` ```
:::note
- TDengine 默认生成的子表名是根据规则生成的唯一 ID 值。
:::
...@@ -16,6 +16,7 @@ Telegraf 是一款十分流行的指标采集开源软件。在数据采集和 ...@@ -16,6 +16,7 @@ Telegraf 是一款十分流行的指标采集开源软件。在数据采集和
- TDengine 集群已经部署并正常运行 - TDengine 集群已经部署并正常运行
- taosAdapter 已经安装并正常运行。具体细节请参考 [taosAdapter 的使用手册](/reference/taosadapter) - taosAdapter 已经安装并正常运行。具体细节请参考 [taosAdapter 的使用手册](/reference/taosadapter)
- Telegraf 已经安装。安装 Telegraf 请参考[官方文档](https://docs.influxdata.com/telegraf/v1.22/install/) - Telegraf 已经安装。安装 Telegraf 请参考[官方文档](https://docs.influxdata.com/telegraf/v1.22/install/)
- Telegraf 默认采集系统运行状态数据。通过使能[输入插件](https://docs.influxdata.com/telegraf/v1.22/plugins/)方式可以输出[其他格式](https://docs.influxdata.com/telegraf/v1.24/data_formats/input/)的数据到 Telegraf 再写入到 TDengine中。
## 配置步骤 ## 配置步骤
<Telegraf /> <Telegraf />
...@@ -32,26 +33,27 @@ sudo systemctl restart telegraf ...@@ -32,26 +33,27 @@ sudo systemctl restart telegraf
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
telegraf | 2022-04-20 08:47:53.488 | 22 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 9 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
Query OK, 2 row(s) in set (0.002401s) telegraf |
Query OK, 3 rows in database (0.010568s)
taos> use telegraf; taos> use telegraf;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
swap | 2022-04-20 08:47:53.532 | 7 | 1 | 1 | swap |
cpu | 2022-04-20 08:48:03.488 | 11 | 2 | 5 | cpu |
system | 2022-04-20 08:47:53.512 | 8 | 1 | 1 | system |
diskio | 2022-04-20 08:47:53.550 | 12 | 2 | 15 | diskio |
kernel | 2022-04-20 08:47:53.503 | 6 | 1 | 1 | kernel |
mem | 2022-04-20 08:47:53.521 | 35 | 1 | 1 | mem |
processes | 2022-04-20 08:47:53.555 | 12 | 1 | 1 | processes |
disk | 2022-04-20 08:47:53.541 | 8 | 5 | 2 | disk |
Query OK, 8 row(s) in set (0.000521s) Query OK, 8 row(s) in set (0.000521s)
taos> select * from telegraf.system limit 10; taos> select * from telegraf.system limit 10;
...@@ -66,3 +68,11 @@ taos> select * from telegraf.system limit 10; ...@@ -66,3 +68,11 @@ taos> select * from telegraf.system limit 10;
| |
Query OK, 3 row(s) in set (0.013269s) Query OK, 3 row(s) in set (0.013269s)
``` ```
:::note
- TDengine 接收 influxdb 格式数据默认生成的子表名是根据规则生成的唯一 ID 值。
用户如需指定生成的表名,可以通过在 taos.cfg 里配置 smlChildTableName 参数来指定。如果通过控制输入数据格式,即可利用 TDengine 这个功能指定生成的表名。
举例如下:配置 smlChildTableName=tname 插入数据为 st,tname=cpu1,t1=4 c1=3 1626006833639000000 则创建的表名为 cpu1。如果多行数据 tname 相同,但是后面的 tag_set 不同,则使用第一行自动建表时指定的 tag_set,其他的行会忽略)。[TDengine 无模式写入参考指南](/reference/schemaless/#无模式写入行协议)
:::
...@@ -32,28 +32,29 @@ sudo systemctl restart collectd ...@@ -32,28 +32,29 @@ sudo systemctl restart collectd
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
collectd | 2022-04-20 09:27:45.460 | 95 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
Query OK, 2 row(s) in set (0.003266s) collectd |
Query OK, 3 row(s) in set (0.003266s)
taos> use collectd; taos> use collectd;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
load_1 | 2022-04-20 09:27:45.492 | 2 | 2 | 1 | load_1 |
memory_value | 2022-04-20 09:27:45.463 | 2 | 3 | 6 | memory_value |
df_value | 2022-04-20 09:27:45.463 | 2 | 4 | 25 | df_value |
load_2 | 2022-04-20 09:27:45.501 | 2 | 2 | 1 | load_2 |
load_0 | 2022-04-20 09:27:45.485 | 2 | 2 | 1 | load_0 |
interface_1 | 2022-04-20 09:27:45.488 | 2 | 3 | 12 | interface_1 |
irq_value | 2022-04-20 09:27:45.476 | 2 | 3 | 31 | irq_value |
interface_0 | 2022-04-20 09:27:45.480 | 2 | 3 | 12 | interface_0 |
entropy_value | 2022-04-20 09:27:45.473 | 2 | 2 | 1 | entropy_value |
swap_value | 2022-04-20 09:27:45.477 | 2 | 3 | 5 | swap_value |
Query OK, 10 row(s) in set (0.002236s) Query OK, 10 row(s) in set (0.002236s)
taos> select * from collectd.memory_value limit 10; taos> select * from collectd.memory_value limit 10;
...@@ -72,3 +73,7 @@ taos> select * from collectd.memory_value limit 10; ...@@ -72,3 +73,7 @@ taos> select * from collectd.memory_value limit 10;
Query OK, 10 row(s) in set (0.010348s) Query OK, 10 row(s) in set (0.010348s)
``` ```
:::note
- TDengine 默认生成的子表名是根据规则生成的唯一 ID 值。
:::
...@@ -27,7 +27,7 @@ StatsD 是汇总和总结应用指标的一个简单的守护进程,近些年 ...@@ -27,7 +27,7 @@ StatsD 是汇总和总结应用指标的一个简单的守护进程,近些年
``` ```
$ node stats.js config.js & $ node stats.js config.js &
[1] 8546 [1] 8546
$ 20 Apr 09:54:41 - [8546] reading config file: exampleConfig.js $ 20 Apr 09:54:41 - [8546] reading config file: config.js
20 Apr 09:54:41 - server is up INFO 20 Apr 09:54:41 - server is up INFO
``` ```
...@@ -41,19 +41,20 @@ $ echo "foo:1|c" | nc -u -w0 127.0.0.1 8125 ...@@ -41,19 +41,20 @@ $ echo "foo:1|c" | nc -u -w0 127.0.0.1 8125
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | information_schema |
statsd | 2022-04-20 09:54:51.220 | 1 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | performance_schema |
Query OK, 2 row(s) in set (0.003142s) statsd |
Query OK, 3 row(s) in set (0.003142s)
taos> use statsd; taos> use statsd;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
foo | 2022-04-20 09:54:51.234 | 2 | 1 | 1 | foo |
Query OK, 1 row(s) in set (0.002161s) Query OK, 1 row(s) in set (0.002161s)
taos> select * from foo; taos> select * from foo;
...@@ -64,3 +65,8 @@ Query OK, 1 row(s) in set (0.004179s) ...@@ -64,3 +65,8 @@ Query OK, 1 row(s) in set (0.004179s)
taos> taos>
``` ```
:::note
- TDengine will automatically create unique IDs for sub-table names by the rule.
:::
...@@ -37,39 +37,46 @@ sudo systemctl restart icinga2 ...@@ -37,39 +37,46 @@ sudo systemctl restart icinga2
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | information_schema |
icinga2 | 2022-04-20 12:11:39.697 | 13 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | performance_schema |
Query OK, 2 row(s) in set (0.001867s) icinga2 |
Query OK, 3 row(s) in set (0.001867s)
taos> use icinga2; taos> use icinga2;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
icinga.service.users.state_... | 2022-04-20 12:11:39.726 | 2 | 1 | 1 | icinga.service.users.state_... |
icinga.service.users.acknow... | 2022-04-20 12:11:39.756 | 2 | 1 | 1 | icinga.service.users.acknow... |
icinga.service.procs.downti... | 2022-04-20 12:11:44.541 | 2 | 1 | 1 | icinga.service.procs.downti... |
icinga.service.users.users | 2022-04-20 12:11:39.770 | 2 | 1 | 1 | icinga.service.users.users |
icinga.service.procs.procs_min | 2022-04-20 12:11:44.599 | 2 | 1 | 1 | icinga.service.procs.procs_min |
icinga.service.users.users_min | 2022-04-20 12:11:39.809 | 2 | 1 | 1 | icinga.service.users.users_min |
icinga.check.max_check_atte... | 2022-04-20 12:11:39.847 | 2 | 3 | 2 | icinga.check.max_check_atte... |
icinga.service.procs.state_... | 2022-04-20 12:11:44.522 | 2 | 1 | 1 | icinga.service.procs.state_... |
icinga.service.procs.procs_... | 2022-04-20 12:11:44.576 | 2 | 1 | 1 | icinga.service.procs.procs_... |
icinga.service.users.users_... | 2022-04-20 12:11:39.796 | 2 | 1 | 1 | icinga.service.users.users_... |
icinga.check.latency | 2022-04-20 12:11:39.869 | 2 | 3 | 2 | icinga.check.latency |
icinga.service.procs.procs_... | 2022-04-20 12:11:44.588 | 2 | 1 | 1 | icinga.service.procs.procs_... |
icinga.service.users.downti... | 2022-04-20 12:11:39.746 | 2 | 1 | 1 | icinga.service.users.downti... |
icinga.service.users.users_... | 2022-04-20 12:11:39.783 | 2 | 1 | 1 | icinga.service.users.users_... |
icinga.service.users.reachable | 2022-04-20 12:11:39.736 | 2 | 1 | 1 | icinga.service.users.reachable |
icinga.service.procs.procs | 2022-04-20 12:11:44.565 | 2 | 1 | 1 | icinga.service.procs.procs |
icinga.service.procs.acknow... | 2022-04-20 12:11:44.554 | 2 | 1 | 1 | icinga.service.procs.acknow... |
icinga.service.procs.state | 2022-04-20 12:11:44.509 | 2 | 1 | 1 | icinga.service.procs.state |
icinga.service.procs.reachable | 2022-04-20 12:11:44.532 | 2 | 1 | 1 | icinga.service.procs.reachable |
icinga.check.current_attempt | 2022-04-20 12:11:39.825 | 2 | 3 | 2 | icinga.check.current_attempt |
icinga.check.execution_time | 2022-04-20 12:11:39.898 | 2 | 3 | 2 | icinga.check.execution_time |
icinga.service.users.state | 2022-04-20 12:11:39.704 | 2 | 1 | 1 | icinga.service.users.state |
Query OK, 22 row(s) in set (0.002317s) Query OK, 22 row(s) in set (0.002317s)
``` ```
:::note
- TDengine 默认生成的子表名是根据规则生成的唯一 ID 值。
:::
...@@ -34,35 +34,42 @@ sudo systemctl restart taosadapter ...@@ -34,35 +34,42 @@ sudo systemctl restart taosadapter
``` ```
taos> show databases; taos> show databases;
name | created_time | ntables | vgroups | replica | quorum | days | keep | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | cachelast | precision | update | status | name |
==================================================================================================================================================================================================================================================================================== =================================
tcollector | 2022-04-20 12:44:49.604 | 88 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ns | 2 | ready | information_schema |
log | 2022-04-20 07:19:50.260 | 11 | 1 | 1 | 1 | 10 | 3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | 0 | ms | 0 | ready | performance_schema |
Query OK, 2 row(s) in set (0.002679s) tcollector |
Query OK, 3 rows in database (0.001647s)
taos> use tcollector; taos> use tcollector;
Database changed. Database changed.
taos> show stables; taos> show stables;
name | created_time | columns | tags | tables | name |
============================================================================================ =================================
proc.meminfo.hugepages_rsvd | 2022-04-20 12:44:53.945 | 2 | 1 | 1 | proc.meminfo.hugepages_rsvd |
proc.meminfo.directmap1g | 2022-04-20 12:44:54.110 | 2 | 1 | 1 | proc.meminfo.directmap1g |
proc.meminfo.vmallocchunk | 2022-04-20 12:44:53.724 | 2 | 1 | 1 | proc.meminfo.vmallocchunk |
proc.meminfo.hugepagesize | 2022-04-20 12:44:54.004 | 2 | 1 | 1 | proc.meminfo.hugepagesize |
tcollector.reader.lines_dro... | 2022-04-20 12:44:49.675 | 2 | 1 | 1 | tcollector.reader.lines_dro... |
proc.meminfo.sunreclaim | 2022-04-20 12:44:53.437 | 2 | 1 | 1 | proc.meminfo.sunreclaim |
proc.stat.ctxt | 2022-04-20 12:44:55.363 | 2 | 1 | 1 | proc.stat.ctxt |
proc.meminfo.swaptotal | 2022-04-20 12:44:53.158 | 2 | 1 | 1 | proc.meminfo.swaptotal |
proc.uptime.total | 2022-04-20 12:44:52.813 | 2 | 1 | 1 | proc.uptime.total |
tcollector.collector.lines_... | 2022-04-20 12:44:49.895 | 2 | 2 | 51 | tcollector.collector.lines_... |
proc.meminfo.vmallocused | 2022-04-20 12:44:53.704 | 2 | 1 | 1 | proc.meminfo.vmallocused |
proc.meminfo.memavailable | 2022-04-20 12:44:52.939 | 2 | 1 | 1 | proc.meminfo.memavailable |
sys.numa.foreign_allocs | 2022-04-20 12:44:57.929 | 2 | 2 | 1 | sys.numa.foreign_allocs |
proc.meminfo.committed_as | 2022-04-20 12:44:53.639 | 2 | 1 | 1 | proc.meminfo.committed_as |
proc.vmstat.pswpin | 2022-04-20 12:44:54.177 | 2 | 1 | 1 | proc.vmstat.pswpin |
proc.meminfo.cmafree | 2022-04-20 12:44:53.865 | 2 | 1 | 1 | proc.meminfo.cmafree |
proc.meminfo.mapped | 2022-04-20 12:44:53.349 | 2 | 1 | 1 | proc.meminfo.mapped |
proc.vmstat.pgmajfault | 2022-04-20 12:44:54.251 | 2 | 1 | 1 | proc.vmstat.pgmajfault |
... ...
``` ```
:::note
- TDengine 默认生成的子表名是根据规则生成的唯一 ID 值。
:::
...@@ -61,7 +61,6 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如 ...@@ -61,7 +61,6 @@ IT 运维监测数据通常都是对时间特性比较敏感的数据,例如
username = "<TDengine's username>" username = "<TDengine's username>"
password = "<TDengine's password>" password = "<TDengine's password>"
data_format = "influx" data_format = "influx"
influx_max_line_bytes = 250
``` ```
然后重启 Telegraf: 然后重启 Telegraf:
......
...@@ -6,6 +6,14 @@ description: TDengine 发布历史、Release Notes 及下载链接 ...@@ -6,6 +6,14 @@ description: TDengine 发布历史、Release Notes 及下载链接
import Release from "/components/ReleaseV3"; import Release from "/components/ReleaseV3";
## 3.0.1.4
<Release type="tdengine" version="3.0.1.4" />
## 3.0.1.3
<Release type="tdengine" version="3.0.1.3" />
## 3.0.1.2 ## 3.0.1.2
<Release type="tdengine" version="3.0.1.2" /> <Release type="tdengine" version="3.0.1.2" />
......
...@@ -6,6 +6,14 @@ description: taosTools 的发布历史、Release Notes 和下载链接 ...@@ -6,6 +6,14 @@ description: taosTools 的发布历史、Release Notes 和下载链接
import Release from "/components/ReleaseV3"; import Release from "/components/ReleaseV3";
## 2.2.4
<Release type="tools" version="2.2.4" />
## 2.2.3
<Release type="tools" version="2.2.3" />
## 2.2.2 ## 2.2.2
<Release type="tools" version="2.2.2" /> <Release type="tools" version="2.2.2" />
......
# TDengine driver connector for Lua # TDengine driver connector for Lua
It's a Lua implementation for [TDengine](https://github.com/taosdata/TDengine), an open-sourced big data platform designed and optimized for the Internet of Things (IoT), Connected Cars, Industrial IoT, and IT Infrastructure and Application Monitoring. You may need to install Lua5.3 . It's a Lua implementation for [TDengine](https://github.com/taosdata/TDengine), an open-sourced big data platform designed and optimized for the Internet of Things (IoT), Connected Cars, Industrial IoT, and IT Infrastructure and Application Monitoring. You may need to install Lua5.3 .
As TDengine is built with lua-enable with default configure, the built-in lua lib conflicts with external lua lib. The following commands require TDengine built with lua-disable.
To disable built-in lua:
```
mkdir debug && cd debug
cmake .. -DBUILD_LUA=false && cmake --build .
```
## Lua Dependencies ## Lua Dependencies
- Lua: - Lua:
......
...@@ -29,7 +29,7 @@ static int l_connect(lua_State *L){ ...@@ -29,7 +29,7 @@ static int l_connect(lua_State *L){
luaL_checktype(L, 1, LUA_TTABLE); luaL_checktype(L, 1, LUA_TTABLE);
lua_getfield(L, 1,"host"); lua_getfield(L, 1,"host");
if (lua_isstring(L,-1)){ if (lua_isstring(L, -1)){
host = lua_tostring(L, -1); host = lua_tostring(L, -1);
// printf("host = %s\n", host); // printf("host = %s\n", host);
} }
...@@ -58,8 +58,9 @@ static int l_connect(lua_State *L){ ...@@ -58,8 +58,9 @@ static int l_connect(lua_State *L){
//printf("password = %s\n", password); //printf("password = %s\n", password);
} }
lua_settop(L,0); lua_settop(L, 0);
taos_init();
lua_newtable(L); lua_newtable(L);
int table_index = lua_gettop(L); int table_index = lua_gettop(L);
...@@ -125,7 +126,7 @@ static int l_query(lua_State *L){ ...@@ -125,7 +126,7 @@ static int l_query(lua_State *L){
//printf("row index:%d\n",rows); //printf("row index:%d\n",rows);
rows++; rows++;
lua_pushnumber(L,rows); lua_pushnumber(L, rows);
lua_newtable(L); lua_newtable(L);
for (int i = 0; i < num_fields; ++i) { for (int i = 0; i < num_fields; ++i) {
...@@ -136,15 +137,19 @@ static int l_query(lua_State *L){ ...@@ -136,15 +137,19 @@ static int l_query(lua_State *L){
lua_pushstring(L,fields[i].name); lua_pushstring(L,fields[i].name);
int32_t* length = taos_fetch_lengths(result); int32_t* length = taos_fetch_lengths(result);
switch (fields[i].type) { switch (fields[i].type) {
case TSDB_DATA_TYPE_UTINYINT:
case TSDB_DATA_TYPE_TINYINT: case TSDB_DATA_TYPE_TINYINT:
lua_pushinteger(L,*((char *)row[i])); lua_pushinteger(L,*((char *)row[i]));
break; break;
case TSDB_DATA_TYPE_USMALLINT:
case TSDB_DATA_TYPE_SMALLINT: case TSDB_DATA_TYPE_SMALLINT:
lua_pushinteger(L,*((short *)row[i])); lua_pushinteger(L,*((short *)row[i]));
break; break;
case TSDB_DATA_TYPE_UINT:
case TSDB_DATA_TYPE_INT: case TSDB_DATA_TYPE_INT:
lua_pushinteger(L,*((int *)row[i])); lua_pushinteger(L,*((int *)row[i]));
break; break;
case TSDB_DATA_TYPE_UBIGINT:
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
lua_pushinteger(L,*((int64_t *)row[i])); lua_pushinteger(L,*((int64_t *)row[i]));
break; break;
...@@ -154,6 +159,7 @@ static int l_query(lua_State *L){ ...@@ -154,6 +159,7 @@ static int l_query(lua_State *L){
case TSDB_DATA_TYPE_DOUBLE: case TSDB_DATA_TYPE_DOUBLE:
lua_pushnumber(L,*((double *)row[i])); lua_pushnumber(L,*((double *)row[i]));
break; break;
case TSDB_DATA_TYPE_JSON:
case TSDB_DATA_TYPE_BINARY: case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_NCHAR:
//printf("type:%d, max len:%d, current len:%d\n",fields[i].type, fields[i].bytes, length[i]); //printf("type:%d, max len:%d, current len:%d\n",fields[i].type, fields[i].bytes, length[i]);
...@@ -197,7 +203,7 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ ...@@ -197,7 +203,7 @@ void async_query_callback(void *param, TAOS_RES *result, int code){
printf("failed, reason:%s\n", taos_errstr(result)); printf("failed, reason:%s\n", taos_errstr(result));
lua_pushinteger(L, -1); lua_pushinteger(L, -1);
lua_setfield(L, table_index, "code"); lua_setfield(L, table_index, "code");
lua_pushstring(L,"something is wrong");// taos_errstr(taos)); lua_pushstring(L, taos_errstr(result));
lua_setfield(L, table_index, "error"); lua_setfield(L, table_index, "error");
}else{ }else{
//printf("success to async query.\n"); //printf("success to async query.\n");
...@@ -214,9 +220,9 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ ...@@ -214,9 +220,9 @@ void async_query_callback(void *param, TAOS_RES *result, int code){
static int l_async_query(lua_State *L){ static int l_async_query(lua_State *L){
int r = luaL_ref(L, LUA_REGISTRYINDEX); int r = luaL_ref(L, LUA_REGISTRYINDEX);
TAOS * taos = (TAOS*)lua_topointer(L,1); TAOS * taos = (TAOS*)lua_topointer(L, 1);
const char * sqlstr = lua_tostring(L,2); const char * sqlstr = lua_tostring(L, 2);
// int stime = luaL_checknumber(L,3); // int stime = luaL_checknumber(L, 3);
lua_newtable(L); lua_newtable(L);
int table_index = lua_gettop(L); int table_index = lua_gettop(L);
...@@ -224,7 +230,7 @@ static int l_async_query(lua_State *L){ ...@@ -224,7 +230,7 @@ static int l_async_query(lua_State *L){
struct async_query_callback_param *p = malloc(sizeof(struct async_query_callback_param)); struct async_query_callback_param *p = malloc(sizeof(struct async_query_callback_param));
p->state = L; p->state = L;
p->callback=r; p->callback=r;
// printf("r:%d, L:%d\n",r,L); // printf("r:%d, L:%d\n", r, L);
taos_query_a(taos,sqlstr,async_query_callback,p); taos_query_a(taos,sqlstr,async_query_callback,p);
lua_pushnumber(L, 0); lua_pushnumber(L, 0);
...@@ -267,7 +273,7 @@ static const struct luaL_Reg lib[] = { ...@@ -267,7 +273,7 @@ static const struct luaL_Reg lib[] = {
extern int luaopen_luaconnector51(lua_State* L) extern int luaopen_luaconnector51(lua_State* L)
{ {
// luaL_register(L, "luaconnector51", lib); // luaL_register(L, "luaconnector51", lib);
lua_newtable (L); lua_newtable(L);
luaL_setfuncs(L,lib,0); luaL_setfuncs(L,lib,0);
return 1; return 1;
} }
...@@ -29,7 +29,7 @@ static int l_connect(lua_State *L){ ...@@ -29,7 +29,7 @@ static int l_connect(lua_State *L){
luaL_checktype(L, 1, LUA_TTABLE); luaL_checktype(L, 1, LUA_TTABLE);
lua_getfield(L, 1,"host"); lua_getfield(L, 1,"host");
if (lua_isstring(L,-1)){ if (lua_isstring(L, -1)){
host = lua_tostring(L, -1); host = lua_tostring(L, -1);
// printf("host = %s\n", host); // printf("host = %s\n", host);
} }
...@@ -58,7 +58,7 @@ static int l_connect(lua_State *L){ ...@@ -58,7 +58,7 @@ static int l_connect(lua_State *L){
//printf("password = %s\n", password); //printf("password = %s\n", password);
} }
lua_settop(L,0); lua_settop(L, 0);
taos_init(); taos_init();
...@@ -126,7 +126,7 @@ static int l_query(lua_State *L){ ...@@ -126,7 +126,7 @@ static int l_query(lua_State *L){
//printf("row index:%d\n",rows); //printf("row index:%d\n",rows);
rows++; rows++;
lua_pushnumber(L,rows); lua_pushnumber(L, rows);
lua_newtable(L); lua_newtable(L);
for (int i = 0; i < num_fields; ++i) { for (int i = 0; i < num_fields; ++i) {
...@@ -203,7 +203,7 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ ...@@ -203,7 +203,7 @@ void async_query_callback(void *param, TAOS_RES *result, int code){
printf("failed, reason:%s\n", taos_errstr(result)); printf("failed, reason:%s\n", taos_errstr(result));
lua_pushinteger(L, -1); lua_pushinteger(L, -1);
lua_setfield(L, table_index, "code"); lua_setfield(L, table_index, "code");
lua_pushstring(L,"something is wrong");// taos_errstr(taos)); lua_pushstring(L, taos_errstr(result));
lua_setfield(L, table_index, "error"); lua_setfield(L, table_index, "error");
}else{ }else{
//printf("success to async query.\n"); //printf("success to async query.\n");
...@@ -220,9 +220,9 @@ void async_query_callback(void *param, TAOS_RES *result, int code){ ...@@ -220,9 +220,9 @@ void async_query_callback(void *param, TAOS_RES *result, int code){
static int l_async_query(lua_State *L){ static int l_async_query(lua_State *L){
int r = luaL_ref(L, LUA_REGISTRYINDEX); int r = luaL_ref(L, LUA_REGISTRYINDEX);
TAOS * taos = (TAOS*)lua_topointer(L,1); TAOS * taos = (TAOS*)lua_topointer(L, 1);
const char * sqlstr = lua_tostring(L,2); const char * sqlstr = lua_tostring(L, 2);
// int stime = luaL_checknumber(L,3); // int stime = luaL_checknumber(L, 3);
lua_newtable(L); lua_newtable(L);
int table_index = lua_gettop(L); int table_index = lua_gettop(L);
...@@ -230,7 +230,7 @@ static int l_async_query(lua_State *L){ ...@@ -230,7 +230,7 @@ static int l_async_query(lua_State *L){
struct async_query_callback_param *p = malloc(sizeof(struct async_query_callback_param)); struct async_query_callback_param *p = malloc(sizeof(struct async_query_callback_param));
p->state = L; p->state = L;
p->callback=r; p->callback=r;
// printf("r:%d, L:%d\n",r,L); // printf("r:%d, L:%d\n", r, L);
taos_query_a(taos,sqlstr,async_query_callback,p); taos_query_a(taos,sqlstr,async_query_callback,p);
lua_pushnumber(L, 0); lua_pushnumber(L, 0);
......
...@@ -176,8 +176,14 @@ end ...@@ -176,8 +176,14 @@ end
driver.query_a(conn,"INSERT INTO therm1 VALUES ('2019-09-01 00:00:00.005', 100),('2019-09-01 00:00:00.006', 101),('2019-09-01 00:00:00.007', 102)", async_query_callback) driver.query_a(conn,"INSERT INTO therm1 VALUES ('2019-09-01 00:00:00.005', 100),('2019-09-01 00:00:00.006', 101),('2019-09-01 00:00:00.007', 102)", async_query_callback)
res = driver.query(conn, "create stream stream_avg_degree into avg_degree as select avg(degree) from thermometer interval(5s) sliding(1s)") res = driver.query(conn, "create stream stream_avg_degree into avg_degree as select avg(degree) from thermometer interval(5s) sliding(1s)")
if res.code ~=0 then
print("create stream--- failed:"..res.error)
return
else
print("create stream--- pass")
end
print("From now on we start continous insert in an definite loop, pls wait for about 10 seconds and check stream table for result.") print("From now on we start continous insertion in an definite loop, please wait for about 10 seconds and check stream table avg_degree for result.")
local loop_index = 0 local loop_index = 0
while loop_index < 10 do while loop_index < 10 do
local t = os.time()*1000 local t = os.time()*1000
...@@ -193,5 +199,5 @@ while loop_index < 10 do ...@@ -193,5 +199,5 @@ while loop_index < 10 do
os.execute("sleep " .. 1) os.execute("sleep " .. 1)
loop_index = loop_index + 1 loop_index = loop_index + 1
end end
driver.query(conn,"DROP STREAM IF EXISTS avg_therm_s") driver.query(conn,"DROP STREAM IF EXISTS stream_avg_degree")
driver.close(conn) driver.close(conn)
...@@ -177,6 +177,7 @@ typedef struct SSDataBlock { ...@@ -177,6 +177,7 @@ typedef struct SSDataBlock {
enum { enum {
FETCH_TYPE__DATA = 1, FETCH_TYPE__DATA = 1,
FETCH_TYPE__META, FETCH_TYPE__META,
FETCH_TYPE__SEP,
FETCH_TYPE__NONE, FETCH_TYPE__NONE,
}; };
......
...@@ -98,6 +98,7 @@ extern int32_t tsQueryRsmaTolerance; ...@@ -98,6 +98,7 @@ extern int32_t tsQueryRsmaTolerance;
extern bool tsQueryPlannerTrace; extern bool tsQueryPlannerTrace;
extern int32_t tsQueryNodeChunkSize; extern int32_t tsQueryNodeChunkSize;
extern bool tsQueryUseNodeAllocator; extern bool tsQueryUseNodeAllocator;
extern bool tsKeepColumnName;
// client // client
extern int32_t tsMinSlidingTime; extern int32_t tsMinSlidingTime;
......
...@@ -55,11 +55,10 @@ extern int32_t tMsgDict[]; ...@@ -55,11 +55,10 @@ extern int32_t tMsgDict[];
#define TMSG_SEG_CODE(TYPE) (((TYPE)&0xff00) >> 8) #define TMSG_SEG_CODE(TYPE) (((TYPE)&0xff00) >> 8)
#define TMSG_SEG_SEQ(TYPE) ((TYPE)&0xff) #define TMSG_SEG_SEQ(TYPE) ((TYPE)&0xff)
#define TMSG_INFO(TYPE) \ #define TMSG_INFO(TYPE) \
((TYPE) >= 0 && ((TYPE) < TDMT_DND_MAX_MSG || (TYPE) < TDMT_MND_MAX_MSG || (TYPE) < TDMT_VND_MAX_MSG || \ ((TYPE) < TDMT_DND_MAX_MSG || (TYPE) < TDMT_MND_MAX_MSG || (TYPE) < TDMT_VND_MAX_MSG || (TYPE) < TDMT_SCH_MAX_MSG || \
(TYPE) < TDMT_SCH_MAX_MSG || (TYPE) < TDMT_STREAM_MAX_MSG || (TYPE) < TDMT_MON_MAX_MSG || \ (TYPE) < TDMT_STREAM_MAX_MSG || (TYPE) < TDMT_MON_MAX_MSG || (TYPE) < TDMT_SYNC_MAX_MSG) \
(TYPE) < TDMT_SYNC_MAX_MSG)) \ ? tMsgInfo[tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)] \
? tMsgInfo[tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)] \
: 0 : 0
#define TMSG_INDEX(TYPE) (tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)) #define TMSG_INDEX(TYPE) (tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE))
...@@ -866,7 +865,8 @@ int32_t tSerializeSDbCfgReq(void* buf, int32_t bufLen, SDbCfgReq* pReq); ...@@ -866,7 +865,8 @@ int32_t tSerializeSDbCfgReq(void* buf, int32_t bufLen, SDbCfgReq* pReq);
int32_t tDeserializeSDbCfgReq(void* buf, int32_t bufLen, SDbCfgReq* pReq); int32_t tDeserializeSDbCfgReq(void* buf, int32_t bufLen, SDbCfgReq* pReq);
typedef struct { typedef struct {
char db[TSDB_DB_FNAME_LEN]; char db[TSDB_DB_FNAME_LEN];
int32_t maxSpeed;
} STrimDbReq; } STrimDbReq;
int32_t tSerializeSTrimDbReq(void* buf, int32_t bufLen, STrimDbReq* pReq); int32_t tSerializeSTrimDbReq(void* buf, int32_t bufLen, STrimDbReq* pReq);
...@@ -1426,10 +1426,10 @@ typedef struct { ...@@ -1426,10 +1426,10 @@ typedef struct {
typedef struct { typedef struct {
SExplainRsp rsp; SExplainRsp rsp;
uint64_t qId; uint64_t qId;
uint64_t tId; uint64_t tId;
int64_t rId; int64_t rId;
int32_t eId; int32_t eId;
} SExplainLocalRsp; } SExplainLocalRsp;
typedef struct STableScanAnalyzeInfo { typedef struct STableScanAnalyzeInfo {
...@@ -1446,7 +1446,7 @@ typedef struct STableScanAnalyzeInfo { ...@@ -1446,7 +1446,7 @@ typedef struct STableScanAnalyzeInfo {
int32_t tSerializeSExplainRsp(void* buf, int32_t bufLen, SExplainRsp* pRsp); int32_t tSerializeSExplainRsp(void* buf, int32_t bufLen, SExplainRsp* pRsp);
int32_t tDeserializeSExplainRsp(void* buf, int32_t bufLen, SExplainRsp* pRsp); int32_t tDeserializeSExplainRsp(void* buf, int32_t bufLen, SExplainRsp* pRsp);
void tFreeSExplainRsp(SExplainRsp *pRsp); void tFreeSExplainRsp(SExplainRsp* pRsp);
typedef struct { typedef struct {
char fqdn[TSDB_FQDN_LEN]; // end point, hostname:port char fqdn[TSDB_FQDN_LEN]; // end point, hostname:port
...@@ -1729,6 +1729,8 @@ typedef struct { ...@@ -1729,6 +1729,8 @@ typedef struct {
int64_t maxDelay; int64_t maxDelay;
int64_t watermark; int64_t watermark;
int8_t igExpired; int8_t igExpired;
int32_t numOfTags;
SArray* pTags; // array of SField
} SCMCreateStreamReq; } SCMCreateStreamReq;
typedef struct { typedef struct {
......
...@@ -107,227 +107,231 @@ ...@@ -107,227 +107,231 @@
#define TK_TABLE_PREFIX 89 #define TK_TABLE_PREFIX 89
#define TK_TABLE_SUFFIX 90 #define TK_TABLE_SUFFIX 90
#define TK_NK_COLON 91 #define TK_NK_COLON 91
#define TK_TABLE 92 #define TK_MAX_SPEED 92
#define TK_NK_LP 93 #define TK_TABLE 93
#define TK_NK_RP 94 #define TK_NK_LP 94
#define TK_STABLE 95 #define TK_NK_RP 95
#define TK_ADD 96 #define TK_STABLE 96
#define TK_COLUMN 97 #define TK_ADD 97
#define TK_MODIFY 98 #define TK_COLUMN 98
#define TK_RENAME 99 #define TK_MODIFY 99
#define TK_TAG 100 #define TK_RENAME 100
#define TK_SET 101 #define TK_TAG 101
#define TK_NK_EQ 102 #define TK_SET 102
#define TK_USING 103 #define TK_NK_EQ 103
#define TK_TAGS 104 #define TK_USING 104
#define TK_COMMENT 105 #define TK_TAGS 105
#define TK_BOOL 106 #define TK_COMMENT 106
#define TK_TINYINT 107 #define TK_BOOL 107
#define TK_SMALLINT 108 #define TK_TINYINT 108
#define TK_INT 109 #define TK_SMALLINT 109
#define TK_INTEGER 110 #define TK_INT 110
#define TK_BIGINT 111 #define TK_INTEGER 111
#define TK_FLOAT 112 #define TK_BIGINT 112
#define TK_DOUBLE 113 #define TK_FLOAT 113
#define TK_BINARY 114 #define TK_DOUBLE 114
#define TK_TIMESTAMP 115 #define TK_BINARY 115
#define TK_NCHAR 116 #define TK_TIMESTAMP 116
#define TK_UNSIGNED 117 #define TK_NCHAR 117
#define TK_JSON 118 #define TK_UNSIGNED 118
#define TK_VARCHAR 119 #define TK_JSON 119
#define TK_MEDIUMBLOB 120 #define TK_VARCHAR 120
#define TK_BLOB 121 #define TK_MEDIUMBLOB 121
#define TK_VARBINARY 122 #define TK_BLOB 122
#define TK_DECIMAL 123 #define TK_VARBINARY 123
#define TK_MAX_DELAY 124 #define TK_DECIMAL 124
#define TK_WATERMARK 125 #define TK_MAX_DELAY 125
#define TK_ROLLUP 126 #define TK_WATERMARK 126
#define TK_TTL 127 #define TK_ROLLUP 127
#define TK_SMA 128 #define TK_TTL 128
#define TK_FIRST 129 #define TK_SMA 129
#define TK_LAST 130 #define TK_FIRST 130
#define TK_SHOW 131 #define TK_LAST 131
#define TK_DATABASES 132 #define TK_SHOW 132
#define TK_TABLES 133 #define TK_DATABASES 133
#define TK_STABLES 134 #define TK_TABLES 134
#define TK_MNODES 135 #define TK_STABLES 135
#define TK_MODULES 136 #define TK_MNODES 136
#define TK_QNODES 137 #define TK_MODULES 137
#define TK_FUNCTIONS 138 #define TK_QNODES 138
#define TK_INDEXES 139 #define TK_FUNCTIONS 139
#define TK_ACCOUNTS 140 #define TK_INDEXES 140
#define TK_APPS 141 #define TK_ACCOUNTS 141
#define TK_CONNECTIONS 142 #define TK_APPS 142
#define TK_LICENCES 143 #define TK_CONNECTIONS 143
#define TK_GRANTS 144 #define TK_LICENCES 144
#define TK_QUERIES 145 #define TK_GRANTS 145
#define TK_SCORES 146 #define TK_QUERIES 146
#define TK_TOPICS 147 #define TK_SCORES 147
#define TK_VARIABLES 148 #define TK_TOPICS 148
#define TK_BNODES 149 #define TK_VARIABLES 149
#define TK_SNODES 150 #define TK_BNODES 150
#define TK_CLUSTER 151 #define TK_SNODES 151
#define TK_TRANSACTIONS 152 #define TK_CLUSTER 152
#define TK_DISTRIBUTED 153 #define TK_TRANSACTIONS 153
#define TK_CONSUMERS 154 #define TK_DISTRIBUTED 154
#define TK_SUBSCRIPTIONS 155 #define TK_CONSUMERS 155
#define TK_VNODES 156 #define TK_SUBSCRIPTIONS 156
#define TK_LIKE 157 #define TK_VNODES 157
#define TK_INDEX 158 #define TK_LIKE 158
#define TK_FUNCTION 159 #define TK_INDEX 159
#define TK_INTERVAL 160 #define TK_FUNCTION 160
#define TK_TOPIC 161 #define TK_INTERVAL 161
#define TK_AS 162 #define TK_TOPIC 162
#define TK_WITH 163 #define TK_AS 163
#define TK_META 164 #define TK_WITH 164
#define TK_CONSUMER 165 #define TK_META 165
#define TK_GROUP 166 #define TK_CONSUMER 166
#define TK_DESC 167 #define TK_GROUP 167
#define TK_DESCRIBE 168 #define TK_DESC 168
#define TK_RESET 169 #define TK_DESCRIBE 169
#define TK_QUERY 170 #define TK_RESET 170
#define TK_CACHE 171 #define TK_QUERY 171
#define TK_EXPLAIN 172 #define TK_CACHE 172
#define TK_ANALYZE 173 #define TK_EXPLAIN 173
#define TK_VERBOSE 174 #define TK_ANALYZE 174
#define TK_NK_BOOL 175 #define TK_VERBOSE 175
#define TK_RATIO 176 #define TK_NK_BOOL 176
#define TK_NK_FLOAT 177 #define TK_RATIO 177
#define TK_OUTPUTTYPE 178 #define TK_NK_FLOAT 178
#define TK_AGGREGATE 179 #define TK_OUTPUTTYPE 179
#define TK_BUFSIZE 180 #define TK_AGGREGATE 180
#define TK_STREAM 181 #define TK_BUFSIZE 181
#define TK_INTO 182 #define TK_STREAM 182
#define TK_TRIGGER 183 #define TK_INTO 183
#define TK_AT_ONCE 184 #define TK_TRIGGER 184
#define TK_WINDOW_CLOSE 185 #define TK_AT_ONCE 185
#define TK_IGNORE 186 #define TK_WINDOW_CLOSE 186
#define TK_EXPIRED 187 #define TK_IGNORE 187
#define TK_KILL 188 #define TK_EXPIRED 188
#define TK_CONNECTION 189 #define TK_SUBTABLE 189
#define TK_TRANSACTION 190 #define TK_KILL 190
#define TK_BALANCE 191 #define TK_CONNECTION 191
#define TK_VGROUP 192 #define TK_TRANSACTION 192
#define TK_MERGE 193 #define TK_BALANCE 193
#define TK_REDISTRIBUTE 194 #define TK_VGROUP 194
#define TK_SPLIT 195 #define TK_MERGE 195
#define TK_DELETE 196 #define TK_REDISTRIBUTE 196
#define TK_INSERT 197 #define TK_SPLIT 197
#define TK_NULL 198 #define TK_DELETE 198
#define TK_NK_QUESTION 199 #define TK_INSERT 199
#define TK_NK_ARROW 200 #define TK_NULL 200
#define TK_ROWTS 201 #define TK_NK_QUESTION 201
#define TK_TBNAME 202 #define TK_NK_ARROW 202
#define TK_QSTART 203 #define TK_ROWTS 203
#define TK_QEND 204 #define TK_TBNAME 204
#define TK_QDURATION 205 #define TK_QSTART 205
#define TK_WSTART 206 #define TK_QEND 206
#define TK_WEND 207 #define TK_QDURATION 207
#define TK_WDURATION 208 #define TK_WSTART 208
#define TK_CAST 209 #define TK_WEND 209
#define TK_NOW 210 #define TK_WDURATION 210
#define TK_TODAY 211 #define TK_IROWTS 211
#define TK_TIMEZONE 212 #define TK_QTAGS 212
#define TK_CLIENT_VERSION 213 #define TK_CAST 213
#define TK_SERVER_VERSION 214 #define TK_NOW 214
#define TK_SERVER_STATUS 215 #define TK_TODAY 215
#define TK_CURRENT_USER 216 #define TK_TIMEZONE 216
#define TK_COUNT 217 #define TK_CLIENT_VERSION 217
#define TK_LAST_ROW 218 #define TK_SERVER_VERSION 218
#define TK_CASE 219 #define TK_SERVER_STATUS 219
#define TK_END 220 #define TK_CURRENT_USER 220
#define TK_WHEN 221 #define TK_COUNT 221
#define TK_THEN 222 #define TK_LAST_ROW 222
#define TK_ELSE 223 #define TK_CASE 223
#define TK_BETWEEN 224 #define TK_END 224
#define TK_IS 225 #define TK_WHEN 225
#define TK_NK_LT 226 #define TK_THEN 226
#define TK_NK_GT 227 #define TK_ELSE 227
#define TK_NK_LE 228 #define TK_BETWEEN 228
#define TK_NK_GE 229 #define TK_IS 229
#define TK_NK_NE 230 #define TK_NK_LT 230
#define TK_MATCH 231 #define TK_NK_GT 231
#define TK_NMATCH 232 #define TK_NK_LE 232
#define TK_CONTAINS 233 #define TK_NK_GE 233
#define TK_IN 234 #define TK_NK_NE 234
#define TK_JOIN 235 #define TK_MATCH 235
#define TK_INNER 236 #define TK_NMATCH 236
#define TK_SELECT 237 #define TK_CONTAINS 237
#define TK_DISTINCT 238 #define TK_IN 238
#define TK_WHERE 239 #define TK_JOIN 239
#define TK_PARTITION 240 #define TK_INNER 240
#define TK_BY 241 #define TK_SELECT 241
#define TK_SESSION 242 #define TK_DISTINCT 242
#define TK_STATE_WINDOW 243 #define TK_WHERE 243
#define TK_SLIDING 244 #define TK_PARTITION 244
#define TK_FILL 245 #define TK_BY 245
#define TK_VALUE 246 #define TK_SESSION 246
#define TK_NONE 247 #define TK_STATE_WINDOW 247
#define TK_PREV 248 #define TK_SLIDING 248
#define TK_LINEAR 249 #define TK_FILL 249
#define TK_NEXT 250 #define TK_VALUE 250
#define TK_HAVING 251 #define TK_NONE 251
#define TK_RANGE 252 #define TK_PREV 252
#define TK_EVERY 253 #define TK_LINEAR 253
#define TK_ORDER 254 #define TK_NEXT 254
#define TK_SLIMIT 255 #define TK_HAVING 255
#define TK_SOFFSET 256 #define TK_RANGE 256
#define TK_LIMIT 257 #define TK_EVERY 257
#define TK_OFFSET 258 #define TK_ORDER 258
#define TK_ASC 259 #define TK_SLIMIT 259
#define TK_NULLS 260 #define TK_SOFFSET 260
#define TK_ABORT 261 #define TK_LIMIT 261
#define TK_AFTER 262 #define TK_OFFSET 262
#define TK_ATTACH 263 #define TK_ASC 263
#define TK_BEFORE 264 #define TK_NULLS 264
#define TK_BEGIN 265 #define TK_ABORT 265
#define TK_BITAND 266 #define TK_AFTER 266
#define TK_BITNOT 267 #define TK_ATTACH 267
#define TK_BITOR 268 #define TK_BEFORE 268
#define TK_BLOCKS 269 #define TK_BEGIN 269
#define TK_CHANGE 270 #define TK_BITAND 270
#define TK_COMMA 271 #define TK_BITNOT 271
#define TK_COMPACT 272 #define TK_BITOR 272
#define TK_CONCAT 273 #define TK_BLOCKS 273
#define TK_CONFLICT 274 #define TK_CHANGE 274
#define TK_COPY 275 #define TK_COMMA 275
#define TK_DEFERRED 276 #define TK_COMPACT 276
#define TK_DELIMITERS 277 #define TK_CONCAT 277
#define TK_DETACH 278 #define TK_CONFLICT 278
#define TK_DIVIDE 279 #define TK_COPY 279
#define TK_DOT 280 #define TK_DEFERRED 280
#define TK_EACH 281 #define TK_DELIMITERS 281
#define TK_FAIL 282 #define TK_DETACH 282
#define TK_FILE 283 #define TK_DIVIDE 283
#define TK_FOR 284 #define TK_DOT 284
#define TK_GLOB 285 #define TK_EACH 285
#define TK_ID 286 #define TK_FAIL 286
#define TK_IMMEDIATE 287 #define TK_FILE 287
#define TK_IMPORT 288 #define TK_FOR 288
#define TK_INITIALLY 289 #define TK_GLOB 289
#define TK_INSTEAD 290 #define TK_ID 290
#define TK_ISNULL 291 #define TK_IMMEDIATE 291
#define TK_KEY 292 #define TK_IMPORT 292
#define TK_NK_BITNOT 293 #define TK_INITIALLY 293
#define TK_NK_SEMI 294 #define TK_INSTEAD 294
#define TK_NOTNULL 295 #define TK_ISNULL 295
#define TK_OF 296 #define TK_KEY 296
#define TK_PLUS 297 #define TK_NK_BITNOT 297
#define TK_PRIVILEGE 298 #define TK_NK_SEMI 298
#define TK_RAISE 299 #define TK_NOTNULL 299
#define TK_REPLACE 300 #define TK_OF 300
#define TK_RESTRICT 301 #define TK_PLUS 301
#define TK_ROW 302 #define TK_PRIVILEGE 302
#define TK_SEMI 303 #define TK_RAISE 303
#define TK_STAR 304 #define TK_REPLACE 304
#define TK_STATEMENT 305 #define TK_RESTRICT 305
#define TK_STRING 306 #define TK_ROW 306
#define TK_TIMES 307 #define TK_SEMI 307
#define TK_UPDATE 308 #define TK_STAR 308
#define TK_VALUES 309 #define TK_STATEMENT 309
#define TK_VARIABLE 310 #define TK_STRING 310
#define TK_VIEW 311 #define TK_TIMES 311
#define TK_WAL 312 #define TK_UPDATE 312
#define TK_VALUES 313
#define TK_VARIABLE 314
#define TK_VIEW 315
#define TK_WAL 316
#define TK_NK_SPACE 300 #define TK_NK_SPACE 300
#define TK_NK_COMMENT 301 #define TK_NK_COMMENT 301
......
...@@ -106,6 +106,8 @@ void mndPostProcessQueryMsg(SRpcMsg *pMsg); ...@@ -106,6 +106,8 @@ void mndPostProcessQueryMsg(SRpcMsg *pMsg);
*/ */
void mndGenerateMachineCode(); void mndGenerateMachineCode();
void mndDumpSdb();
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
...@@ -29,13 +29,13 @@ typedef void* DataSinkHandle; ...@@ -29,13 +29,13 @@ typedef void* DataSinkHandle;
struct SRpcMsg; struct SRpcMsg;
struct SSubplan; struct SSubplan;
typedef int32_t (*localFetchFp)(void *, uint64_t, uint64_t, uint64_t, int64_t, int32_t, void**, SArray*); typedef int32_t (*localFetchFp)(void*, uint64_t, uint64_t, uint64_t, int64_t, int32_t, void**, SArray*);
typedef struct { typedef struct {
void *handle; void* handle;
bool localExec; bool localExec;
localFetchFp fp; localFetchFp fp;
SArray *explainRes; SArray* explainRes;
} SLocalFetch; } SLocalFetch;
typedef struct { typedef struct {
...@@ -51,9 +51,9 @@ typedef struct { ...@@ -51,9 +51,9 @@ typedef struct {
bool initTqReader; bool initTqReader;
int32_t numOfVgroups; int32_t numOfVgroups;
void* sContext; // SSnapContext* void* sContext; // SSnapContext*
void* pStateBackend; void* pStateBackend;
} SReadHandle; } SReadHandle;
// in queue mode, data streams are seperated by msg // in queue mode, data streams are seperated by msg
...@@ -136,7 +136,8 @@ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* table ...@@ -136,7 +136,8 @@ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, char* table
* @param handle * @param handle
* @return * @return
*/ */
int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, SLocalFetch *pLocal);
int32_t qExecTaskOpt(qTaskInfo_t tinfo, SArray* pResList, uint64_t* useconds, bool* hasMore, SLocalFetch *pLocal);
int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pBlock, uint64_t* useconds); int32_t qExecTask(qTaskInfo_t tinfo, SSDataBlock** pBlock, uint64_t* useconds);
/** /**
...@@ -195,6 +196,8 @@ int32_t qStreamPrepareTsdbScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts); ...@@ -195,6 +196,8 @@ int32_t qStreamPrepareTsdbScan(qTaskInfo_t tinfo, uint64_t uid, int64_t ts);
int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subType); int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subType);
int32_t qStreamScanMemData(qTaskInfo_t tinfo, const SSubmitReq* pReq);
int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset); int32_t qStreamExtractOffset(qTaskInfo_t tinfo, STqOffsetVal* pOffset);
SMqMetaRsp* qStreamExtractMetaMsg(qTaskInfo_t tinfo); SMqMetaRsp* qStreamExtractMetaMsg(qTaskInfo_t tinfo);
......
...@@ -119,9 +119,11 @@ typedef enum EFunctionType { ...@@ -119,9 +119,11 @@ typedef enum EFunctionType {
FUNCTION_TYPE_WSTART, FUNCTION_TYPE_WSTART,
FUNCTION_TYPE_WEND, FUNCTION_TYPE_WEND,
FUNCTION_TYPE_WDURATION, FUNCTION_TYPE_WDURATION,
FUNCTION_TYPE_IROWTS,
FUNCTION_TYPE_TAGS,
// internal function // internal function
FUNCTION_TYPE_SELECT_VALUE, FUNCTION_TYPE_SELECT_VALUE = 3750,
FUNCTION_TYPE_BLOCK_DIST, // block distribution aggregate function FUNCTION_TYPE_BLOCK_DIST, // block distribution aggregate function
FUNCTION_TYPE_BLOCK_DIST_INFO, // block distribution pseudo column function FUNCTION_TYPE_BLOCK_DIST_INFO, // block distribution pseudo column function
FUNCTION_TYPE_TO_COLUMN, FUNCTION_TYPE_TO_COLUMN,
...@@ -212,6 +214,7 @@ bool fmIsClientPseudoColumnFunc(int32_t funcId); ...@@ -212,6 +214,7 @@ bool fmIsClientPseudoColumnFunc(int32_t funcId);
bool fmIsMultiRowsFunc(int32_t funcId); bool fmIsMultiRowsFunc(int32_t funcId);
bool fmIsKeepOrderFunc(int32_t funcId); bool fmIsKeepOrderFunc(int32_t funcId);
bool fmIsCumulativeFunc(int32_t funcId); bool fmIsCumulativeFunc(int32_t funcId);
bool fmIsInterpPseudoColumnFunc(int32_t funcId);
int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc); int32_t fmGetDistMethod(const SFunctionNode* pFunc, SFunctionNode** pPartialFunc, SFunctionNode** pMergeFunc);
......
...@@ -206,12 +206,6 @@ void indexJsonRebuild(SIndexJson* idx, void* iter); ...@@ -206,12 +206,6 @@ void indexJsonRebuild(SIndexJson* idx, void* iter);
**/ **/
bool indexJsonIsRebuild(SIndexJson* idx); bool indexJsonIsRebuild(SIndexJson* idx);
/*
* init index env
*
*/
void indexInit();
/* index filter */ /* index filter */
typedef struct SIndexMetaArg { typedef struct SIndexMetaArg {
void* metaEx; void* metaEx;
...@@ -225,6 +219,12 @@ typedef enum { SFLT_NOT_INDEX, SFLT_COARSE_INDEX, SFLT_ACCURATE_INDEX } SIdxFltS ...@@ -225,6 +219,12 @@ typedef enum { SFLT_NOT_INDEX, SFLT_COARSE_INDEX, SFLT_ACCURATE_INDEX } SIdxFltS
SIdxFltStatus idxGetFltStatus(SNode* pFilterNode); SIdxFltStatus idxGetFltStatus(SNode* pFilterNode);
int32_t doFilterTag(SNode* pFilterNode, SIndexMetaArg* metaArg, SArray* result, SIdxFltStatus* status); int32_t doFilterTag(SNode* pFilterNode, SIndexMetaArg* metaArg, SArray* result, SIdxFltStatus* status);
/*
* init index env
*
*/
void indexInit(int32_t threads);
/* /*
* destory index env * destory index env
* *
......
...@@ -119,6 +119,7 @@ typedef struct SFlushDatabaseStmt { ...@@ -119,6 +119,7 @@ typedef struct SFlushDatabaseStmt {
typedef struct STrimDatabaseStmt { typedef struct STrimDatabaseStmt {
ENodeType type; ENodeType type;
char dbName[TSDB_DB_NAME_LEN]; char dbName[TSDB_DB_NAME_LEN];
int32_t maxSpeed;
} STrimDatabaseStmt; } STrimDatabaseStmt;
typedef struct STableOptions { typedef struct STableOptions {
...@@ -383,6 +384,8 @@ typedef struct SCreateStreamStmt { ...@@ -383,6 +384,8 @@ typedef struct SCreateStreamStmt {
bool ignoreExists; bool ignoreExists;
SStreamOptions* pOptions; SStreamOptions* pOptions;
SNode* pQuery; SNode* pQuery;
SNodeList* pTags;
SNode* pSubtable;
} SCreateStreamStmt; } SCreateStreamStmt;
typedef struct SDropStreamStmt { typedef struct SDropStreamStmt {
......
...@@ -27,9 +27,10 @@ extern "C" { ...@@ -27,9 +27,10 @@ extern "C" {
#define LIST_LENGTH(l) (NULL != (l) ? (l)->length : 0) #define LIST_LENGTH(l) (NULL != (l) ? (l)->length : 0)
#define FOREACH(node, list) \ #define FOREACH(node, list) \
for (SListCell* cell = (NULL != (list) ? (list)->pHead : NULL); \ for (SListCell* cell = (NULL != (list) ? (list)->pHead : NULL), *pNext; \
(NULL != cell ? (node = cell->pNode, true) : (node = NULL, false)); cell = cell->pNext) (NULL != cell ? (node = cell->pNode, pNext = cell->pNext, true) : (node = NULL, pNext = NULL, false)); \
cell = pNext)
#define REPLACE_NODE(newNode) cell->pNode = (SNode*)(newNode) #define REPLACE_NODE(newNode) cell->pNode = (SNode*)(newNode)
...@@ -192,6 +193,7 @@ typedef enum ENodeType { ...@@ -192,6 +193,7 @@ typedef enum ENodeType {
QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT, QUERY_NODE_SHOW_TABLE_DISTRIBUTED_STMT,
QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT,
QUERY_NODE_SHOW_SCORES_STMT, QUERY_NODE_SHOW_SCORES_STMT,
QUERY_NODE_SHOW_TABLE_TAGS_STMT,
QUERY_NODE_KILL_CONNECTION_STMT, QUERY_NODE_KILL_CONNECTION_STMT,
QUERY_NODE_KILL_QUERY_STMT, QUERY_NODE_KILL_QUERY_STMT,
QUERY_NODE_KILL_TRANSACTION_STMT, QUERY_NODE_KILL_TRANSACTION_STMT,
...@@ -239,6 +241,7 @@ typedef enum ENodeType { ...@@ -239,6 +241,7 @@ typedef enum ENodeType {
QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL, QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL, QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL,
QUERY_NODE_PHYSICAL_PLAN_FILL, QUERY_NODE_PHYSICAL_PLAN_FILL,
QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL,
QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION, QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION, QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_SESSION, QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_SESSION,
......
...@@ -94,6 +94,8 @@ typedef struct SScanLogicNode { ...@@ -94,6 +94,8 @@ typedef struct SScanLogicNode {
SArray* pSmaIndexes; SArray* pSmaIndexes;
SNodeList* pGroupTags; SNodeList* pGroupTags;
bool groupSort; bool groupSort;
SNodeList* pTags; // for create stream
SNode* pSubtable; // for create stream
int8_t cacheLastMode; int8_t cacheLastMode;
bool hasNormalCols; // neither tag column nor primary key tag column bool hasNormalCols; // neither tag column nor primary key tag column
bool sortPrimaryKey; bool sortPrimaryKey;
...@@ -233,6 +235,8 @@ typedef struct SSortLogicNode { ...@@ -233,6 +235,8 @@ typedef struct SSortLogicNode {
typedef struct SPartitionLogicNode { typedef struct SPartitionLogicNode {
SLogicNode node; SLogicNode node;
SNodeList* pPartitionKeys; SNodeList* pPartitionKeys;
SNodeList* pTags;
SNode* pSubtable;
} SPartitionLogicNode; } SPartitionLogicNode;
typedef enum ESubplanType { typedef enum ESubplanType {
...@@ -332,6 +336,8 @@ typedef struct STableScanPhysiNode { ...@@ -332,6 +336,8 @@ typedef struct STableScanPhysiNode {
SNodeList* pDynamicScanFuncs; SNodeList* pDynamicScanFuncs;
SNodeList* pGroupTags; SNodeList* pGroupTags;
bool groupSort; bool groupSort;
SNodeList* pTags;
SNode* pSubtable;
int64_t interval; int64_t interval;
int64_t offset; int64_t offset;
int64_t sliding; int64_t sliding;
...@@ -458,6 +464,8 @@ typedef struct SFillPhysiNode { ...@@ -458,6 +464,8 @@ typedef struct SFillPhysiNode {
EOrder inputTsOrder; EOrder inputTsOrder;
} SFillPhysiNode; } SFillPhysiNode;
typedef SFillPhysiNode SStreamFillPhysiNode;
typedef struct SMultiTableIntervalPhysiNode { typedef struct SMultiTableIntervalPhysiNode {
SIntervalPhysiNode interval; SIntervalPhysiNode interval;
SNodeList* pPartitionKeys; SNodeList* pPartitionKeys;
...@@ -495,7 +503,11 @@ typedef struct SPartitionPhysiNode { ...@@ -495,7 +503,11 @@ typedef struct SPartitionPhysiNode {
SNodeList* pTargets; SNodeList* pTargets;
} SPartitionPhysiNode; } SPartitionPhysiNode;
typedef SPartitionPhysiNode SStreamPartitionPhysiNode; typedef struct SStreamPartitionPhysiNode {
SPartitionPhysiNode part;
SNodeList* pTags;
SNode* pSubtable;
} SStreamPartitionPhysiNode;
typedef struct SDataSinkNode { typedef struct SDataSinkNode {
ENodeType type; ENodeType type;
......
...@@ -261,6 +261,8 @@ typedef struct SSelectStmt { ...@@ -261,6 +261,8 @@ typedef struct SSelectStmt {
SNode* pFromTable; SNode* pFromTable;
SNode* pWhere; SNode* pWhere;
SNodeList* pPartitionByList; SNodeList* pPartitionByList;
SNodeList* pTags; // for create stream
SNode* pSubtable; // for create stream
SNode* pWindow; SNode* pWindow;
SNodeList* pGroupByList; // SGroupingSetNode SNodeList* pGroupByList; // SGroupingSetNode
SNode* pHaving; SNode* pHaving;
......
...@@ -31,7 +31,9 @@ typedef struct { ...@@ -31,7 +31,9 @@ typedef struct {
TDB* db; TDB* db;
TTB* pStateDb; TTB* pStateDb;
TTB* pFuncStateDb; TTB* pFuncStateDb;
TTB* pFillStateDb; // todo refactor
TXN txn; TXN txn;
int32_t number;
} SStreamState; } SStreamState;
SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath); SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath);
...@@ -41,7 +43,8 @@ int32_t streamStateCommit(SStreamState* pState); ...@@ -41,7 +43,8 @@ int32_t streamStateCommit(SStreamState* pState);
int32_t streamStateAbort(SStreamState* pState); int32_t streamStateAbort(SStreamState* pState);
typedef struct { typedef struct {
TBC* pCur; TBC* pCur;
int64_t number;
} SStreamStateCur; } SStreamStateCur;
int32_t streamStateFuncPut(SStreamState* pState, const STupleKey* key, const void* value, int32_t vLen); int32_t streamStateFuncPut(SStreamState* pState, const STupleKey* key, const void* value, int32_t vLen);
...@@ -51,17 +54,28 @@ int32_t streamStateFuncDel(SStreamState* pState, const STupleKey* key); ...@@ -51,17 +54,28 @@ int32_t streamStateFuncDel(SStreamState* pState, const STupleKey* key);
int32_t streamStatePut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen); int32_t streamStatePut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen);
int32_t streamStateGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); int32_t streamStateGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen);
int32_t streamStateDel(SStreamState* pState, const SWinKey* key); int32_t streamStateDel(SStreamState* pState, const SWinKey* key);
int32_t streamStateClear(SStreamState* pState);
void streamStateSetNumber(SStreamState* pState, int32_t number);
int32_t streamStateFillPut(SStreamState* pState, const SWinKey* key, const void* value, int32_t vLen);
int32_t streamStateFillGet(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen);
int32_t streamStateFillDel(SStreamState* pState, const SWinKey* key);
int32_t streamStateAddIfNotExist(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen); int32_t streamStateAddIfNotExist(SStreamState* pState, const SWinKey* key, void** pVal, int32_t* pVLen);
int32_t streamStateReleaseBuf(SStreamState* pState, const SWinKey* key, void* pVal); int32_t streamStateReleaseBuf(SStreamState* pState, const SWinKey* key, void* pVal);
void streamFreeVal(void* val); void streamFreeVal(void* val);
SStreamStateCur* streamStateGetCur(SStreamState* pState, const SWinKey* key); SStreamStateCur* streamStateGetCur(SStreamState* pState, const SWinKey* key);
SStreamStateCur* streamStateGetAndCheckCur(SStreamState* pState, SWinKey* key);
SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key); SStreamStateCur* streamStateSeekKeyNext(SStreamState* pState, const SWinKey* key);
SStreamStateCur* streamStateSeekKeyPrev(SStreamState* pState, const SWinKey* key); SStreamStateCur* streamStateFillSeekKeyNext(SStreamState* pState, const SWinKey* key);
SStreamStateCur* streamStateFillSeekKeyPrev(SStreamState* pState, const SWinKey* key);
void streamStateFreeCur(SStreamStateCur* pCur); void streamStateFreeCur(SStreamStateCur* pCur);
int32_t streamStateGetGroupKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen);
int32_t streamStateGetKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen); int32_t streamStateGetKVByCur(SStreamStateCur* pCur, SWinKey* pKey, const void** pVal, int32_t* pVLen);
int32_t streamStateGetFirst(SStreamState* pState, SWinKey* key);
int32_t streamStateSeekFirst(SStreamState* pState, SStreamStateCur* pCur); int32_t streamStateSeekFirst(SStreamState* pState, SStreamStateCur* pCur);
int32_t streamStateSeekLast(SStreamState* pState, SStreamStateCur* pCur); int32_t streamStateSeekLast(SStreamState* pState, SStreamStateCur* pCur);
......
...@@ -132,7 +132,7 @@ typedef struct SSyncFSM { ...@@ -132,7 +132,7 @@ typedef struct SSyncFSM {
void (*FpRollBackCb)(struct SSyncFSM* pFsm, const SRpcMsg* pMsg, SFsmCbMeta cbMeta); void (*FpRollBackCb)(struct SSyncFSM* pFsm, const SRpcMsg* pMsg, SFsmCbMeta cbMeta);
void (*FpRestoreFinishCb)(struct SSyncFSM* pFsm); void (*FpRestoreFinishCb)(struct SSyncFSM* pFsm);
void (*FpReConfigCb)(struct SSyncFSM* pFsm, const SRpcMsg* pMsg, SReConfigCbMeta cbMeta); void (*FpReConfigCb)(struct SSyncFSM* pFsm, const SRpcMsg* pMsg, SReConfigCbMeta *cbMeta);
void (*FpLeaderTransferCb)(struct SSyncFSM* pFsm, const SRpcMsg* pMsg, SFsmCbMeta cbMeta); void (*FpLeaderTransferCb)(struct SSyncFSM* pFsm, const SRpcMsg* pMsg, SFsmCbMeta cbMeta);
void (*FpBecomeLeaderCb)(struct SSyncFSM* pFsm); void (*FpBecomeLeaderCb)(struct SSyncFSM* pFsm);
......
...@@ -167,7 +167,7 @@ uint32_t ip2uint(const char *const ip_addr); ...@@ -167,7 +167,7 @@ uint32_t ip2uint(const char *const ip_addr);
void taosIgnSIGPIPE(); void taosIgnSIGPIPE();
void taosSetMaskSIGPIPE(); void taosSetMaskSIGPIPE();
uint32_t taosInetAddr(const char *ipAddr); uint32_t taosInetAddr(const char *ipAddr);
const char *taosInetNtoa(struct in_addr ipInt); const char *taosInetNtoa(struct in_addr ipInt, char *dstStr, int32_t len);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -77,7 +77,6 @@ int32_t taosWcharsWidth(TdWchar *pWchar, int32_t size); ...@@ -77,7 +77,6 @@ int32_t taosWcharsWidth(TdWchar *pWchar, int32_t size);
int32_t taosMbToWchar(TdWchar *pWchar, const char *pStr, int32_t size); int32_t taosMbToWchar(TdWchar *pWchar, const char *pStr, int32_t size);
int32_t taosMbsToWchars(TdWchar *pWchars, const char *pStrs, int32_t size); int32_t taosMbsToWchars(TdWchar *pWchars, const char *pStrs, int32_t size);
int32_t taosWcharToMb(char *pStr, TdWchar wchar); int32_t taosWcharToMb(char *pStr, TdWchar wchar);
int32_t taosWcharsToMbs(char *pStrs, TdWchar *pWchars, int32_t size);
char *taosStrCaseStr(const char *str, const char *pattern); char *taosStrCaseStr(const char *str, const char *pattern);
......
...@@ -565,6 +565,7 @@ int32_t* taosGetErrno(); ...@@ -565,6 +565,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_PAR_GET_META_ERROR TAOS_DEF_ERROR_CODE(0, 0x2662) #define TSDB_CODE_PAR_GET_META_ERROR TAOS_DEF_ERROR_CODE(0, 0x2662)
#define TSDB_CODE_PAR_NOT_UNIQUE_TABLE_ALIAS TAOS_DEF_ERROR_CODE(0, 0x2663) #define TSDB_CODE_PAR_NOT_UNIQUE_TABLE_ALIAS TAOS_DEF_ERROR_CODE(0, 0x2663)
#define TSDB_CODE_PAR_NOT_SUPPORT_JOIN TAOS_DEF_ERROR_CODE(0, 0x2664) #define TSDB_CODE_PAR_NOT_SUPPORT_JOIN TAOS_DEF_ERROR_CODE(0, 0x2664)
#define TSDB_CODE_PAR_INVALID_TAGS_PC TAOS_DEF_ERROR_CODE(0, 0x2665)
#define TSDB_CODE_PAR_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x26FF) #define TSDB_CODE_PAR_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x26FF)
//planner //planner
......
[Unit]
Description=Nginx For TDengine Service
After=network-online.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/usr/local/nginxd/logs/nginx.pid
ExecStart=/usr/local/nginxd/sbin/nginx
ExecStop=/usr/local/nginxd/sbin/nginx -s stop
TimeoutStopSec=1000000s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
StandardOutput=null
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
...@@ -38,8 +38,6 @@ temp_version="" ...@@ -38,8 +38,6 @@ temp_version=""
fin_result="" fin_result=""
service_config_dir="/etc/systemd/system" service_config_dir="/etc/systemd/system"
nginx_port=6060
nginx_dir="/usr/local/nginxd"
# Color setting # Color setting
RED='\033[0;31m' RED='\033[0;31m'
...@@ -132,10 +130,7 @@ function check_main_path() { ...@@ -132,10 +130,7 @@ function check_main_path() {
check_file ${install_main_dir} $i check_file ${install_main_dir} $i
done done
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
nginx_main_dir=("admin" "conf" "html" "sbin" "logs") check_file ${install_main_dir} "share/admin"
for i in "${nginx_main_dir[@]}";do
check_file ${nginx_dir} $i
done
fi fi
echo -e "Check main path:\033[32mOK\033[0m!" echo -e "Check main path:\033[32mOK\033[0m!"
} }
...@@ -150,9 +145,6 @@ function check_bin_path() { ...@@ -150,9 +145,6 @@ function check_bin_path() {
for i in "${lbin_dir[@]}";do for i in "${lbin_dir[@]}";do
check_link ${bin_link_dir}/$i check_link ${bin_link_dir}/$i
done done
if [ "$verMode" == "cluster" ]; then
check_file ${nginx_dir}/sbin nginx
fi
echo -e "Check bin path:\033[32mOK\033[0m!" echo -e "Check bin path:\033[32mOK\033[0m!"
} }
......
...@@ -219,12 +219,12 @@ fi ...@@ -219,12 +219,12 @@ fi
if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "arm64" ]] || [[ "$cpuType" == "arm32" ]] || [[ "$cpuType" == "mips64" ]]; then if [[ "$cpuType" == "x64" ]] || [[ "$cpuType" == "aarch64" ]] || [[ "$cpuType" == "aarch32" ]] || [[ "$cpuType" == "arm64" ]] || [[ "$cpuType" == "arm32" ]] || [[ "$cpuType" == "mips64" ]]; then
if [ "$verMode" != "cluster" ]; then if [ "$verMode" != "cluster" ]; then
# community-version compile # community-version compile
cmake ../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} cmake ../ -DCPUTYPE=${cpuType} -DWEBSOCKET=true -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DPAGMODE=${pagMode} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro}
else else
if [[ "$dbName" != "taos" ]]; then if [[ "$dbName" != "taos" ]]; then
replace_enterprise_$dbName replace_enterprise_$dbName
fi fi
cmake ../../ -DCPUTYPE=${cpuType} -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro} cmake ../../ -DCPUTYPE=${cpuType} -DWEBSOCKET=true -DOSTYPE=${osType} -DSOMODE=${soMode} -DDBNAME=${dbName} -DVERTYPE=${verType} -DVERDATE="${build_time}" -DGITINFO=${gitinfo} -DGITINFOI=${gitinfoOfInternal} -DVERNUMBER=${verNumber} -DVERCOMPATIBLE=${verNumberComp} -DBUILD_HTTP=${BUILD_HTTP} -DBUILD_TOOLS=${BUILD_TOOLS} ${allocator_macro}
fi fi
else else
echo "input cpuType=${cpuType} error!!!" echo "input cpuType=${cpuType} error!!!"
......
...@@ -50,8 +50,7 @@ install_main_dir=${installDir} ...@@ -50,8 +50,7 @@ install_main_dir=${installDir}
bin_dir="${installDir}/bin" bin_dir="${installDir}/bin"
service_config_dir="/etc/systemd/system" service_config_dir="/etc/systemd/system"
nginx_port=6060 web_port=6041
nginx_dir="/usr/local/nginxd"
# Color setting # Color setting
RED='\033[0;31m' RED='\033[0;31m'
...@@ -182,7 +181,7 @@ function install_main_path() { ...@@ -182,7 +181,7 @@ function install_main_path() {
${csudo}mkdir -p ${install_main_dir}/include ${csudo}mkdir -p ${install_main_dir}/include
# ${csudo}mkdir -p ${install_main_dir}/init.d # ${csudo}mkdir -p ${install_main_dir}/init.d
if [ "$verMode" == "cluster" ]; then if [ "$verMode" == "cluster" ]; then
${csudo}mkdir -p ${nginx_dir} ${csudo}mkdir -p ${install_main_dir}/share
fi fi
if [[ -e ${script_dir}/email ]]; then if [[ -e ${script_dir}/email ]]; then
...@@ -218,12 +217,6 @@ function install_bin() { ...@@ -218,12 +217,6 @@ function install_bin() {
[ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -s ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || : [ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -s ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || :
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || : [ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || :
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || : [ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
if [ "$verMode" == "cluster" ]; then
${csudo}cp -r ${script_dir}/nginxd/* ${nginx_dir} && ${csudo}chmod 0555 ${nginx_dir}/*
${csudo}mkdir -p ${nginx_dir}/logs
${csudo}chmod 777 ${nginx_dir}/sbin/nginx
fi
} }
function install_lib() { function install_lib() {
...@@ -574,6 +567,13 @@ function install_examples() { ...@@ -574,6 +567,13 @@ function install_examples() {
fi fi
} }
function install_web() {
if [ -d "${script_dir}/share" ]; then
${csudo}cp -rf ${script_dir}/share/* ${install_main_dir}/share
fi
}
function clean_service_on_sysvinit() { function clean_service_on_sysvinit() {
if pidof ${serverName} &>/dev/null; then if pidof ${serverName} &>/dev/null; then
${csudo}service ${serverName} stop || : ${csudo}service ${serverName} stop || :
...@@ -654,16 +654,6 @@ function clean_service_on_systemd() { ...@@ -654,16 +654,6 @@ function clean_service_on_systemd() {
fi fi
${csudo}systemctl disable tarbitratord &>/dev/null || echo &>/dev/null ${csudo}systemctl disable tarbitratord &>/dev/null || echo &>/dev/null
${csudo}rm -f ${tarbitratord_service_config} ${csudo}rm -f ${tarbitratord_service_config}
if [ "$verMode" == "cluster" ]; then
nginx_service_config="${service_config_dir}/nginxd.service"
if systemctl is-active --quiet nginxd; then
echo "Nginx for ${productName} is running, stopping it..."
${csudo}systemctl stop nginxd &>/dev/null || echo &>/dev/null
fi
${csudo}systemctl disable nginxd &>/dev/null || echo &>/dev/null
${csudo}rm -f ${nginx_service_config}
fi
} }
function install_service_on_systemd() { function install_service_on_systemd() {
...@@ -677,19 +667,6 @@ function install_service_on_systemd() { ...@@ -677,19 +667,6 @@ function install_service_on_systemd() {
${csudo}systemctl enable ${serverName} ${csudo}systemctl enable ${serverName}
${csudo}systemctl daemon-reload ${csudo}systemctl daemon-reload
if [ "$verMode" == "cluster" ]; then
[ -f ${script_dir}/cfg/nginxd.service ] &&
${csudo}cp ${script_dir}/cfg/nginxd.service \
${service_config_dir}/ || :
${csudo}systemctl daemon-reload
if ! ${csudo}systemctl enable nginxd &>/dev/null; then
${csudo}systemctl daemon-reexec
${csudo}systemctl enable nginxd
fi
${csudo}systemctl start nginxd
fi
} }
function install_adapter_service() { function install_adapter_service() {
...@@ -793,19 +770,6 @@ function updateProduct() { ...@@ -793,19 +770,6 @@ function updateProduct() {
sleep 1 sleep 1
fi fi
if [ "$verMode" == "cluster" ]; then
if pidof nginx &>/dev/null; then
if ((${service_mod} == 0)); then
${csudo}systemctl stop nginxd || :
elif ((${service_mod} == 1)); then
${csudo}service nginxd stop || :
else
kill_process nginx
fi
sleep 1
fi
fi
install_main_path install_main_path
install_log install_log
...@@ -817,6 +781,7 @@ function updateProduct() { ...@@ -817,6 +781,7 @@ function updateProduct() {
fi fi
install_examples install_examples
install_web
if [ -z $1 ]; then if [ -z $1 ]; then
install_bin install_bin
install_service install_service
...@@ -825,18 +790,6 @@ function updateProduct() { ...@@ -825,18 +790,6 @@ function updateProduct() {
install_adapter_config install_adapter_config
openresty_work=false openresty_work=false
if [ "$verMode" == "cluster" ]; then
# Check if openresty is installed
# Check if nginx is installed successfully
if type curl &>/dev/null; then
if curl -sSf http://127.0.0.1:${nginx_port} &>/dev/null; then
echo -e "\033[44;32;1mNginx for ${productName} is updated successfully!${NC}"
openresty_work=true
else
echo -e "\033[44;31;5mNginx for ${productName} does not work! Please try again!\033[0m"
fi
fi
fi
echo echo
echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}" echo -e "${GREEN_DARK}To configure ${productName} ${NC}: edit ${cfg_install_dir}/${configFile}"
...@@ -857,7 +810,7 @@ function updateProduct() { ...@@ -857,7 +810,7 @@ function updateProduct() {
fi fi
if [ ${openresty_work} = 'true' ]; then if [ ${openresty_work} = 'true' ]; then
echo -e "${GREEN_DARK}To access ${productName} ${NC}: use ${GREEN_UNDERLINE}${clientName} -h $serverFqdn${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}" echo -e "${GREEN_DARK}To access ${productName} ${NC}: use ${GREEN_UNDERLINE}${clientName} -h $serverFqdn${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${web_port}${NC}"
else else
echo -e "${GREEN_DARK}To access ${productName} ${NC}: use ${GREEN_UNDERLINE}${clientName} -h $serverFqdn${NC} in shell${NC}" echo -e "${GREEN_DARK}To access ${productName} ${NC}: use ${GREEN_UNDERLINE}${clientName} -h $serverFqdn${NC} in shell${NC}"
fi fi
...@@ -906,6 +859,7 @@ function installProduct() { ...@@ -906,6 +859,7 @@ function installProduct() {
install_connector install_connector
fi fi
install_examples install_examples
install_web
if [ -z $1 ]; then # install service and client if [ -z $1 ]; then # install service and client
# For installing new # For installing new
...@@ -915,17 +869,6 @@ function installProduct() { ...@@ -915,17 +869,6 @@ function installProduct() {
install_adapter_config install_adapter_config
openresty_work=false openresty_work=false
if [ "$verMode" == "cluster" ]; then
# Check if nginx is installed successfully
if type curl &>/dev/null; then
if curl -sSf http://127.0.0.1:${nginx_port} &>/dev/null; then
echo -e "\033[44;32;1mNginx for ${productName} is installed successfully!${NC}"
openresty_work=true
else
echo -e "\033[44;31;5mNginx for ${productName} does not work! Please try again!\033[0m"
fi
fi
fi
install_config install_config
......
...@@ -151,6 +151,7 @@ function install_main_path() { ...@@ -151,6 +151,7 @@ function install_main_path() {
${csudo}mkdir -p ${install_main_dir}/driver ${csudo}mkdir -p ${install_main_dir}/driver
${csudo}mkdir -p ${install_main_dir}/examples ${csudo}mkdir -p ${install_main_dir}/examples
${csudo}mkdir -p ${install_main_dir}/include ${csudo}mkdir -p ${install_main_dir}/include
${csudo}mkdir -p ${install_main_dir}/share
# ${csudo}mkdir -p ${install_main_dir}/init.d # ${csudo}mkdir -p ${install_main_dir}/init.d
else else
${csudo}rm -rf ${install_main_dir} || ${csudo}rm -rf ${install_main_2_dir} || : ${csudo}rm -rf ${install_main_dir} || ${csudo}rm -rf ${install_main_2_dir} || :
...@@ -161,6 +162,7 @@ function install_main_path() { ...@@ -161,6 +162,7 @@ function install_main_path() {
${csudo}mkdir -p ${install_main_dir}/driver || ${csudo}mkdir -p ${install_main_2_dir}/driver ${csudo}mkdir -p ${install_main_dir}/driver || ${csudo}mkdir -p ${install_main_2_dir}/driver
${csudo}mkdir -p ${install_main_dir}/examples || ${csudo}mkdir -p ${install_main_2_dir}/examples ${csudo}mkdir -p ${install_main_dir}/examples || ${csudo}mkdir -p ${install_main_2_dir}/examples
${csudo}mkdir -p ${install_main_dir}/include || ${csudo}mkdir -p ${install_main_2_dir}/include ${csudo}mkdir -p ${install_main_dir}/include || ${csudo}mkdir -p ${install_main_2_dir}/include
${csudo}mkdir -p ${install_main_dir}/share || ${csudo}mkdir -p ${install_main_2_dir}/share
fi fi
} }
...@@ -469,6 +471,16 @@ function install_examples() { ...@@ -469,6 +471,16 @@ function install_examples() {
fi fi
} }
function install_web() {
if [ -d "${binary_dir}/build/share" ]; then
if [ "$osType" != "Darwin" ]; then
${csudo}cp -rf ${binary_dir}/build/share/* ${install_main_dir}/share || :
else
${csudo}cp -rf ${binary_dir}/build/share/* ${install_main_dir}/share || ${csudo}cp -rf ${binary_dir}/build/share/* ${install_main_2_dir}/share || :
fi
fi
}
function clean_service_on_sysvinit() { function clean_service_on_sysvinit() {
if pidof ${serverName} &>/dev/null; then if pidof ${serverName} &>/dev/null; then
${csudo}service ${serverName} stop || : ${csudo}service ${serverName} stop || :
...@@ -596,6 +608,7 @@ function update_TDengine() { ...@@ -596,6 +608,7 @@ function update_TDengine() {
install_lib install_lib
# install_connector # install_connector
install_examples install_examples
install_web
install_bin install_bin
install_service install_service
......
...@@ -107,7 +107,7 @@ else ...@@ -107,7 +107,7 @@ else
fi fi
install_files="${script_dir}/install.sh" install_files="${script_dir}/install.sh"
nginx_dir="${top_dir}/../enterprise/src/plugins/web" web_dir="${top_dir}/../enterprise/src/plugins/web"
init_file_deb=${script_dir}/../deb/taosd init_file_deb=${script_dir}/../deb/taosd
init_file_rpm=${script_dir}/../rpm/taosd init_file_rpm=${script_dir}/../rpm/taosd
...@@ -132,10 +132,6 @@ if [ -f "${cfg_dir}/${serverName}.service" ]; then ...@@ -132,10 +132,6 @@ if [ -f "${cfg_dir}/${serverName}.service" ]; then
cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || : cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || :
fi fi
if [ -f "${top_dir}/packaging/cfg/nginxd.service" ]; then
cp ${top_dir}/packaging/cfg/nginxd.service ${install_dir}/cfg || :
fi
mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/${serverName}.deb mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/${serverName}.deb
mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${serverName}.rpm mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${serverName}.rpm
...@@ -222,16 +218,6 @@ if [ "$verMode" == "cluster" ]; then ...@@ -222,16 +218,6 @@ if [ "$verMode" == "cluster" ]; then
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh
mv remove_temp.sh ${install_dir}/bin/remove.sh mv remove_temp.sh ${install_dir}/bin/remove.sh
mkdir -p ${install_dir}/nginxd && cp -r ${nginx_dir}/* ${install_dir}/nginxd
cp ${nginx_dir}/png/taos.png ${install_dir}/nginxd/admin/images/taos.png
rm -rf ${install_dir}/nginxd/png
if [ "$cpuType" == "aarch64" ]; then
cp -f ${install_dir}/nginxd/sbin/arm/64bit/nginx ${install_dir}/nginxd/sbin/
elif [ "$cpuType" == "aarch32" ]; then
cp -f ${install_dir}/nginxd/sbin/arm/32bit/nginx ${install_dir}/nginxd/sbin/
fi
rm -rf ${install_dir}/nginxd/sbin/arm
fi fi
cd ${install_dir} cd ${install_dir}
...@@ -288,6 +274,13 @@ if [[ $dbName == "taos" ]]; then ...@@ -288,6 +274,13 @@ if [[ $dbName == "taos" ]]; then
cp -r ${examples_dir}/C# ${install_dir}/examples cp -r ${examples_dir}/C# ${install_dir}/examples
mkdir -p ${install_dir}/examples/taosbenchmark-json && cp ${examples_dir}/../tools/taos-tools/example/* ${install_dir}/examples/taosbenchmark-json mkdir -p ${install_dir}/examples/taosbenchmark-json && cp ${examples_dir}/../tools/taos-tools/example/* ${install_dir}/examples/taosbenchmark-json
fi fi
# Add web files
if [ -d "${web_dir}/admin" ]; then
mkdir -p ${install_dir}/share/
cp ${web_dir}/admin ${install_dir}/share/ -r
cp ${web_dir}/png/taos.png ${install_dir}/share/admin/images/taos.png
fi
fi fi
# Copy driver # Copy driver
......
...@@ -27,13 +27,11 @@ local_bin_link_dir="/usr/local/bin" ...@@ -27,13 +27,11 @@ local_bin_link_dir="/usr/local/bin"
lib_link_dir="/usr/lib" lib_link_dir="/usr/lib"
lib64_link_dir="/usr/lib64" lib64_link_dir="/usr/lib64"
inc_link_dir="/usr/include" inc_link_dir="/usr/include"
install_nginxd_dir="/usr/local/nginxd"
service_config_dir="/etc/systemd/system" service_config_dir="/etc/systemd/system"
taos_service_name=${serverName} taos_service_name=${serverName}
taosadapter_service_name="taosadapter" taosadapter_service_name="taosadapter"
tarbitrator_service_name="tarbitratord" tarbitrator_service_name="tarbitratord"
nginx_service_name="nginxd"
csudo="" csudo=""
if command -v sudo >/dev/null; then if command -v sudo >/dev/null; then
csudo="sudo " csudo="sudo "
...@@ -153,18 +151,6 @@ function clean_service_on_systemd() { ...@@ -153,18 +151,6 @@ function clean_service_on_systemd() {
fi fi
${csudo}systemctl disable ${tarbitrator_service_name} &>/dev/null || echo &>/dev/null ${csudo}systemctl disable ${tarbitrator_service_name} &>/dev/null || echo &>/dev/null
${csudo}rm -f ${tarbitratord_service_config} ${csudo}rm -f ${tarbitratord_service_config}
if [ "$verMode" == "cluster" ]; then
nginx_service_config="${service_config_dir}/${nginx_service_name}.service"
if [ -d ${install_nginxd_dir} ]; then
if systemctl is-active --quiet ${nginx_service_name}; then
echo "Nginx for ${productName} is running, stopping it..."
${csudo}systemctl stop ${nginx_service_name} &>/dev/null || echo &>/dev/null
fi
${csudo}systemctl disable ${nginx_service_name} &>/dev/null || echo &>/dev/null
${csudo}rm -f ${nginx_service_config}
fi
fi
} }
function clean_service_on_sysvinit() { function clean_service_on_sysvinit() {
...@@ -239,7 +225,6 @@ clean_config ...@@ -239,7 +225,6 @@ clean_config
${csudo}rm -rf ${data_link_dir} || : ${csudo}rm -rf ${data_link_dir} || :
${csudo}rm -rf ${install_main_dir} ${csudo}rm -rf ${install_main_dir}
${csudo}rm -rf ${install_nginxd_dir}
if [[ -e /etc/os-release ]]; then if [[ -e /etc/os-release ]]; then
osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release) osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
else else
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "functionMgt.h" #include "functionMgt.h"
#include "os.h" #include "os.h"
#include "query.h" #include "query.h"
#include "qworker.h"
#include "scheduler.h" #include "scheduler.h"
#include "tcache.h" #include "tcache.h"
#include "tglobal.h" #include "tglobal.h"
...@@ -27,7 +28,6 @@ ...@@ -27,7 +28,6 @@
#include "trpc.h" #include "trpc.h"
#include "tsched.h" #include "tsched.h"
#include "ttime.h" #include "ttime.h"
#include "qworker.h"
#define TSC_VAR_NOT_RELEASE 1 #define TSC_VAR_NOT_RELEASE 1
#define TSC_VAR_RELEASED 0 #define TSC_VAR_RELEASED 0
...@@ -70,11 +70,10 @@ static void deregisterRequest(SRequestObj *pRequest) { ...@@ -70,11 +70,10 @@ static void deregisterRequest(SRequestObj *pRequest) {
int32_t currentInst = atomic_sub_fetch_64((int64_t *)&pActivity->currentRequests, 1); int32_t currentInst = atomic_sub_fetch_64((int64_t *)&pActivity->currentRequests, 1);
int32_t num = atomic_sub_fetch_32(&pTscObj->numOfReqs, 1); int32_t num = atomic_sub_fetch_32(&pTscObj->numOfReqs, 1);
int64_t nowUs = taosGetTimestampUs(); int64_t duration = taosGetTimestampUs() - pRequest->metric.start;
int64_t duration = nowUs - pRequest->metric.start; tscDebug("0x%" PRIx64 " free Request from connObj: 0x%" PRIx64 ", reqId:0x%" PRIx64 " elapsed:%.2f ms, "
tscDebug("0x%" PRIx64 " free Request from connObj: 0x%" PRIx64 ", reqId:0x%" PRIx64 " elapsed:%" PRIu64 "current:%d, app current:%d",
" ms, current:%d, app current:%d", pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000.0, num, currentInst);
pRequest->self, pTscObj->id, pRequest->requestId, duration / 1000, num, currentInst);
if (QUERY_NODE_VNODE_MODIF_STMT == pRequest->stmtType) { if (QUERY_NODE_VNODE_MODIF_STMT == pRequest->stmtType) {
tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 tscPerf("insert duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64
...@@ -85,11 +84,12 @@ static void deregisterRequest(SRequestObj *pRequest) { ...@@ -85,11 +84,12 @@ static void deregisterRequest(SRequestObj *pRequest) {
atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration); atomic_add_fetch_64((int64_t *)&pActivity->insertElapsedTime, duration);
} else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) { } else if (QUERY_NODE_SELECT_STMT == pRequest->stmtType) {
tscPerf("select duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64 tscPerf("select duration %" PRId64 "us: syntax:%" PRId64 "us, ctg:%" PRId64 "us, semantic:%" PRId64
"us, planner:%" PRId64 "us, exec:%" PRId64 "us", "us, planner:%" PRId64 "us, exec:%" PRId64 "us, reqId:0x%"PRIx64,
duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart, duration, pRequest->metric.syntaxEnd - pRequest->metric.syntaxStart,
pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd - pRequest->metric.ctgEnd, pRequest->metric.ctgEnd - pRequest->metric.ctgStart, pRequest->metric.semanticEnd - pRequest->metric.ctgEnd,
pRequest->metric.planEnd - pRequest->metric.semanticEnd, pRequest->metric.planEnd - pRequest->metric.semanticEnd,
pRequest->metric.resultReady - pRequest->metric.planEnd); pRequest->metric.resultReady - pRequest->metric.planEnd, pRequest->requestId);
atomic_add_fetch_64((int64_t *)&pActivity->queryElapsedTime, duration); atomic_add_fetch_64((int64_t *)&pActivity->queryElapsedTime, duration);
} }
......
...@@ -483,8 +483,8 @@ void setResPrecision(SReqResultInfo* pResInfo, int32_t precision) { ...@@ -483,8 +483,8 @@ void setResPrecision(SReqResultInfo* pResInfo, int32_t precision) {
int32_t buildVnodePolicyNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* pMnodeList, SArray* pDbVgList) { int32_t buildVnodePolicyNodeList(SRequestObj* pRequest, SArray** pNodeList, SArray* pMnodeList, SArray* pDbVgList) {
SArray* nodeList = taosArrayInit(4, sizeof(SQueryNodeLoad)); SArray* nodeList = taosArrayInit(4, sizeof(SQueryNodeLoad));
char *policy = (tsQueryPolicy == QUERY_POLICY_VNODE) ? "vnode" : "client"; char* policy = (tsQueryPolicy == QUERY_POLICY_VNODE) ? "vnode" : "client";
int32_t dbNum = taosArrayGetSize(pDbVgList); int32_t dbNum = taosArrayGetSize(pDbVgList);
for (int32_t i = 0; i < dbNum; ++i) { for (int32_t i = 0; i < dbNum; ++i) {
SArray* pVg = taosArrayGetP(pDbVgList, i); SArray* pVg = taosArrayGetP(pDbVgList, i);
...@@ -815,7 +815,7 @@ int32_t handleCreateTbExecRes(void* res, SCatalog* pCatalog) { ...@@ -815,7 +815,7 @@ int32_t handleCreateTbExecRes(void* res, SCatalog* pCatalog) {
int32_t handleQueryExecRsp(SRequestObj* pRequest) { int32_t handleQueryExecRsp(SRequestObj* pRequest) {
if (NULL == pRequest->body.resInfo.execRes.res) { if (NULL == pRequest->body.resInfo.execRes.res) {
return TSDB_CODE_SUCCESS; return pRequest->code;
} }
SCatalog* pCatalog = NULL; SCatalog* pCatalog = NULL;
...@@ -868,44 +868,43 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) { ...@@ -868,44 +868,43 @@ int32_t handleQueryExecRsp(SRequestObj* pRequest) {
return code; return code;
} }
//todo refacto the error code mgmt
void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) { void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
SRequestObj* pRequest = (SRequestObj*)param; SRequestObj* pRequest = (SRequestObj*)param;
pRequest->code = code; STscObj* pTscObj = pRequest->pTscObj;
pRequest->metric.resultReady = taosGetTimestampUs();
pRequest->code = code;
if (pResult) { if (pResult) {
destroyQueryExecRes(&pRequest->body.resInfo.execRes); destroyQueryExecRes(&pRequest->body.resInfo.execRes);
memcpy(&pRequest->body.resInfo.execRes, pResult, sizeof(*pResult)); memcpy(&pRequest->body.resInfo.execRes, pResult, sizeof(*pResult));
} }
if (TDMT_VND_SUBMIT == pRequest->type || TDMT_VND_DELETE == pRequest->type || int32_t type = pRequest->type;
TDMT_VND_CREATE_TABLE == pRequest->type) { if (TDMT_VND_SUBMIT == type || TDMT_VND_DELETE == type || TDMT_VND_CREATE_TABLE == type) {
if (pResult) { if (pResult) {
pRequest->body.resInfo.numOfRows = pResult->numOfRows; pRequest->body.resInfo.numOfRows = pResult->numOfRows;
if (TDMT_VND_SUBMIT == pRequest->type) {
STscObj* pTscObj = pRequest->pTscObj; // record the insert rows
if (TDMT_VND_SUBMIT == type) {
SAppClusterSummary* pActivity = &pTscObj->pAppInfo->summary; SAppClusterSummary* pActivity = &pTscObj->pAppInfo->summary;
atomic_add_fetch_64((int64_t*)&pActivity->numOfInsertRows, pResult->numOfRows); atomic_add_fetch_64((int64_t*)&pActivity->numOfInsertRows, pResult->numOfRows);
} }
} }
schedulerFreeJob(&pRequest->body.queryJob, 0); schedulerFreeJob(&pRequest->body.queryJob, 0);
pRequest->metric.execEnd = taosGetTimestampUs();
} }
taosMemoryFree(pResult); taosMemoryFree(pResult);
tscDebug("0x%" PRIx64 " enter scheduler exec cb, code:%s, reqId:0x%" PRIx64, pRequest->self, tstrerror(code),
pRequest->requestId);
tscDebug("0x%" PRIx64 " enter scheduler exec cb, code:%d - %s, reqId:0x%" PRIx64, pRequest->self, code,
tstrerror(code), pRequest->requestId);
STscObj* pTscObj = pRequest->pTscObj;
if (code != TSDB_CODE_SUCCESS && NEED_CLIENT_HANDLE_ERROR(code) && pRequest->sqlstr != NULL) { if (code != TSDB_CODE_SUCCESS && NEED_CLIENT_HANDLE_ERROR(code) && pRequest->sqlstr != NULL) {
tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64, tscDebug("0x%" PRIx64 " client retry to handle the error, code:%s, tryCount:%d, reqId:0x%" PRIx64,
pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId); pRequest->self, tstrerror(code), pRequest->retry, pRequest->requestId);
pRequest->prevCode = code; pRequest->prevCode = code;
schedulerFreeJob(&pRequest->body.queryJob, 0); schedulerFreeJob(&pRequest->body.queryJob, 0);
qDestroyQuery(pRequest->pQuery);
pRequest->pQuery = NULL;
doAsyncQuery(pRequest, true); doAsyncQuery(pRequest, true);
return; return;
} }
...@@ -915,7 +914,11 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) { ...@@ -915,7 +914,11 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
removeMeta(pTscObj, pRequest->targetTableList); removeMeta(pTscObj, pRequest->targetTableList);
} }
handleQueryExecRsp(pRequest); pRequest->metric.execEnd = taosGetTimestampUs();
int32_t code1 = handleQueryExecRsp(pRequest);
if (pRequest->code == TSDB_CODE_SUCCESS && pRequest->code != code1) {
pRequest->code = code1;
}
// return to client // return to client
pRequest->body.queryFp(pRequest->body.param, pRequest, code); pRequest->body.queryFp(pRequest->body.param, pRequest, code);
...@@ -1056,7 +1059,6 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultM ...@@ -1056,7 +1059,6 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultM
} }
pRequest->metric.planEnd = taosGetTimestampUs(); pRequest->metric.planEnd = taosGetTimestampUs();
if (TSDB_CODE_SUCCESS == code && !pRequest->validateOnly) { if (TSDB_CODE_SUCCESS == code && !pRequest->validateOnly) {
SArray* pNodeList = NULL; SArray* pNodeList = NULL;
buildAsyncExecNodeList(pRequest, &pNodeList, pMnodeList, pResultMeta); buildAsyncExecNodeList(pRequest, &pNodeList, pMnodeList, pResultMeta);
......
...@@ -20,13 +20,13 @@ ...@@ -20,13 +20,13 @@
#include "functionMgt.h" #include "functionMgt.h"
#include "os.h" #include "os.h"
#include "query.h" #include "query.h"
#include "qworker.h"
#include "scheduler.h" #include "scheduler.h"
#include "tglobal.h" #include "tglobal.h"
#include "tmsg.h" #include "tmsg.h"
#include "tref.h" #include "tref.h"
#include "trpc.h" #include "trpc.h"
#include "version.h" #include "version.h"
#include "qworker.h"
#define TSC_VAR_NOT_RELEASE 1 #define TSC_VAR_NOT_RELEASE 1
#define TSC_VAR_RELEASED 0 #define TSC_VAR_RELEASED 0
...@@ -700,6 +700,7 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) { ...@@ -700,6 +700,7 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
SQuery *pQuery = pRequest->pQuery; SQuery *pQuery = pRequest->pQuery;
pRequest->metric.ctgEnd = taosGetTimestampUs(); pRequest->metric.ctgEnd = taosGetTimestampUs();
qDebug("0x%" PRIx64 " start to semantic analysis, reqId:0x%" PRIx64, pRequest->self, pRequest->requestId);
if (code == TSDB_CODE_SUCCESS) { if (code == TSDB_CODE_SUCCESS) {
code = qAnalyseSqlSemantic(pWrapper->pCtx, &pWrapper->catalogReq, pResultMeta, pQuery); code = qAnalyseSqlSemantic(pWrapper->pCtx, &pWrapper->catalogReq, pResultMeta, pQuery);
...@@ -723,13 +724,16 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) { ...@@ -723,13 +724,16 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
destorySqlParseWrapper(pWrapper); destorySqlParseWrapper(pWrapper);
tscDebug("0x%" PRIx64 " analysis semantics completed, start async query, reqId:0x%" PRIx64, pRequest->self, double el = (pRequest->metric.semanticEnd - pRequest->metric.ctgEnd)/1000.0;
pRequest->requestId); tscDebug("0x%" PRIx64 " analysis semantics completed, start async query, elapsed time:%.2f ms, reqId:0x%" PRIx64,
pRequest->self, el, pRequest->requestId);
launchAsyncQuery(pRequest, pQuery, pResultMeta); launchAsyncQuery(pRequest, pQuery, pResultMeta);
} else { } else {
destorySqlParseWrapper(pWrapper); destorySqlParseWrapper(pWrapper);
qDestroyQuery(pRequest->pQuery); qDestroyQuery(pRequest->pQuery);
pRequest->pQuery = NULL; pRequest->pQuery = NULL;
if (NEED_CLIENT_HANDLE_ERROR(code)) { if (NEED_CLIENT_HANDLE_ERROR(code)) {
tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64, tscDebug("0x%" PRIx64 " client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%" PRIx64,
pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId); pRequest->self, code, tstrerror(code), pRequest->retry, pRequest->requestId);
...@@ -813,7 +817,6 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) { ...@@ -813,7 +817,6 @@ void doAsyncQuery(SRequestObj *pRequest, bool updateMetaForce) {
pRequest->metric.syntaxEnd = taosGetTimestampUs(); pRequest->metric.syntaxEnd = taosGetTimestampUs();
if (!updateMetaForce) { if (!updateMetaForce) {
STscObj *pTscObj = pRequest->pTscObj;
SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary; SAppClusterSummary *pActivity = &pTscObj->pAppInfo->summary;
if (NULL == pRequest->pQuery->pRoot) { if (NULL == pRequest->pQuery->pRoot) {
atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1); atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1);
...@@ -860,6 +863,7 @@ static void fetchCallback(void *pResult, void *param, int32_t code) { ...@@ -860,6 +863,7 @@ static void fetchCallback(void *pResult, void *param, int32_t code) {
SRequestObj *pRequest = (SRequestObj *)param; SRequestObj *pRequest = (SRequestObj *)param;
SReqResultInfo *pResultInfo = &pRequest->body.resInfo; SReqResultInfo *pResultInfo = &pRequest->body.resInfo;
pRequest->metric.resultReady = taosGetTimestampUs();
tscDebug("0x%" PRIx64 " enter scheduler fetch cb, code:%d - %s, reqId:0x%" PRIx64, pRequest->self, code, tscDebug("0x%" PRIx64 " enter scheduler fetch cb, code:%d - %s, reqId:0x%" PRIx64, pRequest->self, code,
tstrerror(code), pRequest->requestId); tstrerror(code), pRequest->requestId);
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
#define NCHAR_ADD_LEN 3 // L"nchar" 3 means L" " #define NCHAR_ADD_LEN 3 // L"nchar" 3 means L" "
#define MAX_RETRY_TIMES 5 #define MAX_RETRY_TIMES 5
#define LINE_BATCH 20000 #define LINE_BATCH 2000
//================================================================================================= //=================================================================================================
typedef TSDB_SML_PROTOCOL_TYPE SMLProtocolType; typedef TSDB_SML_PROTOCOL_TYPE SMLProtocolType;
...@@ -151,13 +151,14 @@ typedef struct { ...@@ -151,13 +151,14 @@ typedef struct {
typedef struct { typedef struct {
SRequestObj *request; SRequestObj *request;
tsem_t sem; tsem_t sem;
int32_t cnt;
int32_t total;
TdThreadSpinlock lock; TdThreadSpinlock lock;
} Params; } Params;
typedef struct { typedef struct {
int64_t id; int64_t id;
Params *params; Params *params;
bool isLast;
SMLProtocolType protocol; SMLProtocolType protocol;
int8_t precision; int8_t precision;
...@@ -1531,6 +1532,7 @@ static SSmlHandle* smlBuildSmlInfo(STscObj* pTscObj, SRequestObj* request, SMLPr ...@@ -1531,6 +1532,7 @@ static SSmlHandle* smlBuildSmlInfo(STscObj* pTscObj, SRequestObj* request, SMLPr
info->pRequest = request; info->pRequest = request;
info->msgBuf.buf = info->pRequest->msgBuf; info->msgBuf.buf = info->pRequest->msgBuf;
info->msgBuf.len = ERROR_MSG_BUF_DEFAULT_SIZE; info->msgBuf.len = ERROR_MSG_BUF_DEFAULT_SIZE;
info->pRequest->stmtType = info->pQuery->pRoot->type;
} }
info->exec = smlInitHandle(info->pQuery); info->exec = smlInitHandle(info->pQuery);
...@@ -2331,6 +2333,9 @@ static int32_t smlInsertData(SSmlHandle *info) { ...@@ -2331,6 +2333,9 @@ static int32_t smlInsertData(SSmlHandle *info) {
// info->affectedRows = taos_affected_rows(info->pRequest); // info->affectedRows = taos_affected_rows(info->pRequest);
// return info->pRequest->code; // return info->pRequest->code;
SAppClusterSummary *pActivity = &info->taos->pAppInfo->summary;
atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1);
launchAsyncQuery(info->pRequest, info->pQuery, NULL); launchAsyncQuery(info->pRequest, info->pQuery, NULL);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
...@@ -2449,28 +2454,26 @@ static void smlInsertCallback(void *param, void *res, int32_t code) { ...@@ -2449,28 +2454,26 @@ static void smlInsertCallback(void *param, void *res, int32_t code) {
int32_t rows = taos_affected_rows(pRequest); int32_t rows = taos_affected_rows(pRequest);
uDebug("SML:0x%" PRIx64 " result. code:%d, msg:%s", info->id, pRequest->code, pRequest->msgBuf); uDebug("SML:0x%" PRIx64 " result. code:%d, msg:%s", info->id, pRequest->code, pRequest->msgBuf);
Params *pParam = info->params;
// lock // lock
taosThreadSpinLock(&info->params->lock); taosThreadSpinLock(&pParam->lock);
pParam->cnt++;
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
info->params->request->code = code; pParam->request->code = code;
info->params->request->body.resInfo.numOfRows += rows; pParam->request->body.resInfo.numOfRows += rows;
}else{ }else{
info->params->request->body.resInfo.numOfRows += info->affectedRows; pParam->request->body.resInfo.numOfRows += info->affectedRows;
} }
taosThreadSpinUnlock(&info->params->lock); if (pParam->cnt == pParam->total) {
tsem_post(&pParam->sem);
}
taosThreadSpinUnlock(&pParam->lock);
// unlock // unlock
uDebug("SML:0x%" PRIx64 " insert finished, code: %d, rows: %d, total: %d", info->id, code, rows, info->affectedRows); uDebug("SML:0x%" PRIx64 " insert finished, code: %d, rows: %d, total: %d", info->id, code, rows, info->affectedRows);
Params *pParam = info->params;
bool isLast = info->isLast;
info->cost.endTime = taosGetTimestampUs(); info->cost.endTime = taosGetTimestampUs();
info->cost.code = code; info->cost.code = code;
smlPrintStatisticInfo(info); smlPrintStatisticInfo(info);
smlDestroyInfo(info); smlDestroyInfo(info);
if (isLast) {
tsem_post(&pParam->sem);
}
} }
/** /**
...@@ -2512,7 +2515,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr ...@@ -2512,7 +2515,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
pTscObj->schemalessType = 1; pTscObj->schemalessType = 1;
SSmlMsgBuf msg = {ERROR_MSG_BUF_DEFAULT_SIZE, request->msgBuf}; SSmlMsgBuf msg = {ERROR_MSG_BUF_DEFAULT_SIZE, request->msgBuf};
Params params; Params params = {0};
params.request = request; params.request = request;
tsem_init(&params.sem, 0, 0); tsem_init(&params.sem, 0, 0);
taosThreadSpinInit(&(params.lock), 0); taosThreadSpinInit(&(params.lock), 0);
...@@ -2557,6 +2560,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr ...@@ -2557,6 +2560,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
} }
batchs = ceil(((double)numLines) / LINE_BATCH); batchs = ceil(((double)numLines) / LINE_BATCH);
params.total = batchs;
for (int i = 0; i < batchs; ++i) { for (int i = 0; i < batchs; ++i) {
SRequestObj* req = (SRequestObj*)createRequest(pTscObj->id, TSDB_SQL_INSERT); SRequestObj* req = (SRequestObj*)createRequest(pTscObj->id, TSDB_SQL_INSERT);
if(!req){ if(!req){
...@@ -2575,11 +2579,9 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr ...@@ -2575,11 +2579,9 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
if (numLines > perBatch) { if (numLines > perBatch) {
numLines -= perBatch; numLines -= perBatch;
info->isLast = false;
} else { } else {
perBatch = numLines; perBatch = numLines;
numLines = 0; numLines = 0;
info->isLast = true;
} }
info->params = &params; info->params = &params;
......
...@@ -515,7 +515,7 @@ int32_t tmqCommitMsgImpl(tmq_t* tmq, const TAOS_RES* msg, int8_t async, tmq_comm ...@@ -515,7 +515,7 @@ int32_t tmqCommitMsgImpl(tmq_t* tmq, const TAOS_RES* msg, int8_t async, tmq_comm
SMqMetaRspObj* pMetaRspObj = (SMqMetaRspObj*)msg; SMqMetaRspObj* pMetaRspObj = (SMqMetaRspObj*)msg;
topic = pMetaRspObj->topic; topic = pMetaRspObj->topic;
vgId = pMetaRspObj->vgId; vgId = pMetaRspObj->vgId;
} else if(TD_RES_TMQ_METADATA(msg)) { } else if (TD_RES_TMQ_METADATA(msg)) {
SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*)msg; SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*)msg;
topic = pRspObj->topic; topic = pRspObj->topic;
vgId = pRspObj->vgId; vgId = pRspObj->vgId;
...@@ -715,7 +715,7 @@ void tmqSendHbReq(void* param, void* tmrId) { ...@@ -715,7 +715,7 @@ void tmqSendHbReq(void* param, void* tmrId) {
int32_t epoch = tmq->epoch; int32_t epoch = tmq->epoch;
SMqHbReq* pReq = taosMemoryMalloc(sizeof(SMqHbReq)); SMqHbReq* pReq = taosMemoryMalloc(sizeof(SMqHbReq));
if (pReq == NULL) goto OVER; if (pReq == NULL) goto OVER;
pReq->consumerId = consumerId; pReq->consumerId = htobe64(consumerId);
pReq->epoch = epoch; pReq->epoch = epoch;
SMsgSendInfo* sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo)); SMsgSendInfo* sendInfo = taosMemoryCalloc(1, sizeof(SMsgSendInfo));
...@@ -1603,6 +1603,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { ...@@ -1603,6 +1603,7 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
return NULL; return NULL;
} else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_RSP) { } else if (rspWrapper->tmqRspType == TMQ_MSG_TYPE__POLL_RSP) {
SMqPollRspWrapper* pollRspWrapper = (SMqPollRspWrapper*)rspWrapper; SMqPollRspWrapper* pollRspWrapper = (SMqPollRspWrapper*)rspWrapper;
tscDebug("consumer %ld actual process poll rsp", tmq->consumerId);
/*atomic_sub_fetch_32(&tmq->readyRequest, 1);*/ /*atomic_sub_fetch_32(&tmq->readyRequest, 1);*/
int32_t consumerEpoch = atomic_load_32(&tmq->epoch); int32_t consumerEpoch = atomic_load_32(&tmq->epoch);
if (pollRspWrapper->dataRsp.head.epoch == consumerEpoch) { if (pollRspWrapper->dataRsp.head.epoch == consumerEpoch) {
...@@ -1661,9 +1662,9 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) { ...@@ -1661,9 +1662,9 @@ void* tmqHandleAllRsp(tmq_t* tmq, int64_t timeout, bool pollIfReset) {
// build rsp // build rsp
void* pRsp = NULL; void* pRsp = NULL;
if(pollRspWrapper->taosxRsp.createTableNum == 0){ if (pollRspWrapper->taosxRsp.createTableNum == 0) {
pRsp = tmqBuildRspFromWrapper(pollRspWrapper); pRsp = tmqBuildRspFromWrapper(pollRspWrapper);
}else{ } else {
pRsp = tmqBuildTaosxRspFromWrapper(pollRspWrapper); pRsp = tmqBuildTaosxRspFromWrapper(pollRspWrapper);
} }
taosFreeQitem(pollRspWrapper); taosFreeQitem(pollRspWrapper);
...@@ -1718,7 +1719,10 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) { ...@@ -1718,7 +1719,10 @@ TAOS_RES* tmq_consumer_poll(tmq_t* tmq, int64_t timeout) {
while (1) { while (1) {
tmqHandleAllDelayedTask(tmq); tmqHandleAllDelayedTask(tmq);
if (tmqPollImpl(tmq, timeout) < 0) return NULL; if (tmqPollImpl(tmq, timeout) < 0) {
tscDebug("return since poll err");
/*return NULL;*/
}
rspObj = tmqHandleAllRsp(tmq, timeout, false); rspObj = tmqHandleAllRsp(tmq, timeout, false);
if (rspObj) { if (rspObj) {
...@@ -1850,12 +1854,12 @@ const char* tmq_get_table_name(TAOS_RES* res) { ...@@ -1850,12 +1854,12 @@ const char* tmq_get_table_name(TAOS_RES* res) {
return (const char*)taosArrayGetP(pRspObj->rsp.blockTbName, pRspObj->resIter); return (const char*)taosArrayGetP(pRspObj->rsp.blockTbName, pRspObj->resIter);
} else if (TD_RES_TMQ_METADATA(res)) { } else if (TD_RES_TMQ_METADATA(res)) {
SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*)res; SMqTaosxRspObj* pRspObj = (SMqTaosxRspObj*)res;
if (!pRspObj->rsp.withTbName || pRspObj->rsp.blockTbName == NULL || pRspObj->resIter < 0 || if (!pRspObj->rsp.withTbName || pRspObj->rsp.blockTbName == NULL || pRspObj->resIter < 0 ||
pRspObj->resIter >= pRspObj->rsp.blockNum) { pRspObj->resIter >= pRspObj->rsp.blockNum) {
return NULL; return NULL;
}
return (const char*)taosArrayGetP(pRspObj->rsp.blockTbName, pRspObj->resIter);
} }
return (const char*)taosArrayGetP(pRspObj->rsp.blockTbName, pRspObj->resIter);
}
return NULL; return NULL;
} }
......
...@@ -85,8 +85,7 @@ uint16_t tsTelemPort = 80; ...@@ -85,8 +85,7 @@ uint16_t tsTelemPort = 80;
char tsSmlTagName[TSDB_COL_NAME_LEN] = "_tag_null"; char tsSmlTagName[TSDB_COL_NAME_LEN] = "_tag_null";
char tsSmlChildTableName[TSDB_TABLE_NAME_LEN] = ""; // user defined child table name can be specified in tag value. char tsSmlChildTableName[TSDB_TABLE_NAME_LEN] = ""; // user defined child table name can be specified in tag value.
// If set to empty system will generate table name using MD5 hash. // If set to empty system will generate table name using MD5 hash.
bool tsSmlDataFormat = bool tsSmlDataFormat = false; // true means that the name and order of cols in each line are the same(only for influx protocol)
true; // true means that the name and order of cols in each line are the same(only for influx protocol)
// query // query
int32_t tsQueryPolicy = 1; int32_t tsQueryPolicy = 1;
...@@ -95,6 +94,7 @@ int32_t tsQueryRsmaTolerance = 1000; // the tolerance time (ms) to judge from w ...@@ -95,6 +94,7 @@ int32_t tsQueryRsmaTolerance = 1000; // the tolerance time (ms) to judge from w
bool tsQueryPlannerTrace = false; bool tsQueryPlannerTrace = false;
int32_t tsQueryNodeChunkSize = 32 * 1024; int32_t tsQueryNodeChunkSize = 32 * 1024;
bool tsQueryUseNodeAllocator = true; bool tsQueryUseNodeAllocator = true;
bool tsKeepColumnName = false;
/* /*
* denote if the server needs to compress response message at the application layer to client, including query rsp, * denote if the server needs to compress response message at the application layer to client, including query rsp,
...@@ -205,7 +205,9 @@ static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *input ...@@ -205,7 +205,9 @@ static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *input
tstrncpy(cfgFile, cfgDir, sizeof(cfgDir)); tstrncpy(cfgFile, cfgDir, sizeof(cfgDir));
} }
if (apolloUrl == NULL || apolloUrl[0] == '\0') cfgGetApollUrl(envCmd, envFile, apolloUrl); if (apolloUrl != NULL && apolloUrl[0] == '\0') {
cfgGetApollUrl(envCmd, envFile, apolloUrl);
}
if (cfgLoad(pCfg, CFG_STYPE_APOLLO_URL, apolloUrl) != 0) { if (cfgLoad(pCfg, CFG_STYPE_APOLLO_URL, apolloUrl) != 0) {
uError("failed to load from apollo url:%s since %s", apolloUrl, terrstr()); uError("failed to load from apollo url:%s since %s", apolloUrl, terrstr());
...@@ -290,6 +292,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { ...@@ -290,6 +292,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if (cfgAddBool(pCfg, "queryPlannerTrace", tsQueryPlannerTrace, true) != 0) return -1; if (cfgAddBool(pCfg, "queryPlannerTrace", tsQueryPlannerTrace, true) != 0) return -1;
if (cfgAddInt32(pCfg, "queryNodeChunkSize", tsQueryNodeChunkSize, 1024, 128 * 1024, true) != 0) return -1; if (cfgAddInt32(pCfg, "queryNodeChunkSize", tsQueryNodeChunkSize, 1024, 128 * 1024, true) != 0) return -1;
if (cfgAddBool(pCfg, "queryUseNodeAllocator", tsQueryUseNodeAllocator, true) != 0) return -1; if (cfgAddBool(pCfg, "queryUseNodeAllocator", tsQueryUseNodeAllocator, true) != 0) return -1;
if (cfgAddBool(pCfg, "keepColumnName", tsKeepColumnName, true) != 0) return -1;
if (cfgAddString(pCfg, "smlChildTableName", "", 1) != 0) return -1; if (cfgAddString(pCfg, "smlChildTableName", "", 1) != 0) return -1;
if (cfgAddString(pCfg, "smlTagName", tsSmlTagName, 1) != 0) return -1; if (cfgAddString(pCfg, "smlTagName", tsSmlTagName, 1) != 0) return -1;
if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1;
...@@ -652,6 +655,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { ...@@ -652,6 +655,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
tsQueryPlannerTrace = cfgGetItem(pCfg, "queryPlannerTrace")->bval; tsQueryPlannerTrace = cfgGetItem(pCfg, "queryPlannerTrace")->bval;
tsQueryNodeChunkSize = cfgGetItem(pCfg, "queryNodeChunkSize")->i32; tsQueryNodeChunkSize = cfgGetItem(pCfg, "queryNodeChunkSize")->i32;
tsQueryUseNodeAllocator = cfgGetItem(pCfg, "queryUseNodeAllocator")->bval; tsQueryUseNodeAllocator = cfgGetItem(pCfg, "queryUseNodeAllocator")->bval;
tsKeepColumnName = cfgGetItem(pCfg, "keepColumnName")->bval;
return 0; return 0;
} }
...@@ -685,7 +689,9 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { ...@@ -685,7 +689,9 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
tsQueryBufferSize = cfgGetItem(pCfg, "queryBufferSize")->i32; tsQueryBufferSize = cfgGetItem(pCfg, "queryBufferSize")->i32;
tsPrintAuth = cfgGetItem(pCfg, "printAuth")->bval; tsPrintAuth = cfgGetItem(pCfg, "printAuth")->bval;
#if !defined(WINDOWS) && !defined(DARWIN)
tsMultiProcess = cfgGetItem(pCfg, "multiProcess")->bval; tsMultiProcess = cfgGetItem(pCfg, "multiProcess")->bval;
#endif
tsMnodeShmSize = cfgGetItem(pCfg, "mnodeShmSize")->i32; tsMnodeShmSize = cfgGetItem(pCfg, "mnodeShmSize")->i32;
tsVnodeShmSize = cfgGetItem(pCfg, "vnodeShmSize")->i32; tsVnodeShmSize = cfgGetItem(pCfg, "vnodeShmSize")->i32;
tsQnodeShmSize = cfgGetItem(pCfg, "qnodeShmSize")->i32; tsQnodeShmSize = cfgGetItem(pCfg, "qnodeShmSize")->i32;
...@@ -843,6 +849,9 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { ...@@ -843,6 +849,9 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
break; break;
} }
case 'k': { case 'k': {
if (strcasecmp("keepColumnName", name) == 0) {
tsKeepColumnName = cfgGetItem(pCfg, "keepColumnName")->bval;
}
break; break;
} }
case 'l': { case 'l': {
...@@ -919,7 +928,9 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) { ...@@ -919,7 +928,9 @@ int32_t taosSetCfg(SConfig *pCfg, char *name) {
} }
case 'u': { case 'u': {
if (strcasecmp("multiProcess", name) == 0) { if (strcasecmp("multiProcess", name) == 0) {
#if !defined(WINDOWS) && !defined(DARWIN)
tsMultiProcess = cfgGetItem(pCfg, "multiProcess")->bval; tsMultiProcess = cfgGetItem(pCfg, "multiProcess")->bval;
#endif
} else if (strcasecmp("udfDebugFlag", name) == 0) { } else if (strcasecmp("udfDebugFlag", name) == 0) {
udfDebugFlag = cfgGetItem(pCfg, "udfDebugFlag")->i32; udfDebugFlag = cfgGetItem(pCfg, "udfDebugFlag")->i32;
} }
...@@ -1122,11 +1133,20 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi ...@@ -1122,11 +1133,20 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
if (tsc) { if (tsc) {
tsLogEmbedded = 0; tsLogEmbedded = 0;
if (taosAddClientLogCfg(pCfg) != 0) return -1; if (taosAddClientLogCfg(pCfg) != 0) {
cfgCleanup(pCfg);
return -1;
}
} else { } else {
tsLogEmbedded = 1; tsLogEmbedded = 1;
if (taosAddClientLogCfg(pCfg) != 0) return -1; if (taosAddClientLogCfg(pCfg) != 0) {
if (taosAddServerLogCfg(pCfg) != 0) return -1; cfgCleanup(pCfg);
return -1;
}
if (taosAddServerLogCfg(pCfg) != 0) {
cfgCleanup(pCfg);
return -1;
}
} }
if (taosLoadCfg(pCfg, envCmd, cfgDir, envFile, apolloUrl) != 0) { if (taosLoadCfg(pCfg, envCmd, cfgDir, envFile, apolloUrl) != 0) {
......
...@@ -2682,6 +2682,7 @@ int32_t tSerializeSTrimDbReq(void *buf, int32_t bufLen, STrimDbReq *pReq) { ...@@ -2682,6 +2682,7 @@ int32_t tSerializeSTrimDbReq(void *buf, int32_t bufLen, STrimDbReq *pReq) {
if (tStartEncode(&encoder) < 0) return -1; if (tStartEncode(&encoder) < 0) return -1;
if (tEncodeCStr(&encoder, pReq->db) < 0) return -1; if (tEncodeCStr(&encoder, pReq->db) < 0) return -1;
if (tEncodeI32(&encoder, pReq->maxSpeed) < 0) return -1;
tEndEncode(&encoder); tEndEncode(&encoder);
int32_t tlen = encoder.pos; int32_t tlen = encoder.pos;
...@@ -2695,6 +2696,7 @@ int32_t tDeserializeSTrimDbReq(void *buf, int32_t bufLen, STrimDbReq *pReq) { ...@@ -2695,6 +2696,7 @@ int32_t tDeserializeSTrimDbReq(void *buf, int32_t bufLen, STrimDbReq *pReq) {
if (tStartDecode(&decoder) < 0) return -1; if (tStartDecode(&decoder) < 0) return -1;
if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->db) < 0) return -1;
if (tDecodeI32(&decoder, &pReq->maxSpeed) < 0) return -1;
tEndDecode(&decoder); tEndDecode(&decoder);
tDecoderClear(&decoder); tDecoderClear(&decoder);
...@@ -3347,12 +3349,12 @@ int32_t tDeserializeSSTbHbRsp(void *buf, int32_t bufLen, SSTbHbRsp *pRsp) { ...@@ -3347,12 +3349,12 @@ int32_t tDeserializeSSTbHbRsp(void *buf, int32_t bufLen, SSTbHbRsp *pRsp) {
return 0; return 0;
} }
void tFreeSTableMetaRsp(void *pRsp) { void tFreeSTableMetaRsp(void *pRsp) {
if (NULL == pRsp) { if (NULL == pRsp) {
return; return;
} }
taosMemoryFreeClear(((STableMetaRsp *)pRsp)->pSchemas); taosMemoryFreeClear(((STableMetaRsp *)pRsp)->pSchemas);
} }
void tFreeSTableIndexRsp(void *info) { void tFreeSTableIndexRsp(void *info) {
...@@ -4373,8 +4375,7 @@ int32_t tDeserializeSExplainRsp(void *buf, int32_t bufLen, SExplainRsp *pRsp) { ...@@ -4373,8 +4375,7 @@ int32_t tDeserializeSExplainRsp(void *buf, int32_t bufLen, SExplainRsp *pRsp) {
if (tDecodeDouble(&decoder, &pRsp->subplanInfo[i].totalCost) < 0) return -1; if (tDecodeDouble(&decoder, &pRsp->subplanInfo[i].totalCost) < 0) return -1;
if (tDecodeU64(&decoder, &pRsp->subplanInfo[i].numOfRows) < 0) return -1; if (tDecodeU64(&decoder, &pRsp->subplanInfo[i].numOfRows) < 0) return -1;
if (tDecodeU32(&decoder, &pRsp->subplanInfo[i].verboseLen) < 0) return -1; if (tDecodeU32(&decoder, &pRsp->subplanInfo[i].verboseLen) < 0) return -1;
if (tDecodeBinaryAlloc(&decoder, &pRsp->subplanInfo[i].verboseInfo, NULL) < 0) if (tDecodeBinaryAlloc(&decoder, &pRsp->subplanInfo[i].verboseInfo, NULL) < 0) return -1;
return -1;
} }
tEndDecode(&decoder); tEndDecode(&decoder);
...@@ -4826,6 +4827,14 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS ...@@ -4826,6 +4827,14 @@ int32_t tSerializeSCMCreateStreamReq(void *buf, int32_t bufLen, const SCMCreateS
if (tEncodeI8(&encoder, pReq->igExpired) < 0) return -1; if (tEncodeI8(&encoder, pReq->igExpired) < 0) return -1;
if (sqlLen > 0 && tEncodeCStr(&encoder, pReq->sql) < 0) return -1; if (sqlLen > 0 && tEncodeCStr(&encoder, pReq->sql) < 0) return -1;
if (astLen > 0 && tEncodeCStr(&encoder, pReq->ast) < 0) return -1; if (astLen > 0 && tEncodeCStr(&encoder, pReq->ast) < 0) return -1;
if (tEncodeI32(&encoder, pReq->numOfTags) < 0) return -1;
for (int32_t i = 0; i < pReq->numOfTags; ++i) {
SField *pField = taosArrayGet(pReq->pTags, i);
if (tEncodeI8(&encoder, pField->type) < 0) return -1;
if (tEncodeI8(&encoder, pField->flags) < 0) return -1;
if (tEncodeI32(&encoder, pField->bytes) < 0) return -1;
if (tEncodeCStr(&encoder, pField->name) < 0) return -1;
}
tEndEncode(&encoder); tEndEncode(&encoder);
...@@ -4864,6 +4873,28 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea ...@@ -4864,6 +4873,28 @@ int32_t tDeserializeSCMCreateStreamReq(void *buf, int32_t bufLen, SCMCreateStrea
if (pReq->ast == NULL) return -1; if (pReq->ast == NULL) return -1;
if (tDecodeCStrTo(&decoder, pReq->ast) < 0) return -1; if (tDecodeCStrTo(&decoder, pReq->ast) < 0) return -1;
} }
if (tDecodeI32(&decoder, &pReq->numOfTags) < 0) return -1;
if (pReq->numOfTags > 0) {
pReq->pTags = taosArrayInit(pReq->numOfTags, sizeof(SField));
if (pReq->pTags == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
}
for (int32_t i = 0; i < pReq->numOfTags; ++i) {
SField field = {0};
if (tDecodeI8(&decoder, &field.type) < 0) return -1;
if (tDecodeI8(&decoder, &field.flags) < 0) return -1;
if (tDecodeI32(&decoder, &field.bytes) < 0) return -1;
if (tDecodeCStrTo(&decoder, field.name) < 0) return -1;
if (taosArrayPush(pReq->pTags, &field) == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
}
}
}
tEndDecode(&decoder); tEndDecode(&decoder);
tDecoderClear(&decoder); tDecoderClear(&decoder);
......
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "dmMgmt.h" #include "dmMgmt.h"
#include "tconfig.h" #include "tconfig.h"
#include "mnode.h"
#define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'." #define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'."
#define DM_CFG_DIR "Configuration directory." #define DM_CFG_DIR "Configuration directory."
#define DM_DMP_CFG "Dump configuration." #define DM_DMP_CFG "Dump configuration."
#define DM_SDB_INFO "Dump sdb info."
#define DM_ENV_CMD "The env cmd variable string to use when configuring the server, such as: -e 'TAOS_FQDN=td1'." #define DM_ENV_CMD "The env cmd variable string to use when configuring the server, such as: -e 'TAOS_FQDN=td1'."
#define DM_ENV_FILE "The env variable file path to use when configuring the server, default is './.env', .env text can be 'TAOS_FQDN=td1'." #define DM_ENV_FILE "The env variable file path to use when configuring the server, default is './.env', .env text can be 'TAOS_FQDN=td1'."
#define DM_NODE_TYPE "Startup type of the node, default is 0." #define DM_NODE_TYPE "Startup type of the node, default is 0."
...@@ -31,6 +33,7 @@ static struct { ...@@ -31,6 +33,7 @@ static struct {
bool winServiceMode; bool winServiceMode;
#endif #endif
bool dumpConfig; bool dumpConfig;
bool dumpSdb;
bool generateGrant; bool generateGrant;
bool printAuth; bool printAuth;
bool printVersion; bool printVersion;
...@@ -82,6 +85,8 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) { ...@@ -82,6 +85,8 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) {
} }
} else if (strcmp(argv[i], "-a") == 0) { } else if (strcmp(argv[i], "-a") == 0) {
tstrncpy(global.apolloUrl, argv[++i], PATH_MAX); tstrncpy(global.apolloUrl, argv[++i], PATH_MAX);
} else if (strcmp(argv[i], "-s") == 0) {
global.dumpSdb = true;
} else if (strcmp(argv[i], "-E") == 0) { } else if (strcmp(argv[i], "-E") == 0) {
tstrncpy(global.envFile, argv[++i], PATH_MAX); tstrncpy(global.envFile, argv[++i], PATH_MAX);
} else if (strcmp(argv[i], "-n") == 0) { } else if (strcmp(argv[i], "-n") == 0) {
...@@ -131,6 +136,7 @@ static void dmPrintHelp() { ...@@ -131,6 +136,7 @@ static void dmPrintHelp() {
printf("Usage: taosd [OPTION...] \n\n"); printf("Usage: taosd [OPTION...] \n\n");
printf("%s%s%s%s\n", indent, "-a,", indent, DM_APOLLO_URL); printf("%s%s%s%s\n", indent, "-a,", indent, DM_APOLLO_URL);
printf("%s%s%s%s\n", indent, "-c,", indent, DM_CFG_DIR); printf("%s%s%s%s\n", indent, "-c,", indent, DM_CFG_DIR);
printf("%s%s%s%s\n", indent, "-s,", indent, DM_SDB_INFO);
printf("%s%s%s%s\n", indent, "-C,", indent, DM_DMP_CFG); printf("%s%s%s%s\n", indent, "-C,", indent, DM_DMP_CFG);
printf("%s%s%s%s\n", indent, "-e,", indent, DM_ENV_CMD); printf("%s%s%s%s\n", indent, "-e,", indent, DM_ENV_CMD);
printf("%s%s%s%s\n", indent, "-E,", indent, DM_ENV_FILE); printf("%s%s%s%s\n", indent, "-E,", indent, DM_ENV_FILE);
...@@ -229,6 +235,14 @@ int mainWindows(int argc,char** argv) { ...@@ -229,6 +235,14 @@ int mainWindows(int argc,char** argv) {
return 0; return 0;
} }
if (global.dumpSdb) {
mndDumpSdb();
taosCleanupCfg();
taosCloseLog();
taosCleanupArgs();
return 0;
}
dmSetProcInfo(argc, (char **)argv); dmSetProcInfo(argc, (char **)argv);
taosCleanupArgs(); taosCleanupArgs();
......
...@@ -87,6 +87,7 @@ int32_t qmPutRpcMsgToQueue(SQnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) { ...@@ -87,6 +87,7 @@ int32_t qmPutRpcMsgToQueue(SQnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
return 0; return 0;
default: default:
terrno = TSDB_CODE_INVALID_PARA; terrno = TSDB_CODE_INVALID_PARA;
taosFreeQitem(pMsg);
return -1; return -1;
} }
} }
......
...@@ -135,12 +135,14 @@ _OVER: ...@@ -135,12 +135,14 @@ _OVER:
if (content != NULL) taosMemoryFree(content); if (content != NULL) taosMemoryFree(content);
if (root != NULL) cJSON_Delete(root); if (root != NULL) cJSON_Delete(root);
if (pFile != NULL) taosCloseFile(&pFile); if (pFile != NULL) taosCloseFile(&pFile);
if (*ppCfgs == NULL && pCfgs != NULL) taosMemoryFree(pCfgs);
terrno = code; terrno = code;
return code; return code;
} }
int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
int32_t ret = 0;
char file[PATH_MAX] = {0}; char file[PATH_MAX] = {0};
char realfile[PATH_MAX] = {0}; char realfile[PATH_MAX] = {0};
snprintf(file, sizeof(file), "%s%svnodes.json.bak", pMgmt->path, TD_DIRSEP); snprintf(file, sizeof(file), "%s%svnodes.json.bak", pMgmt->path, TD_DIRSEP);
...@@ -161,13 +163,16 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { ...@@ -161,13 +163,16 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
char *content = taosMemoryCalloc(1, maxLen + 1); char *content = taosMemoryCalloc(1, maxLen + 1);
if (content == NULL) { if (content == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY; terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1; ret = -1;
goto _OVER;
} }
len += snprintf(content + len, maxLen - len, "{\n"); len += snprintf(content + len, maxLen - len, "{\n");
len += snprintf(content + len, maxLen - len, " \"vnodes\": [\n"); len += snprintf(content + len, maxLen - len, " \"vnodes\": [\n");
for (int32_t i = 0; i < numOfVnodes; ++i) { for (int32_t i = 0; i < numOfVnodes; ++i) {
SVnodeObj *pVnode = pVnodes[i]; SVnodeObj *pVnode = pVnodes[i];
if (pVnode == NULL) continue;
len += snprintf(content + len, maxLen - len, " {\n"); len += snprintf(content + len, maxLen - len, " {\n");
len += snprintf(content + len, maxLen - len, " \"vgId\": %d,\n", pVnode->vgId); len += snprintf(content + len, maxLen - len, " \"vgId\": %d,\n", pVnode->vgId);
len += snprintf(content + len, maxLen - len, " \"dropped\": %d,\n", pVnode->dropped); len += snprintf(content + len, maxLen - len, " \"dropped\": %d,\n", pVnode->dropped);
...@@ -180,12 +185,13 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { ...@@ -180,12 +185,13 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
} }
len += snprintf(content + len, maxLen - len, " ]\n"); len += snprintf(content + len, maxLen - len, " ]\n");
len += snprintf(content + len, maxLen - len, "}\n"); len += snprintf(content + len, maxLen - len, "}\n");
terrno = 0;
_OVER:
taosWriteFile(pFile, content, len); taosWriteFile(pFile, content, len);
taosFsyncFile(pFile); taosFsyncFile(pFile);
taosCloseFile(&pFile); taosCloseFile(&pFile);
taosMemoryFree(content); taosMemoryFree(content);
terrno = 0;
for (int32_t i = 0; i < numOfVnodes; ++i) { for (int32_t i = 0; i < numOfVnodes; ++i) {
SVnodeObj *pVnode = pVnodes[i]; SVnodeObj *pVnode = pVnodes[i];
...@@ -196,6 +202,8 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) { ...@@ -196,6 +202,8 @@ int32_t vmWriteVnodeListToFile(SVnodeMgmt *pMgmt) {
taosMemoryFree(pVnodes); taosMemoryFree(pVnodes);
} }
if (ret != 0) return -1;
dDebug("successed to write %s, numOfVnodes:%d", realfile, numOfVnodes); dDebug("successed to write %s, numOfVnodes:%d", realfile, numOfVnodes);
return taosRenameFile(file, realfile); return taosRenameFile(file, realfile);
} }
\ No newline at end of file
...@@ -175,7 +175,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) { ...@@ -175,7 +175,7 @@ static void vmGenerateVnodeCfg(SCreateVnodeReq *pCreate, SVnodeCfg *pCfg) {
pCfg->hashSuffix = pCreate->hashSuffix; pCfg->hashSuffix = pCreate->hashSuffix;
pCfg->tsdbPageSize = pCreate->tsdbPageSize * 1024; pCfg->tsdbPageSize = pCreate->tsdbPageSize * 1024;
pCfg->standby = pCfg->standby; pCfg->standby = 0;
pCfg->syncCfg.myIndex = pCreate->selfIndex; pCfg->syncCfg.myIndex = pCreate->selfIndex;
pCfg->syncCfg.replicaNum = pCreate->replica; pCfg->syncCfg.replicaNum = pCreate->replica;
memset(&pCfg->syncCfg.nodeInfo, 0, sizeof(pCfg->syncCfg.nodeInfo)); memset(&pCfg->syncCfg.nodeInfo, 0, sizeof(pCfg->syncCfg.nodeInfo));
......
...@@ -58,11 +58,14 @@ int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) { ...@@ -58,11 +58,14 @@ int32_t vmOpenVnode(SVnodeMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl) {
if (pVnode->path == NULL) { if (pVnode->path == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY; terrno = TSDB_CODE_OUT_OF_MEMORY;
taosMemoryFree(pVnode);
return -1; return -1;
} }
if (vmAllocQueue(pMgmt, pVnode) != 0) { if (vmAllocQueue(pMgmt, pVnode) != 0) {
terrno = TSDB_CODE_OUT_OF_MEMORY; terrno = TSDB_CODE_OUT_OF_MEMORY;
taosMemoryFree(pVnode->path);
taosMemoryFree(pVnode);
return -1; return -1;
} }
...@@ -221,6 +224,7 @@ static void vmCloseVnodes(SVnodeMgmt *pMgmt) { ...@@ -221,6 +224,7 @@ static void vmCloseVnodes(SVnodeMgmt *pMgmt) {
SVnodeObj **ppVnodes = vmGetVnodeListFromHash(pMgmt, &numOfVnodes); SVnodeObj **ppVnodes = vmGetVnodeListFromHash(pMgmt, &numOfVnodes);
for (int32_t i = 0; i < numOfVnodes; ++i) { for (int32_t i = 0; i < numOfVnodes; ++i) {
if (ppVnodes == NULL || ppVnodes[i] == NULL) continue;
vmCloseVnode(pMgmt, ppVnodes[i]); vmCloseVnode(pMgmt, ppVnodes[i]);
} }
...@@ -380,7 +384,9 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) { ...@@ -380,7 +384,9 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) {
for (int32_t v = 0; v < numOfVnodes; ++v) { for (int32_t v = 0; v < numOfVnodes; ++v) {
int32_t t = v % threadNum; int32_t t = v % threadNum;
SVnodeThread *pThread = &threads[t]; SVnodeThread *pThread = &threads[t];
pThread->ppVnodes[pThread->vnodeNum++] = ppVnodes[v]; if (pThread->ppVnodes != NULL) {
pThread->ppVnodes[pThread->vnodeNum++] = ppVnodes[v];
}
} }
pMgmt->state.openVnodes = 0; pMgmt->state.openVnodes = 0;
...@@ -411,8 +417,8 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) { ...@@ -411,8 +417,8 @@ static int32_t vmStartVnodes(SVnodeMgmt *pMgmt) {
taosMemoryFree(threads); taosMemoryFree(threads);
for (int32_t i = 0; i < numOfVnodes; ++i) { for (int32_t i = 0; i < numOfVnodes; ++i) {
SVnodeObj *pVnode = ppVnodes[i]; if (ppVnodes == NULL || ppVnodes[i] == NULL) continue;
vmReleaseVnode(pMgmt, pVnode); vmReleaseVnode(pMgmt, ppVnodes[i]);
} }
if (ppVnodes != NULL) { if (ppVnodes != NULL) {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册