Skip to content

Commit d378f3b

Browse files
authored
update user-guide and grant ttl operation to SET_STORAGE_GROUP privilege (apache#7046)
update user-guide and grant ttl operation to SET_STORAGE_GROUP privilege
1 parent 4f9db18 commit d378f3b

File tree

3 files changed

+3
-104
lines changed

3 files changed

+3
-104
lines changed

docs/UserGuide/Administration-Management/Administration.md

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ At the same time, changes to roles are immediately reflected on all users who ow
367367

368368
|privilege Name|Interpretation|Example|
369369
|:---|:---|----|
370-
|SET\_STORAGE\_GROUP|set storage groups; path dependent|Eg: `set storage group to root.ln;`|
370+
|SET\_STORAGE\_GROUP|set storage groups; set/unset storage group ttl; path dependent|Eg1: `set storage group to root.ln;`<br />Eg2:`set ttl to root.ln 3600000;`<br />Eg3:`unset ttl to root.ln;`|
371371
|DELETE\_STORAGE\_GROUP|delete storage groups; path dependent|Eg: `delete storage group root.ln;`|
372372
|CREATE\_TIMESERIES|create timeseries; path dependent|Eg1: create timeseries<br />`create timeseries root.ln.wf02.status with datatype=BOOLEAN,encoding=PLAIN;`<br />Eg2: create aligned timeseries<br />`create aligned timeseries root.ln.device1(latitude FLOAT encoding=PLAIN compressor=SNAPPY, longitude FLOAT encoding=PLAIN compressor=SNAPPY);`|
373373
|INSERT\_TIMESERIES|insert data; path dependent|Eg1: `insert into root.ln.wf02(timestamp,status) values(1,true);`<br />Eg2: `insert into root.sg1.d1(time, s1, s2) aligned values(1, 1, 1)`|
@@ -445,46 +445,6 @@ In distributed related permission operations, when changing permissions other th
445445

446446
At present, the following SQL statements supported by iotdb can only be operated by the `root` user, and no corresponding permission can be given to the new user.
447447

448-
###### TTL
449-
450-
- set ttl
451-
452-
```
453-
Eg: IoTDB > set ttl to root.ln 3600
454-
```
455-
456-
- unset ttl
457-
458-
```
459-
Eg: IoTDB > unset ttl to root.ln
460-
```
461-
462-
###### Schema Template
463-
464-
- Create Schema Template
465-
466-
```
467-
Eg: IoTDB > create schema template t1 (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
468-
```
469-
470-
- Set Schema Template
471-
472-
```
473-
Eg: IoTDB > set schema template t1 to root.sg1.d1
474-
```
475-
476-
- Uset Schema Template
477-
478-
```
479-
Eg: IoTDB > unset schema template t1 from root.sg1.d1
480-
```
481-
482-
- Drop Schema Template
483-
484-
```
485-
Eg: IoTDB > drop schema template t1
486-
```
487-
488448
###### TsFile Management
489449

490450
- Load TsFiles
@@ -505,17 +465,6 @@ Eg: IoTDB > remove '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-
505465
Eg: IoTDB > unload '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-0.tsfile' '/data/data/tmp'
506466
```
507467

508-
###### Count
509-
510-
- Count storage group/Number of nodes/device/timeseries
511-
512-
```
513-
Eg: IoTDB > count storage group
514-
Eg: IoTDB > count nodes root.** LEVEL=2
515-
Eg: IoTDB > count devices root.ln.**
516-
Eg: IoTDB > count timeseries root.**
517-
```
518-
519468
###### Delete Time Partition (experimental)
520469

521470
- Delete Time Partition (experimental)

docs/zh/UserGuide/Administration-Management/Administration.md

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ Eg: IoTDB > ALTER USER `tempuser` SET PASSWORD 'newpwd';
366366

367367
|权限名称|说明|示例|
368368
|:---|:---|----|
369-
|SET\_STORAGE\_GROUP|创建存储组。包含设置存储组的权限。路径相关|Eg: `set storage group to root.ln;`|
369+
|SET\_STORAGE\_GROUP|创建存储组。包含设置存储组的权限和TTL。路径相关|Eg1: `set storage group to root.ln;`<br />Eg2:`set ttl to root.ln 3600000;`<br />Eg3:`unset ttl to root.ln;`|
370370
|DELETE\_STORAGE\_GROUP|删除存储组。路径相关|Eg: `delete storage group root.ln;`|
371371
|CREATE\_TIMESERIES|创建时间序列。路径相关|Eg1: 创建时间序列<br />`create timeseries root.ln.wf02.status with datatype=BOOLEAN,encoding=PLAIN;`<br />Eg2: 创建对齐时间序列<br />`create aligned timeseries root.ln.device1(latitude FLOAT encoding=PLAIN compressor=SNAPPY, longitude FLOAT encoding=PLAIN compressor=SNAPPY);`|
372372
|INSERT\_TIMESERIES|插入数据。路径相关|Eg1: `insert into root.ln.wf02(timestamp,status) values(1,true);`<br />Eg2: `insert into root.sg1.d1(time, s1, s2) aligned values(1, 1, 1)`|
@@ -441,46 +441,6 @@ IoTDB 规定角色名的字符长度不小于 4,其中角色名不能包含空
441441

442442
目前以下IoTDB支持的sql语句只有`root`用户可以进行操作,且没有对应的权限可以赋予新用户。
443443

444-
###### TTL
445-
446-
- 设置ttl
447-
448-
```
449-
Eg: IoTDB > set ttl to root.ln 3600
450-
```
451-
452-
- 取消ttl
453-
454-
```
455-
Eg: IoTDB > unset ttl to root.ln
456-
```
457-
458-
###### 元数据模板
459-
460-
- 创建元数据模板
461-
462-
```
463-
Eg: IoTDB > create schema template t1 (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)
464-
```
465-
466-
- 挂载元数据模板
467-
468-
```
469-
Eg: IoTDB > set schema template t1 to root.sg1.d1
470-
```
471-
472-
- 卸载元数据模板
473-
474-
```
475-
Eg: IoTDB > unset schema template t1 from root.sg1.d1
476-
```
477-
478-
- 删除元数据模板
479-
480-
```
481-
Eg: IoTDB > drop schema template t1
482-
```
483-
484444
###### TsFile管理
485445

486446
- 加载TsFile
@@ -501,17 +461,6 @@ Eg: IoTDB > remove '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-
501461
Eg: IoTDB > unload '/Users/Desktop/data/data/root.vehicle/0/0/1575028885956-101-0.tsfile' '/data/data/tmp'
502462
```
503463

504-
###### 统计
505-
506-
- 统计存储组/节点数/设备/时间序列
507-
508-
```
509-
Eg: IoTDB > count storage group
510-
Eg: IoTDB > count nodes root.** LEVEL=2
511-
Eg: IoTDB > count devices root.ln.**
512-
Eg: IoTDB > count timeseries root.**
513-
```
514-
515464
###### 删除时间分区(实验性功能)
516465

517466
- 删除时间分区(实验性功能)

server/src/main/java/org/apache/iotdb/db/auth/AuthorityChecker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ private static int translateToPermissionId(StatementType type) {
292292
case REVOKE_USER_ROLE:
293293
return PrivilegeType.REVOKE_USER_ROLE.ordinal();
294294
case SET_STORAGE_GROUP:
295+
case TTL:
295296
return PrivilegeType.SET_STORAGE_GROUP.ordinal();
296297
case DELETE_STORAGE_GROUP:
297298
return PrivilegeType.DELETE_STORAGE_GROUP.ordinal();

0 commit comments

Comments
 (0)