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

Issue 479: Support Docusaurus format #594

Open
wants to merge 9 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
6 changes: 4 additions & 2 deletions documentation/src/docs/batch.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Batch
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,8 +18,6 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Batch Connector

The Flink Connector library for Pravega makes it possible to use a Pravega Stream as a data source and data sink in a batch program. See the below sections for details.

## Table of Contents
Expand Down
6 changes: 4 additions & 2 deletions documentation/src/docs/configurations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Configurations
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,8 +18,6 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Configurations

The Flink connector library for Pravega supports the **Flink Streaming API**, **Table API** and **Batch API**, using a common configuration class.

## Table of Contents
Expand Down
43 changes: 24 additions & 19 deletions documentation/src/docs/dev-guide.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Developer's Guide
---

<!--
Copyright Pravega Authors.

Expand All @@ -13,6 +17,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
import versions from '@site/versions';

# Flink Connector - Dev Guide

Expand All @@ -22,7 +27,7 @@ Learn how to build your own applications that using Flink connector for Pravega.

To complete this guide, you need:

* JDK 8 or 11 installed with JAVA_HOME configured appropriately
* JDK 8 or 11 installed with `JAVA_HOME` configured appropriately
* Pravega running(Check [here](https://pravega.io/docs/latest/getting-started/) to get started with Pravega)
* Use Gradle or Maven

Expand All @@ -34,12 +39,12 @@ However, you can go straight to the completed example at [flink-connector-exampl

# Starting Flink

Download Flink release and un-tar it. We use Flink 1.11.2 here.
<p>Download Flink release and un-tar it. We use Flink {versions.flink} here.</p>

```bash
$ tar -xzf flink-1.11.2-bin-scala_2.12.tgz
$ cd flink-1.11.2-bin-scala_2.12
```
<pre><code {...{ "className": "language-bash"}}>
{`$ tar -xzf flink-${versions.flink}-bin-scala_${versions.scala}.tgz
$ cd flink-${versions.flink}-bin-scala_${versions.scala}`}
</code></pre>

Start a cluster

Expand All @@ -66,11 +71,11 @@ You can follow [here](https://ci.apache.org/projects/flink/flink-docs-stable/dev

Add the below snippet to dependencies section of build.gradle in the app directory, connector dependencies should be part of the shadow jar. For flink connector dependency, we need to choose the connector which aligns the Flink major version and Scala version if you use Scala, along with the same Pravega version you run.

```groovy
compile group 'org.apache.flink', name: 'flink-streaming-java_2.12', version: '1.11.2'
<pre><code {...{ "className": "language-groovy" }}>
{`compile group 'org.apache.flink', name: 'flink-streaming-java_${versions.scala}', version: '${versions.flink}'

flinkShadowJar group: 'io.pravega', name: 'pravega-connectors-flink-1.11_2.12', version: '0.9.0'
```
flinkShadowJar group: 'io.pravega', name: 'pravega-connectors-flink-${versions['flink-minor']}_${versions.scala}', version: '${versions['flink-connectors']}'`}
</code></pre>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What are the correct latest versions here, @crazyzhou? Version info comes from here: pravega/docs@cf71c4b#diff-21a0578522c567f65881e4e8dc3aaace32d60dbdabf2730082b7d9da9f6cb4d0R13

Copy link
Contributor

Choose a reason for hiding this comment

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

flink: 1.13.2
flink.minor: 1.13
scala: 2.12
flink-connectors: 0.10.1


Define custom configurations `flinkShadowJar`

Expand All @@ -95,20 +100,20 @@ You can check [maven-quickstart](https://ci.apache.org/projects/flink/flink-docs

Add below dependencies into Maven POM, these dependencies should be part of the shadow jar

```xml
<dependency>
<pre><code {...{ "className": "language-xml" }}>
{`<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_2.12</artifactId>
<version>1.11.2</version>
<artifactId>flink-streaming-java_${versions.scala}</artifactId>
<version>${versions['flink']}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.pravega</groupId>
<artifactId>pravega-connectors-flink-1.11_2.12</artifactId>
<version>0.9.0</version>
</dependency>
```
<artifactId>pravega-connectors-flink-${versions['flink-minor']}_${versions.scala}</artifactId>
<version>${versions['flink-connectors']}</version>
</dependency>`}
</code></pre>

Invoke `mvn clean package` to build/package your project. You will find a JAR file that contains your application, plus connectors and libraries that you may have added as dependencies to the application: `target/<artifact-id>-<version>.jar`.

Expand Down Expand Up @@ -216,4 +221,4 @@ flink run -c <classname> ${your-app}.jar --controller <pravega-controller-uri>

# What’s next?

This guide covered the creation of a application that uses Flink connector to read and wirte from a pravega stream. However, there is much more. We recommend continuing the journey by going through [flink connector documents](https://pravega.io/docs/latest/connectors/flink-connector/) and check other examples on [flink-connector-examples](https://github.com/pravega/pravega-samples/tree/master/flink-connector-examples).
This guide covered the creation of a application that uses Flink connector to read and wirte from a pravega stream. However, there is much more. We recommend continuing the journey by going through [flink connector documents](overview) and check other examples on [flink-connector-examples](https://github.com/pravega/pravega-samples/tree/master/flink-connector-examples).
8 changes: 7 additions & 1 deletion documentation/src/docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Getting Started
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,12 +18,14 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Pravega Flink Connectors
import TOCInline from '@theme/TOCInline';

This repository implements connectors to read and write [Pravega](http://pravega.io/) Streams with [Apache Flink](http://flink.apache.org/) stream processing framework.

The connectors can be used to build end-to-end stream processing pipelines (see [Samples](https://github.com/pravega/pravega-samples)) that use Pravega as the stream storage and message bus, and Apache Flink for computation over the streams.

<TOCInline toc={toc} />

## Features & Highlights

- **Exactly-once processing guarantees** for both Reader and Writer, supporting **end-to-end exactly-once processing pipelines**
Expand Down
6 changes: 4 additions & 2 deletions documentation/src/docs/metrics.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Metrics
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,8 +18,6 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Metrics

Pravega metrics are collected and exposed via Flink metrics framework when using [`FlinkPravegaReader`](streaming.md#flinkpravegareader) or [`FlinkPravegaWriter`](streaming.md#flinkpravegawriter).

## Reader Metrics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Overview
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,8 +18,6 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Apache Flink Connectors for Pravega

This documentation describes the connectors API and it's usage to read and write [Pravega](http://pravega.io/) streams with [Apache Flink](http://flink.apache.org/) stream processing framework.

Build end-to-end stream processing pipelines that use Pravega as the stream storage and message bus, and Apache Flink for computation over the streams. See the [Pravega Concepts](http://pravega.io/docs/pravega-concepts/) page for more information.
Expand Down
22 changes: 13 additions & 9 deletions documentation/src/docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Quick Start
---

<!--
Copyright Pravega Authors.

Expand All @@ -13,8 +17,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Getting Started
import versions from '@site/versions';

## Creating a Flink Stream Processing Project

Expand All @@ -31,8 +34,8 @@ Once after the set up, please follow the below instructions to add the **Flink P

To add the Pravega connector dependencies to your project, add the following entry to your project file: (For example, `pom.xml` for Maven)

```xml
<!-- Before Pravega 0.6 -->
<pre><code {...{ "className": "language-xml" }}>
{`<!-- Before Pravega 0.6 -->
<dependency>
<groupId>io.pravega</groupId>
<artifactId>pravega-connectors-flink_2.12</artifactId>
Expand All @@ -42,12 +45,13 @@ To add the Pravega connector dependencies to your project, add the following ent
<!-- Pravega 0.6 and After -->
<dependency>
<groupId>io.pravega</groupId>
<artifactId>pravega-connectors-flink-1.9_2.12</artifactId>
<version>0.6.0</version>
</dependency>
```
<artifactId>pravega-connectors-flink-${versions['flink-minor']}_${versions.scala}</artifactId>
<version>${versions['flink-connectors']}</version>
</dependency>`}
</code></pre>

<p>Use appropriate version as necessary. <code>{versions['flink-minor']}</code> is the Flink Major-Minor version. <code>{versions.scala}</code> is the Scala version. <code>{versions.pravega}</code> is the Pravega version.</p>

Use appropriate version as necessary. `1.9` is the Flink Major-Minor version. `2.12` is the Scala version. `0.6.0` is the Pravega version.
The snapshot versions are published to [`GitHub Packages`](https://github.com/orgs/pravega/packages) repository and the release artifacts are available in [`Maven Central`](https://mvnrepository.com/artifact/io.pravega/pravega-connectors-flink) repository.

Alternatively, we could build and publish the connector artifacts to local maven repository by executing the following command and make use of that version as your application dependency.
Expand Down
6 changes: 4 additions & 2 deletions documentation/src/docs/serialization.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Serialization
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,8 +18,6 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Serialization

**Serialization** refers to converting a data element in your Flink program to/from a message in a Pravega stream.

Flink defines a standard interface for data serialization to/from byte messages delivered by various connectors. The core interfaces are:
Expand Down
18 changes: 18 additions & 0 deletions documentation/src/docs/sidebars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
mainSidebar: [
'overview',
'getting-started',
'quickstart',
'dev-guide',
{
'Features': [
'streaming',
'batch',
'table-api',
],
},
'metrics',
'configurations',
'serialization',
]
};
6 changes: 4 additions & 2 deletions documentation/src/docs/streaming.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Streaming
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,8 +18,6 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Streaming Connector

The Flink Connector library for Pravega provides a data source and data sink
for use with the Flink Streaming API. See the below sections for details.

Expand Down
14 changes: 8 additions & 6 deletions documentation/src/docs/table-api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Table API
---

<!--
Copyright Pravega Authors.

Expand All @@ -14,8 +18,6 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Table Connector

The Flink connector library for Pravega provides a table source and table sink for use with the Flink Table API.
The Table API provides a unified table source API for both the Flink streaming and batch environment, and also sink for the Flink streaming environment.

Expand Down Expand Up @@ -89,9 +91,9 @@ WITH (
| security.trust-store | optional | (none) | String | Trust Store for Pravega client |
| scan.execution.type | optional | streaming | String | Execution type for scan source. Valid values are 'streaming', 'batch'. |
| scan.reader-group.name | optional | (none) | String | Pravega reader group name |
| scan.streams | required for source | (none) | List<String> | Semicolon-separated list of stream names from which the table is read. |
| scan.start-streamcuts | optional | (none) | List<String> | Semicolon-separated list of base64 encoded strings for start streamcuts, begin of the stream if not specified |
| scan.end-streamcuts | optional | (none) | List<String> | Semicolon-separated list of base64 encoded strings for end streamcuts, unbounded end if not specified |
| scan.streams | required for source | (none) | List&lt;String&gt; | Semicolon-separated list of stream names from which the table is read. |
| scan.start-streamcuts | optional | (none) | List&lt;String&gt; | Semicolon-separated list of base64 encoded strings for start streamcuts, begin of the stream if not specified |
| scan.end-streamcuts | optional | (none) | List&lt;String&gt; | Semicolon-separated list of base64 encoded strings for end streamcuts, unbounded end if not specified |
| scan.reader-group.max-outstanding-checkpoint-request | optional | 3 | Integer | Maximum outstanding checkpoint requests to Pravega |
| scan.reader-group.refresh.interval | optional | 3 s | Duration | Refresh interval for reader group |
| scan.event-read.timeout.interval | optional | 1 s | Duration | Timeout for the call to read events from Pravega |
Expand All @@ -109,7 +111,7 @@ WITH (
`scan.execution.type` can be specified as user's choice to perform batch read or streaming read.
In the streaming environment, the table source uses a [`FlinkPravegaReader`](streaming.md#flinkpravegareader) connector.
In the batch environment, the table source uses a [`FlinkPravegaInputFormat`](batch.md#flinkpravegainputformat) connector.
Please see the documentation of [Streaming Connector](streaming.md) and [Batch Connector](#batch.md) to have a better understanding on the below mentioned parameter list.
Please see the documentation of [Streaming Connector](streaming.md) and [Batch Connector](batch.md) to have a better understanding on the below mentioned parameter list.

### Specify start and end streamcut

Expand Down