Skip to content

Commit

Permalink
[fix][doc] Hotfix Pulsar IO docs (apache#16686)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Preuß authored Aug 23, 2022
1 parent 11f6912 commit f506054
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions site2/docs/io-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: How to debug Pulsar connectors
sidebar_label: "Debug"
---
This guide explains how to debug connectors in localrun or cluster mode and gives a debugging checklist.
To better demonstrate how to debug Pulsar connectors, here takes a Mongo sink connector as an example.
To better demonstrate how to debug Pulsar connectors, take the Mongo sink connector as an example.

**Deploy a Mongo sink environment**
1. Start a Mongo service.
Expand Down Expand Up @@ -106,7 +106,7 @@ Use one of the following methods to get a connector log in localrun mode:

```

To clearly explain the log information, here breaks down the large block of information into small blocks and add descriptions for each block.
To clearly explain the log information, the following is a breakdown into smaller blocks with added descriptions.
* This piece of log information shows the storage path of the nar package after decompression.

```
Expand Down
20 changes: 10 additions & 10 deletions site2/docs/io-develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ interface, which means you need to implement the {@inject: github:open:/pulsar-i

```

If nothing to return, the implementation should be blocking rather than returning `null`.
If there is nothing to return, the implementation should be blocking rather than returning `null`.

The returned {@inject: github:Record:/pulsar-functions/api-java/src/main/java/org/apache/pulsar/functions/api/Record.java} should encapsulate the following information, which is needed by Pulsar IO runtime.

Expand All @@ -95,10 +95,10 @@ interface, which means you need to implement the {@inject: github:open:/pulsar-i
`ack` |Acknowledge that the record is fully processed.
`fail`|Indicate that the record fails to be processed.

## Handle schema information
#### Handle schema information

Pulsar IO automatically handles the schema and provides a strongly typed API based on Java generics.
If you know the schema type that you are producing, you can declare the Java class relative to that type in your sink declaration.
If you know the schema type that you are producing, you can declare the Java class relative to that type in your source declaration.

```
Expand Down Expand Up @@ -136,8 +136,8 @@ To handle the `KeyValue` type properly, follow the guidelines for your record im
- It must return a `KeyValue` object as `Record.getValue()`
- It may return null in `Record.getSchema()`

When Pulsar IO runtime encounters a `KVRecord`, it brings the following changes automatically:
- Set properly the `KeyValueSchema`
When Pulsar IO runtime encounters a `KVRecord`, it does the following changes automatically:
- Set the proper `KeyValueSchema`
- Encode the Message Key and the Message Value according to the `KeyValueEncoding` (SEPARATED or INLINE)

:::tip
Expand Down Expand Up @@ -179,14 +179,14 @@ Developing a sink connector **is similar to** developing a source connector, tha
```

During the implementation, you can decide how to write the `Value` and
the `Key` to the actual source, and leverage all the provided information such as
the `Key` to the actual sink, and leverage all the provided information such as
`PartitionId` and `RecordSequence` to achieve different processing guarantees.

You also need to ack records (if messages are sent successfully) or fail records (if messages fail to send).

## Handling Schema information
#### Handle schema information

Pulsar IO handles automatically the Schema and provides a strongly typed API based on Java generics.
Pulsar IO automatically handles the Schema and provides a strongly typed API based on Java generics.
If you know the Schema type that you are consuming from you can declare the Java class relative to that type in your Sink declaration.

```
Expand Down Expand Up @@ -282,11 +282,11 @@ work with Pulsar Functions' runtime, that is, [NAR](#nar) and [uber JAR](#uber-j
:::note

If you plan to package and distribute your connector for others to use, you are obligated to
license and copyright your own code properly. Remember to add the license and copyright to
all libraries your code uses and to your distribution.

:::

license and copyright your own code properly. Remember to add the license and copyright to
all libraries your code uses and to your distribution.
>
> If you use the [NAR](#nar) method, the NAR plugin
automatically creates a `DEPENDENCIES` file in the generated NAR package, including the proper
Expand Down

0 comments on commit f506054

Please sign in to comment.