Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc]update trash statement #1953

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
{
"title": "CLEAN TRASH",
"language": "en"
"title": "ADMIN CLEAN TRASH",
"language": "en"
}


---

<!--
Expand All @@ -26,29 +25,41 @@ specific language governing permissions and limitations
under the License.
-->


## Description

This statement is used to clean up garbage data in the backend
This statement is used to clear garbage data in backend.

grammar:
## Syntax

```sql
ADMIN CLEAN TRASH [ON ("BackendHost1:BackendHeartBeatPort1", "BackendHost2:BackendHeartBeatPort2", ...)];
ADMIN CLEAN TRASH [ON ("<be_host>:<be_heartbeat_port>" [, ...])]
```

illustrate:
## Optional Parameters

**1. `[ON ("<be_host>:<be_heartbeat_port>" [, ...])]`**

Specify the backend to be cleaned up. If you do not add ON, all backend is cleared by default.


1. Use BackendHost:BackendHeartBeatPort to indicate the backend that needs to be cleaned up, and clean up all backends without adding the on limit.
## Access Control Requirements

## Example
Users executing this SQL command must have at least the following privileges:

1. Clean up the junk data of all be nodes.

ADMIN CLEAN TRASH;
| Privilege | Object | Notes |
| :--------- | :----- | :------------------------------------------- |
| ADMIN_PRIV | User or Role | Only users or roles with the ADMIN_PRIV privilege can perform the CLEAN TRASH operation. |

2. Clean up the junk data of '192.168.0.1:9050' and '192.168.0.2:9050'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺少权限章节


ADMIN CLEAN TRASH ON ("192.168.0.1:9050","192.168.0.2:9050");
## Examples

## Keywords
```sql
-- Clean up the junk data of all be nodes.
ADMIN CLEAN TRASH;
```

```sql
-- Clean up garbage data for '192.168.0.1:9050' and '192.168.0.2:9050'.
ADMIN CLEAN TRASH ON ("192.168.0.1:9050", "192.168.0.2:9050");
```
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---
{
"title": "SHOW TRASH",
"language": "en"
"title": "SHOW TRASH",
"language": "en"
}

---

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Expand All @@ -28,35 +29,43 @@ under the License.

## Description

This statement is used to view the garbage data footprint within the backend.
This statement is used to view the space occupied by garbage data in backend.

grammar:
## Syntax

```sql
SHOW TRASH [ON BackendHost:BackendHeartBeatPort];
SHOW TRASH [ON ("<be_host>:<be_heartbeat_port>" [, ...])];
```

illustrate:
## Optional Parameters

**1. `[ON ("<be_host>:<be_heartbeat_port>" [, ...])]`**

Specify the backend that you want to view. If you do not add ON, all backend is displayed by default.


## Access Control Requirements

1. The Backend format is the node's BackendHost:BackendHeartBeatPort
2. TrashUsedCapacity indicates the space occupied by the garbage data of the node.
Users executing this SQL command must have at least the following privileges:

## Example

1. View the space occupied by garbage data of all be nodes.
| Privilege | Object | Notes |
| :--------- | :----- | :------------------------------------------- |
| ADMIN_PRIV or NODE_PRIV | User or Role | Only users or roles with the ADMIN_PRIV or NODE_PRIV privilege can perform the SHOW TRASH operation. |

```sql
SHOW TRASH;
```

2. View the space occupied by garbage data of '192.168.0.1:9050' (specific disk information will be displayed).
## Examples

```sql
SHOW TRASH ON "192.168.0.1:9050";
```
1. View the garbage data usage of all be nodes.

## Keywords

SHOW, TRASH
```sql
SHOW TRASH;
```

2. View the junk data usage of '192.168.0.1:9050' (disk information is displayed).

## Best Practice

```sql
SHOW TRASH ON "192.168.0.1:9050";
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
{
"title": "CLEAN TRASH",
"title": "ADMIN CLEAN TRASH",
"language": "zh-CN"
}

Expand All @@ -25,37 +25,40 @@ specific language governing permissions and limitations
under the License.
-->





## 描述

该语句用于清理 backend 内的垃圾数据
该语句用于清理 backend 内的垃圾数据

语法:
## 语法

```sql
ADMIN CLEAN TRASH [ON ("BackendHost1:BackendHeartBeatPort1", "BackendHost2:BackendHeartBeatPort2", ...)];
ADMIN CLEAN TRASH [ON ("<be_host>:<be_heartbeat_port>" [, ...])];
```

说明:
## 可选参数

1. 以 BackendHost:BackendHeartBeatPort 表示需要清理的 backend,不添加 on 限定则清理所有 backend。
**1. `[ON ("<be_host>:<be_heartbeat_port>" [, ...])]`**

## 示例
指定需要清理的 backend。如果不加 ON,默认清理所有 backend。

1. 清理所有 be 节点的垃圾数据。
## 权限控制

ADMIN CLEAN TRASH;
执行此 SQL 命令的用户必须至少具有以下权限:

2. 清理'192.168.0.1:9050'和'192.168.0.2:9050'的垃圾数据。

ADMIN CLEAN TRASH ON ("192.168.0.1:9050","192.168.0.2:9050");
| 权限(Privilege) | 对象(Object) | 说明(Notes) |
| :--------- | :----- | :------------------------------------------- |
| ADMIN_PRIV | 用户(User)或 角色(Role) | 用户或者角色拥有 ADMIN_PRIV 权限才能进行CLEAN TRASH操作 |

## 关键词

ADMIN, CLEAN, TRASH
## 示例

### 最佳实践
```sql
-- 清理所有be节点的垃圾数据。
ADMIN CLEAN TRASH;
```

```sql
-- 清理'192.168.0.1:9050'和'192.168.0.2:9050'的垃圾数据。
ADMIN CLEAN TRASH ON ("192.168.0.1:9050", "192.168.0.2:9050");
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
{
"title": "SHOW TRASH",
"language": "zh-CN"
"title": "SHOW TRASH",
"language": "zh-CN"
}

---
Expand All @@ -27,39 +27,43 @@ under the License.




## 描述

该语句用于查看 backend 内的垃圾数据占用空间。

语法:
## 语法:

```sql
SHOW TRASH [ON BackendHost:BackendHeartBeatPort];
SHOW TRASH [ON ("<be_host>:<be_heartbeat_port>" [, ...])];
```

说明:
## 可选参数

1. Backend 格式为该节点的 BackendHost:BackendHeartBeatPort
2. TrashUsedCapacity 表示该节点垃圾数据占用空间。
**1. `[ON ("<be_host>:<be_heartbeat_port>" [, ...])]`**

## 示例
指定需要查看的 backend。如果不加 ON,默认查看所有 backend。

1. 查看所有 be 节点的垃圾数据占用空间。

```sql
SHOW TRASH;
```
## 权限控制

2. 查看'192.168.0.1:9050'的垃圾数据占用空间 (会显示具体磁盘信息)。
执行此 SQL 命令的用户必须至少具有以下权限:

```sql
SHOW TRASH ON "192.168.0.1:9050";
```
| 权限(Privilege) | 对象(Object) | 说明(Notes) |
| :--------- | :----- | :------------------------------------------- |
| ADMIN_PRIV 或 NODE_PRIV | 用户(User)或 角色(Role) | 用户或者角色拥有 ADMIN_PRIV 或 NODE_PRIV 权限才能进行SHOW TRASH操作 |

## 关键词
## 示例

SHOW, TRASH
1. 查看所有 be 节点的垃圾数据占用空间。

### 最佳实践

```sql
SHOW TRASH;
```

2. 查看'192.168.0.1:9050'的垃圾数据占用空间 (会显示具体磁盘信息)。


```sql
SHOW TRASH ON "192.168.0.1:9050";
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
{
"title": "ADMIN-CLEAN-TRASH",
"language": "zh-CN"
"title": "ADMIN CLEAN TRASH",
"language": "zh-CN"
}

---
Expand All @@ -25,39 +25,40 @@ specific language governing permissions and limitations
under the License.
-->

## ADMIN-CLEAN-TRASH

### Name

ADMIN CLEAN TRASH

## 描述

该语句用于清理 backend 内的垃圾数据
该语句用于清理 backend 内的垃圾数据

语法:
## 语法

```sql
ADMIN CLEAN TRASH [ON ("BackendHost1:BackendHeartBeatPort1", "BackendHost2:BackendHeartBeatPort2", ...)];
ADMIN CLEAN TRASH [ON ("<be_host>:<be_heartbeat_port>" [, ...])];
```

说明:
## 可选参数

1. 以 BackendHost:BackendHeartBeatPort 表示需要清理的 backend ,不添加on限定则清理所有 backend 。
**1. `[ON ("<be_host>:<be_heartbeat_port>" [, ...])]`**

## 举例
指定需要清理的 backend。如果不加 ON,默认清理所有 backend。

1. 清理所有be节点的垃圾数据。
## 权限控制

ADMIN CLEAN TRASH;
执行此 SQL 命令的用户必须至少具有以下权限:

2. 清理'192.168.0.1:9050'和'192.168.0.2:9050'的垃圾数据。

ADMIN CLEAN TRASH ON ("192.168.0.1:9050","192.168.0.2:9050");
| 权限(Privilege) | 对象(Object) | 说明(Notes) |
| :--------- | :----- | :------------------------------------------- |
| ADMIN_PRIV | 用户(User)或 角色(Role) | 用户或者角色拥有 ADMIN_PRIV 权限才能进行CLEAN TRASH操作 |

### Keywords

ADMIN, CLEAN, TRASH
## 示例

### Best Practice
```sql
-- 清理所有be节点的垃圾数据。
ADMIN CLEAN TRASH;
```

```sql
-- 清理'192.168.0.1:9050'和'192.168.0.2:9050'的垃圾数据。
ADMIN CLEAN TRASH ON ("192.168.0.1:9050", "192.168.0.2:9050");
```
Loading
Loading