Skip to content

Commit 7f452f7

Browse files
committed
add show services from 2082
1 parent 3ce65fd commit 7f452f7

36 files changed

Lines changed: 780 additions & 98 deletions

src/UserGuide/Master/Table/Reference/System-Config-Manual_apache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,10 +1532,10 @@ The `iotdb-system.properties` file contains various configurations for managing
15321532
- slow_query_threshold
15331533

15341534
| Name | slow_query_threshold |
1535-
| ----------- | -------------------------------------- |
1535+
| ----------- |----------------------------------------|
15361536
| Description | Time cost(ms) threshold for slow query |
15371537
| Type | long |
1538-
| Default | 10000 |
1538+
| Default | 3000 |
15391539
| Effective | Hot reload |
15401540

15411541
- query_cost_stat_window

src/UserGuide/Master/Table/Reference/System-Config-Manual_timecho.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,10 +1533,10 @@ The `iotdb-system.properties` file contains various configurations for managing
15331533
- slow_query_threshold
15341534

15351535
| Name | slow_query_threshold |
1536-
| ----------- | -------------------------------------- |
1536+
| ----------- |----------------------------------------|
15371537
| Description | Time cost(ms) threshold for slow query |
15381538
| Type | long |
1539-
| Default | 10000 |
1539+
| Default | 3000 |
15401540
| Effective | Hot reload |
15411541

15421542
- query_cost_stat_window

src/UserGuide/Master/Table/Reference/System-Tables_apache.md

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ IoTDB> show tables from information_schema
5757
| queries| INF|
5858
|queries_costs_histogram| INF|
5959
| regions| INF|
60+
| services| INF|
6061
| subscriptions| INF|
6162
| tables| INF|
6263
| topics| INF|
@@ -66,7 +67,7 @@ IoTDB> show tables from information_schema
6667

6768
## 2. System Tables
6869

69-
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES` , `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM` (detailed descriptions in later sections)
70+
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES` , `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM`, `SERVICES` (detailed descriptions in later sections)
7071
***Operations**​: Read-only, only supports `SELECT`, `COUNT/SHOW DEVICES`, `DESC`. Any modifications to table structure or content are not allowed and will result in an error: `"The database 'information_schema' can only be queried." `
7172
***Column Names**​: System table column names are all lowercase by default and separated by underscores (`_`).
7273

@@ -343,7 +344,7 @@ IoTDB> select * from information_schema.topics
343344
+----------+----------------------------------------------------------------+
344345
```
345346

346-
### 2.10 VIEWS Table
347+
### 2.10 VIEWS
347348

348349
> This system table is available starting from version V2.0.5.
349350
@@ -369,9 +370,9 @@ IoTDB> select * from information_schema.views
369370
```
370371

371372

372-
### 2.11 MODELS Table
373+
### 2.11 MODELS
373374

374-
> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8.
375+
> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8-beta.
375376
376377
* Contains information about all models in the database.
377378
* The table structure is as follows:
@@ -402,7 +403,7 @@ IoTDB> select * from information_schema.models where model_type = 'BUILT_IN_FORE
402403
```
403404

404405

405-
### 2.12 FUNCTIONS Table
406+
### 2.12 FUNCTIONS
406407

407408
> This system table is available starting from version V2.0.5.
408409
@@ -434,7 +435,7 @@ IoTDB> select * from information_schema.functions where function_type='built-in
434435
```
435436

436437

437-
### 2.13 CONFIGURATIONS Table
438+
### 2.13 CONFIGURATIONS
438439

439440
> This system table is available starting from version V2.0.5.
440441
@@ -473,7 +474,7 @@ IoTDB> select * from information_schema.configurations
473474
```
474475

475476

476-
### 2.14 KEYWORDS Table
477+
### 2.14 KEYWORDS
477478

478479
> This system table is available starting from version V2.0.5.
479480
@@ -506,7 +507,7 @@ IoTDB> select * from information_schema.keywords limit 10
506507
```
507508

508509

509-
### 2.15 NODES Table
510+
### 2.15 NODES
510511

511512
> This system table is available starting from version V2.0.5.
512513
@@ -538,7 +539,7 @@ IoTDB> select * from information_schema.nodes
538539
```
539540

540541

541-
### 2.16 CONFIG\_NODES Table
542+
### 2.16 CONFIG\_NODES
542543

543544
> This system table is available starting from version V2.0.5.
544545
@@ -564,7 +565,7 @@ IoTDB> select * from information_schema.config_nodes
564565
```
565566

566567

567-
### 2.17 DATA\_NODES Table
568+
### 2.17 DATA\_NODES
568569

569570
> This system table is available starting from version V2.0.5.
570571
@@ -594,9 +595,9 @@ IoTDB> select * from information_schema.data_nodes
594595
+-------+---------------+-----------------+-----------+--------+--------+-------------------+---------------------+
595596
```
596597

597-
### 2.18 CONNECTIONS Table
598+
### 2.18 CONNECTIONS
598599

599-
> This system table is available starting from version V 2.0.8
600+
> This system table is available starting from version V 2.0.8-beta
600601
601602
* Contains all connections in the cluster.
602603
* The table structure is as follows:
@@ -621,9 +622,9 @@ IoTDB> select * from information_schema.connections;
621622
+-----------+-------+----------+---------+-----------------------------+---------+
622623
```
623624

624-
### 2.19 CURRENT_QUERIES Table
625+
### 2.19 CURRENT_QUERIES
625626

626-
> This system table is available starting from version V 2.0.8
627+
> This system table is available starting from version V 2.0.8-beta
627628
628629
* Contains all queries whose execution end time falls within the range `[now() - query_cost_stat_window, now())`, including currently executing queries. The `query_cost_stat_window` parameter represents the query cost statistics window. Its default value is 0 and can be configured via the `iotdb-system.properties` configuration file.
629630
* The table structure is as follows:
@@ -652,9 +653,9 @@ IoTDB> select * from information_schema.current_queries;
652653
+-----------------------+-------+-----------------------------+--------+-----------+---------+------------------------------------------------+----+---------+
653654
```
654655

655-
### 2.20 QUERIES_COSTS_HISTOGRAM Table
656+
### 2.20 QUERIES_COSTS_HISTOGRAM
656657

657-
> This system table is available starting from version V 2.0.8
658+
> This system table is available starting from version V 2.0.8-beta
658659
659660
* Contains a histogram of query execution times within the past `query_cost_stat_window` period (only statistics for completed SQL queries). The `query_cost_stat_window` parameter represents the query cost statistics window. Its default value is 0 and can be configured via the `iotdb-system.properties` configuration file.
660661
* The table structure is as follows:
@@ -686,6 +687,31 @@ IoTDB> select * from information_schema.queries_costs_histogram limit 10
686687
+------+----+-----------+
687688
```
688689

690+
### 2.21 SERVICES
691+
692+
> This system table is available starting from version V 2.0.8-beta
693+
694+
* Displays services (MQTT service, REST service) on all active DataNodes (with RUNNING or READ-ONLY status).
695+
* Table structure:
696+
697+
| Column Name | Data Type | Column Type | Description |
698+
|---------------|-----------|-------------|---------------------------------|
699+
| service_name | STRING | TAG | Service Name |
700+
| datanode_id | INT32 | ATTRIBUTE | DataNode ID where service runs |
701+
| state | STRING | ATTRIBUTE | Service status: RUNNING/STOPPED |
702+
703+
704+
* Query example:
705+
706+
```sql
707+
IoTDB> SELECT * FROM information_schema.services
708+
+------------+-----------+---------+
709+
|service_name|datanode_id|state |
710+
+------------+-----------+---------+
711+
|MQTT |1 |STOPPED |
712+
|REST |1 |RUNNING |
713+
+------------+-----------+---------+
714+
```
689715

690716
## 3. Permission Description
691717

src/UserGuide/Master/Table/Reference/System-Tables_timecho.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ IoTDB> show tables from information_schema
5757
| queries| INF|
5858
|queries_costs_histogram| INF|
5959
| regions| INF|
60+
| services| INF|
6061
| subscriptions| INF|
6162
| tables| INF|
6263
| topics| INF|
@@ -66,7 +67,7 @@ IoTDB> show tables from information_schema
6667

6768
## 2. System Tables
6869

69-
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES`, `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM` (detailed descriptions in later sections)
70+
***Names**​: `DATABASES`, `TABLES`, `REGIONS`, `QUERIES`, `COLUMNS`, `PIPES`, `PIPE_PLUGINS`, `SUBSCRIPTION`, `TOPICS`, `VIEWS`, `MODELS`, `FUNCTIONS`, `CONFIGURATIONS`, `KEYWORDS`, `NODES`, `CONFIG_NODES`, `DATA_NODES`, `CONNECTIONS`, `CURRENT_QUERIES`, `QUERIES_COSTS_HISTOGRAM`, `SERVICES` (detailed descriptions in later sections)
7071
***Operations**​: Read-only, only supports `SELECT`, `COUNT/SHOW DEVICES`, `DESC`. Any modifications to table structure or content are not allowed and will result in an error: `"The database 'information_schema' can only be queried." `
7172
***Column Names**​: System table column names are all lowercase by default and separated by underscores (`_`).
7273

@@ -343,7 +344,7 @@ IoTDB> select * from information_schema.topics
343344
+----------+----------------------------------------------------------------+
344345
```
345346

346-
### 2.10 VIEWS Table
347+
### 2.10 VIEWS
347348

348349
> This system table is available starting from version V2.0.5.
349350
@@ -369,7 +370,7 @@ IoTDB> select * from information_schema.views
369370
```
370371

371372

372-
### 2.11 MODELS Table
373+
### 2.11 MODELS
373374

374375
> This system table is available starting from version V 2.0.5 and has been discontinued since version V 2.0.8.
375376
@@ -402,7 +403,7 @@ IoTDB> select * from information_schema.models where model_type = 'BUILT_IN_FORE
402403
```
403404

404405

405-
### 2.12 FUNCTIONS Table
406+
### 2.12 FUNCTIONS
406407

407408
> This system table is available starting from version V2.0.5.
408409
@@ -434,7 +435,7 @@ IoTDB> select * from information_schema.functions where function_type='built-in
434435
```
435436

436437

437-
### 2.13 CONFIGURATIONS Table
438+
### 2.13 CONFIGURATIONS
438439

439440
> This system table is available starting from version V2.0.5.
440441
@@ -473,7 +474,7 @@ IoTDB> select * from information_schema.configurations
473474
```
474475

475476

476-
### 2.14 KEYWORDS Table
477+
### 2.14 KEYWORDS
477478

478479
> This system table is available starting from version V2.0.5.
479480
@@ -506,7 +507,7 @@ IoTDB> select * from information_schema.keywords limit 10
506507
```
507508

508509

509-
### 2.15 NODES Table
510+
### 2.15 NODES
510511

511512
> This system table is available starting from version V2.0.5.
512513
@@ -538,7 +539,7 @@ IoTDB> select * from information_schema.nodes
538539
```
539540

540541

541-
### 2.16 CONFIG\_NODES Table
542+
### 2.16 CONFIG\_NODES
542543

543544
> This system table is available starting from version V2.0.5.
544545
@@ -564,7 +565,7 @@ IoTDB> select * from information_schema.config_nodes
564565
```
565566

566567

567-
### 2.17 DATA\_NODES Table
568+
### 2.17 DATA\_NODES
568569

569570
> This system table is available starting from version V2.0.5.
570571
@@ -594,7 +595,7 @@ IoTDB> select * from information_schema.data_nodes
594595
+-------+---------------+-----------------+-----------+--------+--------+-------------------+---------------------+
595596
```
596597

597-
### 2.18 CONNECTIONS Table
598+
### 2.18 CONNECTIONS
598599

599600
> This system table is available starting from version V 2.0.8
600601
@@ -621,7 +622,7 @@ IoTDB> select * from information_schema.connections;
621622
+-----------+-------+----------+---------+-----------------------------+---------+
622623
```
623624

624-
### 2.19 CURRENT_QUERIES Table
625+
### 2.19 CURRENT_QUERIES
625626

626627
> This system table is available starting from version V 2.0.8
627628
@@ -652,7 +653,7 @@ IoTDB> select * from information_schema.current_queries;
652653
+-----------------------+-------+-----------------------------+--------+-----------+---------+------------------------------------------------+----+---------+
653654
```
654655

655-
### 2.20 QUERIES_COSTS_HISTOGRAM Table
656+
### 2.20 QUERIES_COSTS_HISTOGRAM
656657

657658
> This system table is available starting from version V 2.0.8
658659
@@ -686,6 +687,32 @@ IoTDB> select * from information_schema.queries_costs_histogram limit 10
686687
+------+----+-----------+
687688
```
688689

690+
### 2.21 SERVICES
691+
692+
> This system table is available starting from version V 2.0.8
693+
694+
* Displays services (MQTT service, REST service) on all active DataNodes (with RUNNING or READ-ONLY status).
695+
* Table structure:
696+
697+
| Column Name | Data Type | Column Type | Description |
698+
|---------------|-----------|-------------|---------------------------------|
699+
| service_name | STRING | TAG | Service Name |
700+
| datanode_id | INT32 | ATTRIBUTE | DataNode ID where service runs |
701+
| state | STRING | ATTRIBUTE | Service status: RUNNING/STOPPED |
702+
703+
704+
* Query example:
705+
706+
```sql
707+
IoTDB> SELECT * FROM information_schema.services
708+
+------------+-----------+---------+
709+
|service_name|datanode_id|state |
710+
+------------+-----------+---------+
711+
|MQTT |1 |STOPPED |
712+
|REST |1 |RUNNING |
713+
+------------+-----------+---------+
714+
```
715+
689716

690717
## 3. Permission Description
691718

src/UserGuide/Master/Table/User-Manual/Maintenance-commands_apache.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ IoTDB> SHOW REGIONS
341341

342342
**Description**: Returns the RPC addresses and ports of all available DataNodes in the current cluster. Note: A DataNode is considered "available" if it is not in the REMOVING state.
343343

344-
> This feature is supported starting from v2.0.8.
344+
> This feature is supported starting from v2.0.8-beta.
345345
346346
**Syntax**:
347347

@@ -367,6 +367,34 @@ IoTDB> SHOW AVAILABLE URLS
367367
+----------+-------+
368368
```
369369

370+
### 1.11 View Service Information
371+
372+
**Description**: Returns service information (MQTT service, REST service) on all active DataNodes (in RUNNING or READ-ONLY state) in the current cluster.
373+
374+
> Supported since V2.0.8-beta
375+
376+
#### Syntax:
377+
```sql
378+
showServicesStatement
379+
: SHOW SERVICES <ON dataNodeId>
380+
;
381+
```
382+
383+
#### Examples:
384+
```sql
385+
IoTDB> SHOW SERVICES
386+
IoTDB> SHOW SERVICES ON 1
387+
```
388+
389+
Execution result:
390+
```sql
391+
+--------------+-------------+---------+
392+
| Service Name | DataNode ID | State |
393+
+--------------+-------------+---------+
394+
| MQTT | 1 | STOPPED |
395+
| REST | 1 | RUNNING |
396+
+--------------+-------------+---------+
397+
```
370398

371399
## 2. Status Setting
372400

0 commit comments

Comments
 (0)