Skip to content

Commit

Permalink
Add docs about how to use stateful functions in pulsar (apache#11335)
Browse files Browse the repository at this point in the history
* add docs about how to use stateful functions in pulsar

Signed-off-by: xiaolongran <xiaolongran@tencent.com>

* fix comments

Signed-off-by: xiaolongran <xiaolongran@tencent.com>
  • Loading branch information
wolfstudy authored Jul 16, 2021
1 parent f625d5e commit b18a048
Show file tree
Hide file tree
Showing 12 changed files with 414 additions and 0 deletions.
34 changes: 34 additions & 0 deletions site2/docs/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,40 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
35 changes: 35 additions & 0 deletions site2/website/versioned_docs/version-2.6.0/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,41 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
35 changes: 35 additions & 0 deletions site2/website/versioned_docs/version-2.6.1/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,41 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
35 changes: 35 additions & 0 deletions site2/website/versioned_docs/version-2.6.2/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,41 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
35 changes: 35 additions & 0 deletions site2/website/versioned_docs/version-2.6.3/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,41 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
35 changes: 35 additions & 0 deletions site2/website/versioned_docs/version-2.6.4/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,41 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
34 changes: 34 additions & 0 deletions site2/website/versioned_docs/version-2.7.0/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,40 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
34 changes: 34 additions & 0 deletions site2/website/versioned_docs/version-2.7.1/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,40 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
34 changes: 34 additions & 0 deletions site2/website/versioned_docs/version-2.7.2/functions-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,40 @@ If authentication is enabled on the BookKeeper cluster, configure the following
- `bookkeeperClientAuthenticationParametersName`: the BookKeeper client authentication plugin parameters name.
- `bookkeeperClientAuthenticationParameters`: the BookKeeper client authentication plugin parameters.

### Configure Stateful-Functions to run with broker

If you want to use Stateful-Functions related functions (for example, `putState()` and `queryState()` related interfaces), follow steps below.

1. Enable the **streamStorage** service in the BookKeeper.

Currently, the service uses the NAR package, so you need to set the configuration in `bookkeeper.conf`.

```text
extraServerComponents=org.apache.bookkeeper.stream.server.StreamStorageLifecycleComponent
```
After starting bookie, use the following methods to check whether the streamStorage service is started correctly.
Input:
```shell
telnet localhost 4181
```
Output:
```text
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
```
2. Turn on this function in `functions_worker.yml`.
```text
stateStorageServiceUrl: bk://<bk-service-url>:4181
```
`bk-service-url` is the service URL pointing to the BookKeeper table service.
### Start Functions-worker with broker
Once you have configured the `functions_worker.yml` file, you can start or restart your broker.
Expand Down
Loading

0 comments on commit b18a048

Please sign in to comment.