diff --git a/.gitignore b/.gitignore
index 8dfae65409..9b4d8dd3e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ output
docs/.temp
docs/.vuepress/dist
docs/node_modules
+docs/build/
gensrc/build
fe/target
thirdparty/src
diff --git a/docs/en/extending-doris/audit-plugin.md b/docs/en/extending-doris/audit-plugin.md
index bbc391c953..651159d2ce 100644
--- a/docs/en/extending-doris/audit-plugin.md
+++ b/docs/en/extending-doris/audit-plugin.md
@@ -32,27 +32,23 @@ This plugin can periodically import the FE audit log into the specified Doris cl
## Compile, Configure and Deploy
+### FE Configuration
+
+FE's plugin framework is an experimental feature, which is closed by default. In the FE configuration file, add `plugin_enable = true` to enable the plugin framework.
+
+### AuditLoader Configuration
+
+The configuration of the auditloader plugin is located in `$ {DORIS}/fe_plugins/auditloader/src/main/assembly/`.
+
+Open `plugin.conf` for configuration. See the comments of the configuration items.
+
### Compile
After executing `sh build_plugin.sh` in the Doris code directory, you will get the `auditloader.zip` file in the `fe_plugins/output` directory.
-### Configuration
-
-Unzip `auditloader.zip` and you will see three files:
-
-```
-auditloader.jar
-plugin.properties
-plugin.conf
-```
-
-Open `plugin.conf` for configuration. See the comments of the configuration items.
-
-After the configuration is complete, repackage the three files as `auditloader.zip`.
-
### Deployment
-You can place this file on an http download server or copy it to the specified directory of all FEs. Here we use the latter.
+You can place this file on an http download server or copy(or unzip) it to the specified directory of all FEs. Here we use the latter.
### Installation
diff --git a/docs/en/extending-doris/plugin-development-manual.md b/docs/en/extending-doris/plugin-development-manual.md
index 5d8da3ef2a..9ca4a920f7 100644
--- a/docs/en/extending-doris/plugin-development-manual.md
+++ b/docs/en/extending-doris/plugin-development-manual.md
@@ -24,14 +24,23 @@ specific language governing permissions and limitations
under the License.
-->
-# Plugin Development Manual
+# Doris Plugin Framework
## Introduction
-Doris supports dynamic loading of plug-ins. Users can develop their own plug-ins to implement some extended functions. This manual mainly introduces the development, compilation and deployment methods of Frontend-side plug-ins.
+Doris plugin framework supports install/uninstall custom plugins at runtime without restart the Doris service. Users can extend Doris's functionality by developing their own plugins.
+For example, the audit plugin worked after a request execution, it can obtain information related to a request (access user, request IP, SQL, etc...) and write the information into the specified table.
-`fe_plugins` is the parent module of the fe plugins. It can uniformly manage the third-party library information that the plugin depends on. Adding a plugin can add a submodule implementation under `fe_plugins`.
+Differences from UDF:
+* UDF is a function used for data calculation when SQL is executed. Plugin is additional function that is used to extend Doris with customized function, such as support different storage engines and different import ways, and plugin does't participate in data calculation when executing SQL.
+* The execution cycle of UDF is limited to a SQL execution. The execution cycle of plugin may be the same as the Doris process.
+* The usage scene is different. If you need to support special data algorithms when executing SQL, then UDF is recommended, if you need to run custom functions on Doris, or start a background thread to do tasks, then the use of plugin is recommended.
+
+Currently the plugin framework only supports audit plugins.
+
+> Note:
+> Doris plugin framework is an experimental feature, currently only supports FE plugin, and is closed by default, can be opened by FE configuration `plugin_enable = true`.
## Plugin
@@ -92,6 +101,8 @@ soName = example.so
The development environment of the FE plugin depends on the development environment of Doris. So please make sure Doris's compilation and development environment works normally.
+`fe_plugins` is the parent module of the fe plugins. It can uniformly manage the third-party library information that the plugin depends on. Adding a plugin can add a submodule implementation under `fe_plugins`.
+
### Create module
We can add a submodule in the `fe_plugins` directory to implement Plugin and create a project:
@@ -195,6 +206,7 @@ Then we need to update `pom.xml`, add doris-fe dependency, and modify maven pack
jar
+
org.apache
doris-fe
@@ -237,7 +249,7 @@ Then we need to update `pom.xml`, add doris-fe dependency, and modify maven pack
### Implement plugin
-Then we can happily implement Plugin according to the needs. Plugins need to implement the `Plugin` interface. For details, please refer to the `auditdemo` plugin sample code that comes with Doris.
+Then we can implement Plugin according to the needs. Plugins need to implement the `Plugin` interface. For details, please refer to the `auditdemo` plugin sample code that comes with Doris.
### Compile
@@ -266,7 +278,7 @@ Note: Need to ensure that the plugin .zip file is available in the life cycle of
Install and uninstall the plugin through the install/uninstall statements. More details, see `HELP INSTALL PLUGIN;` `HELP IUNNSTALL PLUGIN;` `HELP SHOW PLUGINS;`
```
-mysql> install plugin from "/home/users/seaven/auditdemo.zip";
+mysql> install plugin from "/home/users/doris/auditloader.zip";
Query OK, 0 rows affected (0.09 sec)
mysql> mysql> show plugins\G
@@ -278,7 +290,7 @@ Description: load audit log to olap load, and user can view the statistic of que
JavaVersion: 1.8.31
ClassName: AuditLoaderPlugin
SoName: NULL
- Sources: /home/cmy/git/doris/core/fe_plugins/output/auditloader.zip
+ Sources: /home/users/doris/auditloader.zip
Status: INSTALLED
*************************** 2. row ***************************
Name: AuditLogBuilder
diff --git a/docs/en/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md b/docs/en/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md
index 5ad1886105..5e2bd9a721 100644
--- a/docs/en/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md
+++ b/docs/en/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md
@@ -43,11 +43,11 @@ under the License.
1. Intall a plugin with a local zip file:
- INSTALL PLUGIN FROM "/home/users/seaven/auditdemo.zip";
+ INSTALL PLUGIN FROM "/home/users/doris/auditdemo.zip";
2. Intall a plugin with a local dir:
- INSTALL PLUGIN FROM "/home/users/seaven/auditdemo/";
+ INSTALL PLUGIN FROM "/home/users/doris/auditdemo/";
2. Download and install a plugin:
diff --git a/docs/zh-CN/extending-doris/audit-plugin.md b/docs/zh-CN/extending-doris/audit-plugin.md
index 326cb69b7a..4953f145d3 100644
--- a/docs/zh-CN/extending-doris/audit-plugin.md
+++ b/docs/zh-CN/extending-doris/audit-plugin.md
@@ -32,27 +32,23 @@ Doris 的审计日志插件是在 FE 的插件框架基础上开发的。是一
## 编译、配置和部署
+### FE 配置
+
+FE的插件框架当前是实验性功能,Droris中默认关闭,在FE的配置文件中,增加`plugin_enable = true`启用plugin框架
+
+### AuditLoader 配置
+
+auditloader plugin的配置位于`${DORIS}/fe_plugins/auditloader/src/main/assembly/`.
+
+打开 `plugin.conf` 进行配置。配置项说明参见注释。
+
### 编译
在 Doris 代码目录下执行 `sh build_plugin.sh` 后,会在 `fe_plugins/output` 目录下得到 `auditloader.zip` 文件。
-### 配置
-
-解压 `auditloader.zip` 可以看到三个文件:
-
-```
-auditloader.jar
-plugin.properties
-plugin.conf
-```
-
-打开 `plugin.conf` 进行配置。配置项说明参见注释。
-
-配置完成后,重新将三个文件打包为 `auditloader.zip`.
-
### 部署
-您可以将这个文件放置在一个 http 下载服务器上,或者拷贝到所有 FE 的指定目录下。这里我们使用后者。
+您可以将这个文件放置在一个 http 服务器上,或者拷贝`auditloader.zip`(或者解压`auditloader.zip`)到所有 FE 的指定目录下。这里我们使用后者。
### 安装
diff --git a/docs/zh-CN/extending-doris/plugin-development-manual.md b/docs/zh-CN/extending-doris/plugin-development-manual.md
index 76f56ea1c7..85c8237220 100644
--- a/docs/zh-CN/extending-doris/plugin-development-manual.md
+++ b/docs/zh-CN/extending-doris/plugin-development-manual.md
@@ -24,15 +24,25 @@ specific language governing permissions and limitations
under the License.
-->
-# 插件开发手册
+# Doris 插件框架
## 介绍
-Doris 支持动态加载插件。用户可以通过开发自己的插件来扩展Doris的功能。这个手册主要介绍如何开发、编译和部署 Frontend 端的插件。
+Doris 的插件框架支持在运行时添加/卸载自定义插件,而不需要重启服务,用户可以通过开发自己的插件来扩展Doris的功能。
-`fe_plugins` 目录是 FE 插件的根模块。这个根模块统一管理插件所需的依赖。添加一个新的插件,相当于在这个根模块添加一个子模块。
+例如,审计插件作用于 Doris 请求执行后,可以获取到一次请求相关的信息(访问用户,请求IP,SQL等...),并将信息写入到指定的表中。
-## 插件组成
+与UDF的区别:
+* UDF是函数,用于在SQL执行时进行数据计算。插件是附加功能,用于为Doris扩展自定义的功能,例如:支持不同的存储引擎,支持不同的导入方式,插件并不会参与执行SQL时的数据计算。
+* UDF的执行周期仅限于一次SQL执行。插件的执行周期可能与Doris进程相同。
+* 使用场景不同。如果您需要执行SQL时支持特殊的数据算法,那么推荐使用UDF,如果您需要在Doris上运行自定义的功能,或者是启动一个后台线程执行任务,那么推荐使用插件。
+
+目前插件框架仅支持审计类插件。
+
+> 注意:
+> Doris的插件框架是实验性功能, 目前只支持FE插件,且默认是关闭的,可以通过FE配置`plugin_enable=true`打开
+
+## 插件
一个FE的插件可以使一个**zip压缩包**或者是一个**目录**。其内容至少包含两个文件:`plugin.properties` 和 `.jar` 文件。`plugin.properties`用于描述插件信息。
@@ -87,11 +97,13 @@ classname = AuditPluginDemo
soName = example.so
```
-## 编写一个插件
+## 编写插件
-插件的开发环境依赖Doris的开发编译环境。所以请先确保Doris的编译开发环境运行正常。
+插件的开发环境依赖Doris的开发编译环境。所以请先确保Doris的开发编译环境运行正常。
-### 创建一个模块
+`fe_plugins` 目录是 FE 插件的根模块。这个根模块统一管理插件所需的依赖。添加一个新的插件,相当于在这个根模块添加一个子模块。
+
+### 创建插件模块
我们可以通过以下命令在 `fe_plugins` 目录创建一个子模块用户实现创建和创建工程。其中 `doris-fe-test` 为插件名称。
@@ -193,6 +205,7 @@ mvn archetype: generate -DarchetypeCatalog = internal -DgroupId = org.apache -Da
jar
+
org.apache
doris-fe
@@ -235,7 +248,7 @@ mvn archetype: generate -DarchetypeCatalog = internal -DgroupId = org.apache -Da
### 实现插件
-之后我们就可以开始愉快的进行插件功能的开发啦。插件需要实现 `Plugin` 接口。具体可以参阅 Doris 自带的 `auditdemo` 插件示例代码。
+之后我们就可以开始进行插件功能的开发了。插件需要实现 `Plugin` 接口。具体可以参阅 Doris 自带的 `auditdemo` 插件示例代码。
### 编译
@@ -255,7 +268,7 @@ mvn archetype: generate -DarchetypeCatalog = internal -DgroupId = org.apache -Da
* 将 `.zip` 文件放在 Http 或 Https 服务器上。如:`http://xxx.xxxxxx.com/data/plugin.zip`, Doris 会下载这个文件。
* 本地 `.zip` 文件。 如:`/home/work/data/plugin.zip`。需要在所有 FE 和 BE 节点部署。
-* 本地目录。如:`/home/work/data/plugin/`。这个相当于 `.zip` 文件解压后的目录。需要在所有 FE 和 BE 节点部署。
+* 本地目录。如:`/home/work/data/plugin/`。相当于 `.zip` 文件解压后的目录。需要在所有 FE 和 BE 节点部署。
注意:需保证部署路径在整个插件生命周期内有效。
@@ -264,7 +277,7 @@ mvn archetype: generate -DarchetypeCatalog = internal -DgroupId = org.apache -Da
通过如下命令安装和卸载插件。更多帮助请参阅 `HELP INSTALL PLUGIN;` `HELP IUNNSTALL PLUGIN;` `HELP SHOW PLUGINS;`
```
-mysql> install plugin from "/home/users/seaven/auditdemo.zip";
+mysql> install plugin from "/home/users/doris/auditloader.zip";
Query OK, 0 rows affected (0.09 sec)
mysql> mysql> show plugins\G
@@ -276,7 +289,7 @@ Description: load audit log to olap load, and user can view the statistic of que
JavaVersion: 1.8.31
ClassName: AuditLoaderPlugin
SoName: NULL
- Sources: /home/cmy/git/doris/core/fe_plugins/output/auditloader.zip
+ Sources: /home/users/doris/auditloader.zip
Status: INSTALLED
*************************** 2. row ***************************
Name: AuditLogBuilder
diff --git a/docs/zh-CN/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md b/docs/zh-CN/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md
index 8dd5706d0a..49274399cc 100644
--- a/docs/zh-CN/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md
+++ b/docs/zh-CN/sql-reference/sql-statements/Administration/INSTALL PLUGIN.md
@@ -43,11 +43,11 @@ under the License.
1. 安装一个本地 zip 文件插件:
- INSTALL PLUGIN FROM "/home/users/seaven/auditdemo.zip";
+ INSTALL PLUGIN FROM "/home/users/doris/auditdemo.zip";
2. 安装一个本地目录中的插件:
- INSTALL PLUGIN FROM "/home/users/seaven/auditdemo/";
+ INSTALL PLUGIN FROM "/home/users/doris/auditdemo/";
2. 下载并安装一个插件: