You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/03/30 13:10:31 UTC

[incubator-inlong-website] branch master updated: [INLONG-315] Add Inlong Manager Client developer doc (#327)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 7855e7a  [INLONG-315] Add Inlong Manager Client developer doc (#327)
7855e7a is described below

commit 7855e7adf20ab0f0bca986e13e4b29f7a97cfa45
Author: kipshi <48...@users.noreply.github.com>
AuthorDate: Wed Mar 30 21:10:27 2022 +0800

    [INLONG-315] Add Inlong Manager Client developer doc (#327)
---
 docs/development/inlong_manager_shiro_plugin.md    |  2 +-
 docs/development/inlong_msg.md                     |  2 +-
 docs/sdk/dataproxy-sdk/_category_.json             |  2 +-
 docs/sdk/manager-sdk/_category_.json               |  4 ++
 docs/sdk/manager-sdk/example.md                    | 68 ++++++++++++++++++++++
 .../development/inlong_manager_shiro_plugin.md     |  2 +-
 .../current/development/inlong_msg.md              |  2 +-
 .../current/sdk/manager-sdk/example.md             | 67 +++++++++++++++++++++
 8 files changed, 144 insertions(+), 5 deletions(-)

diff --git a/docs/development/inlong_manager_shiro_plugin.md b/docs/development/inlong_manager_shiro_plugin.md
index 1c9dc47..6d82ee7 100644
--- a/docs/development/inlong_manager_shiro_plugin.md
+++ b/docs/development/inlong_manager_shiro_plugin.md
@@ -8,7 +8,7 @@ The Apache Shiro framework is used in the inlong manager to realize the function
 
 ## Dependency
 - Add Maven Dependency
-```java
+```xml
 <dependency>
         <groupId>org.apache.inlong</groupId>
         <artifactId>manager-common</artifactId>
diff --git a/docs/development/inlong_msg.md b/docs/development/inlong_msg.md
index 14abfd8..2a63e28 100644
--- a/docs/development/inlong_msg.md
+++ b/docs/development/inlong_msg.md
@@ -8,7 +8,7 @@ If you consume data directly from a message queue (InLong TubeMQ or Pulsar), you
 
 ## Dependency
 - Add Maven Dependency
-```java
+```xml
 <dependency>
         <groupId>org.apache.inlong</groupId>
         <artifactId>inlong-common</artifactId>
diff --git a/docs/sdk/dataproxy-sdk/_category_.json b/docs/sdk/dataproxy-sdk/_category_.json
index ac1d703..653fd08 100644
--- a/docs/sdk/dataproxy-sdk/_category_.json
+++ b/docs/sdk/dataproxy-sdk/_category_.json
@@ -1,4 +1,4 @@
 {
-  "label": "DataProxy-SDK",
+  "label": "DataProxy SDK",
   "position": 1
 }
\ No newline at end of file
diff --git a/docs/sdk/manager-sdk/_category_.json b/docs/sdk/manager-sdk/_category_.json
new file mode 100644
index 0000000..3bc26c0
--- /dev/null
+++ b/docs/sdk/manager-sdk/_category_.json
@@ -0,0 +1,4 @@
+{
+  "label": "Manager SDK",
+  "position": 2
+}
\ No newline at end of file
diff --git a/docs/sdk/manager-sdk/example.md b/docs/sdk/manager-sdk/example.md
new file mode 100644
index 0000000..1dcbdd9
--- /dev/null
+++ b/docs/sdk/manager-sdk/example.md
@@ -0,0 +1,68 @@
+---
+title: Example
+sidebar_position: 1
+---
+
+## Overview
+
+Apache InLong Manager is the user-oriented unified UI of the entire data access platform. Now we provide client SDK for users,
+which means you can use client to manipulate your group task instead of UI.
+
+## Dependency
+
+- Add Maven Dependency
+```xml
+ <dependency>
+    <groupId>org.apache.inlong</groupId>
+    <artifactId>manager-client</artifactId>
+    <version>${inlong.version}</version>
+</dependency>
+```
+
+## Code
+
+- We provide two unit cases for you to build your own group task, you can replace the predefined params and try it in your own cluster.
+- In following cases, **Apache Pulsar** and **Apache Flink** are needed when your group is inited. You can run Inlong group in your own cluster, or with the help of third-party services.
+
+### Programming must know interface
+
+```java
+// Create client configuration
+ClientConfiguration configuration = createClientConfig();
+// Init Inlong client
+InlongClient inlongClient = InlongClient.create(SERVICE_URL, configuration);
+try {
+    // Create group conf
+    InlongGroupConf groupConf = createGroupConf();
+    // Init group resource by conf
+    InlongGroup group = inlongClient.forGroup(groupConf);
+    // Create stream conf
+    InlongStreamConf streamConf = createStreamConf();
+    // Create Stream builder 
+    InlongStreamBuilder streamBuilder = group.createStream(streamConf);
+    // Create stream source
+    streamBuilder.source(createSource());
+    // Create stream sink
+    streamBuilder.sink(createSink());
+    // Init stream 
+    streamBuilder.initOrUpdate();
+    // Start group in server
+    InlongGroupContext inlongGroupContext = group.init();
+} catch (Exception e) {
+    e.printStackTrace();
+}
+```
+
+### Kafka2Hive
+
+Refer to **manager-client-test**
+[org.apache.inlong.manager.client.Kafka2HiveTest.java](https://github.com/apache/incubator-inlong/blob/master/inlong-manager/manager-client-test/src/test/java/org/apache/inlong/manager/client/Kafka2HiveTest.java)
+
+### Binlog2Kafka
+
+Refer to **manager-client-test**
+[org.apache.inlong.manager.client.Binlog2KafkaTest.java](https://github.com/apache/incubator-inlong/blob/master/inlong-manager/manager-client-test/src/test/java/org/apache/inlong/manager/client/Binlog2KafkaTest.java)
+
+## Last but not Least
+
+If you have any question about manager client, communicate with us please.
\ No newline at end of file
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_manager_shiro_plugin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_manager_shiro_plugin.md
index 31ef639..4aaec48 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_manager_shiro_plugin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_manager_shiro_plugin.md
@@ -8,7 +8,7 @@ Inlong Manager中使用了Apache Shiro框架实现了认证和授权等功能,
 
 ## 依赖
 - 增加maven 依赖
-```java
+```xml
 <dependency>
         <groupId>org.apache.inlong</groupId>
         <artifactId>manager-common</artifactId>
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_msg.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_msg.md
index c4996b6..5487ac3 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_msg.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/development/inlong_msg.md
@@ -8,7 +8,7 @@ sidebar_position: 1
 
 ## 解析
 - 增加maven 依赖
-```java
+```xml
 <dependency>
         <groupId>org.apache.inlong</groupId>
         <artifactId>inlong-common</artifactId>
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sdk/manager-sdk/example.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sdk/manager-sdk/example.md
new file mode 100644
index 0000000..b05d127
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sdk/manager-sdk/example.md
@@ -0,0 +1,67 @@
+---
+title: 示例
+sidebar_position: 1
+---
+
+## 总览
+
+Apache InLong Manager 是整个数据集成平台面向用户的统一管理入口。为方便用户使用在无界面的场景下部署InLong group任务,我们提供了Manager的客户端SDK。
+
+## 依赖
+
+- 增加 maven 依赖
+```xml
+ <dependency>
+    <groupId>org.apache.inlong</groupId>
+    <artifactId>manager-client</artifactId>
+    <version>${inlong.version}</version>
+</dependency>
+```
+
+## 代码
+
+- 我们以单元测试用例的方式提供了两个客户端用例, 你可以更换其中的参数并在自己的集群上实践;
+- 在我们提供的用例中,需要**Apache Pulsar**及**Apache Flink**的支持。你可以在自己的Inlong集群上运行任务, 或借助第三方平台提供的相关服务运行。
+
+### 参考Demo
+
+```java
+// Create client configuration
+ClientConfiguration configuration = createClientConfig();
+// Init Inlong client
+InlongClient inlongClient = InlongClient.create(SERVICE_URL, configuration);
+try {
+    // Create group conf
+    InlongGroupConf groupConf = createGroupConf();
+    // Init group resource by conf
+    InlongGroup group = inlongClient.forGroup(groupConf);
+    // Create stream conf
+    InlongStreamConf streamConf = createStreamConf();
+    // Create Stream builder 
+    InlongStreamBuilder streamBuilder = group.createStream(streamConf);
+    // Create stream source
+    streamBuilder.source(createSource());
+    // Create stream sink
+    streamBuilder.sink(createSink());
+    // Init stream 
+    streamBuilder.initOrUpdate();
+    // Start group in server
+    InlongGroupContext inlongGroupContext = group.init();
+} catch (Exception e) {
+    e.printStackTrace();
+}
+```
+
+### Kafka2Hive
+
+参考 **manager-client-test**
+[org.apache.inlong.manager.client.Kafka2HiveTest.java](https://github.com/apache/incubator-inlong/blob/master/inlong-manager/manager-client-test/src/test/java/org/apache/inlong/manager/client/Kafka2HiveTest.java)
+
+### Binlog2Kafka
+
+参考 **manager-client-test**
+[org.apache.inlong.manager.client.Binlog2KafkaTest.java](https://github.com/apache/incubator-inlong/blob/master/inlong-manager/manager-client-test/src/test/java/org/apache/inlong/manager/client/Binlog2KafkaTest.java)
+
+## 写在最后
+
+如果你在使用Manager客户端时有任何疑问,请及时与我们沟通
\ No newline at end of file