You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tz...@apache.org on 2020/08/31 06:00:21 UTC

[flink-statefun] 03/05: [FLINK-18979][docs] Default to remote modules in connectors

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

tzulitai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink-statefun.git

commit 4a86dbe35d68e19c2666d4db7ec61d99a3a9a39e
Author: Seth Wiesman <sj...@gmail.com>
AuthorDate: Mon Aug 17 14:22:12 2020 -0500

    [FLINK-18979][docs] Default to remote modules in connectors
---
 docs/io-module/apache-kafka.md     | 186 +++++++++++++++++-----------------
 docs/io-module/aws-kinesis.md      | 198 ++++++++++++++++++-------------------
 docs/io-module/flink-connectors.md |   2 +-
 docs/io-module/index.md            |  82 +++++++--------
 4 files changed, 234 insertions(+), 234 deletions(-)

diff --git a/docs/io-module/apache-kafka.md b/docs/io-module/apache-kafka.md
index 91146cc..9b47169 100644
--- a/docs/io-module/apache-kafka.md
+++ b/docs/io-module/apache-kafka.md
@@ -59,32 +59,6 @@ It accepts the following arguments:
 6. The position to start consuming from
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-package org.apache.flink.statefun.docs.io.kafka;
-
-import org.apache.flink.statefun.docs.models.User;
-import org.apache.flink.statefun.sdk.io.IngressIdentifier;
-import org.apache.flink.statefun.sdk.io.IngressSpec;
-import org.apache.flink.statefun.sdk.kafka.KafkaIngressBuilder;
-import org.apache.flink.statefun.sdk.kafka.KafkaIngressStartupPosition;
-
-public class IngressSpecs {
-
-  public static final IngressIdentifier<User> ID =
-      new IngressIdentifier<>(User.class, "example", "input-ingress");
-
-  public static final IngressSpec<User> kafkaIngress =
-      KafkaIngressBuilder.forIdentifier(ID)
-          .withKafkaAddress("localhost:9092")
-          .withConsumerGroupId("greetings")
-          .withTopic("my-topic")
-          .withDeserializer(UserDeserializer.class)
-          .withStartupPosition(KafkaIngressStartupPosition.fromLatest())
-          .build();
-}
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 version: "1.0"
@@ -111,6 +85,32 @@ spec:
                   - example-namespace/my-function-2
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+package org.apache.flink.statefun.docs.io.kafka;
+
+import org.apache.flink.statefun.docs.models.User;
+import org.apache.flink.statefun.sdk.io.IngressIdentifier;
+import org.apache.flink.statefun.sdk.io.IngressSpec;
+import org.apache.flink.statefun.sdk.kafka.KafkaIngressBuilder;
+import org.apache.flink.statefun.sdk.kafka.KafkaIngressStartupPosition;
+
+public class IngressSpecs {
+
+  public static final IngressIdentifier<User> ID =
+      new IngressIdentifier<>(User.class, "example", "input-ingress");
+
+  public static final IngressSpec<User> kafkaIngress =
+      KafkaIngressBuilder.forIdentifier(ID)
+          .withKafkaAddress("localhost:9092")
+          .withConsumerGroupId("greetings")
+          .withTopic("my-topic")
+          .withDeserializer(UserDeserializer.class)
+          .withStartupPosition(KafkaIngressStartupPosition.fromLatest())
+          .build();
+}
+{% endhighlight %}
+</div>
 </div>
 
 The ingress also accepts properties to directly configure the Kafka client, using ``KafkaIngressBuilder#withProperties(Properties)``.
@@ -126,17 +126,17 @@ The ingress allows configuring the startup position to be one of the following:
 Starts from offsets that were committed to Kafka for the specified consumer group.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KafkaIngressStartupPosition#fromGroupOffsets();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
     type: group-offsets
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KafkaIngressStartupPosition#fromGroupOffsets();
+{% endhighlight %}
+</div>
 </div>
 
 #### Earlist
@@ -144,17 +144,17 @@ startupPosition:
 Starts from the earliest offset.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KafkaIngressStartupPosition#fromEarliest();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
     type: earliest
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KafkaIngressStartupPosition#fromEarliest();
+{% endhighlight %}
+</div>
 </div>
 
 #### Latest
@@ -162,17 +162,17 @@ startupPosition:
 Starts from the latest offset.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KafkaIngressStartupPosition#fromLatest();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
     type: latest
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KafkaIngressStartupPosition#fromLatest();
+{% endhighlight %}
+</div>
 </div>
 
 #### Specific Offsets
@@ -180,16 +180,6 @@ startupPosition:
 Starts from specific offsets, defined as a map of partitions to their target starting offset.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-Map<TopicPartition, Long> offsets = new HashMap<>();
-offsets.add(new TopicPartition("user-topic", 0), 91);
-offsets.add(new TopicPartition("user-topic", 11), 11);
-offsets.add(new TopicPartition("user-topic", 8), 8);
-
-KafkaIngressStartupPosition#fromSpecificOffsets(offsets);
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
@@ -200,6 +190,16 @@ startupPosition:
         - user-topic/2: 8
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+Map<TopicPartition, Long> offsets = new HashMap<>();
+offsets.add(new TopicPartition("user-topic", 0), 91);
+offsets.add(new TopicPartition("user-topic", 11), 11);
+offsets.add(new TopicPartition("user-topic", 8), 8);
+
+KafkaIngressStartupPosition#fromSpecificOffsets(offsets);
+{% endhighlight %}
+</div>
 </div>
 
 #### Date
@@ -207,11 +207,6 @@ startupPosition:
 Starts from offsets that have an ingestion time larger than or equal to a specified date.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KafkaIngressStartupPosition#fromDate(ZonedDateTime.now());
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
@@ -219,6 +214,11 @@ startupPosition:
     date: 2020-02-01 04:15:00.00 Z
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KafkaIngressStartupPosition#fromDate(ZonedDateTime.now());
+{% endhighlight %}
+</div>
 </div>
 
 On startup, if the specified startup offset for a partition is out-of-range or does not exist (which may be the case if the ingress is configured to start from group offsets, specific offsets, or from a date), then the ingress will fallback to using the position configured using ``KafkaIngressBuilder#withAutoOffsetResetPosition(KafkaIngressAutoResetPosition)``.
@@ -272,28 +272,6 @@ It accepts the following arguments:
 5. Properties for the Kafka producer
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-package org.apache.flink.statefun.docs.io.kafka;
-
-import org.apache.flink.statefun.docs.models.User;
-import org.apache.flink.statefun.sdk.io.EgressIdentifier;
-import org.apache.flink.statefun.sdk.io.EgressSpec;
-import org.apache.flink.statefun.sdk.kafka.KafkaEgressBuilder;
-
-public class EgressSpecs {
-
-  public static final EgressIdentifier<User> ID =
-      new EgressIdentifier<>("example", "output-egress", User.class);
-
-  public static final EgressSpec<User> kafkaEgress =
-      KafkaEgressBuilder.forIdentifier(ID)
-          .withKafkaAddress("localhost:9092")
-          .withSerializer(UserSerializer.class)
-          .build();
-}
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 version: "1.0"
@@ -316,6 +294,28 @@ spec:
               - foo.config: bar
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+package org.apache.flink.statefun.docs.io.kafka;
+
+import org.apache.flink.statefun.docs.models.User;
+import org.apache.flink.statefun.sdk.io.EgressIdentifier;
+import org.apache.flink.statefun.sdk.io.EgressSpec;
+import org.apache.flink.statefun.sdk.kafka.KafkaEgressBuilder;
+
+public class EgressSpecs {
+
+  public static final EgressIdentifier<User> ID =
+      new EgressIdentifier<>("example", "output-egress", User.class);
+
+  public static final EgressSpec<User> kafkaEgress =
+      KafkaEgressBuilder.forIdentifier(ID)
+          .withKafkaAddress("localhost:9092")
+          .withSerializer(UserSerializer.class)
+          .build();
+}
+{% endhighlight %}
+</div>
 </div>
 
 Please refer to the Kafka [producer configuration](https://docs.confluent.io/current/installation/configuration/producer-configs.html) documentation for the full list of available properties.
@@ -330,17 +330,17 @@ You can choose three different modes of operation.
 Nothing is guaranteed, produced records can be lost or duplicated.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KafkaEgressBuilder#withNoProducerSemantics();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 deliverySemantic:
     type: none
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KafkaEgressBuilder#withNoProducerSemantics();
+{% endhighlight %}
+</div>
 </div>
 
 #### At Least Once
@@ -348,17 +348,17 @@ deliverySemantic:
 Stateful Functions will guarantee that no records will be lost but they can be duplicated.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KafkaEgressBuilder#withAtLeastOnceProducerSemantics();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 deliverySemantic:
     type: at-least-once
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KafkaEgressBuilder#withAtLeastOnceProducerSemantics();
+{% endhighlight %}
+</div>
 </div>
 
 #### Exactly Once
@@ -366,11 +366,6 @@ deliverySemantic:
 Stateful Functions uses Kafka transactions to provide exactly-once semantics.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KafkaEgressBuilder#withExactlyOnceProducerSemantics(Duration.minutes(15));
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 deliverySemantic:
@@ -378,6 +373,11 @@ deliverySemantic:
     transactionTimeoutMillis: 900000 # 15 min
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KafkaEgressBuilder#withExactlyOnceProducerSemantics(Duration.minutes(15));
+{% endhighlight %}
+</div>
 </div>
 
 ### Kafka Serializer
diff --git a/docs/io-module/aws-kinesis.md b/docs/io-module/aws-kinesis.md
index 1975004..b9fc52a 100644
--- a/docs/io-module/aws-kinesis.md
+++ b/docs/io-module/aws-kinesis.md
@@ -59,34 +59,6 @@ It accepts the following arguments:
 6. The name of the stream to consume from
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-package org.apache.flink.statefun.docs.io.kinesis;
-
-import org.apache.flink.statefun.docs.models.User;
-import org.apache.flink.statefun.sdk.io.IngressIdentifier;
-import org.apache.flink.statefun.sdk.io.IngressSpec;
-import org.apache.flink.statefun.sdk.kinesis.auth.AwsCredentials;
-import org.apache.flink.statefun.sdk.kinesis.ingress.KinesisIngressBuilder;
-import org.apache.flink.statefun.sdk.kinesis.ingress.KinesisIngressStartupPosition;
-
-public class IngressSpecs {
-
-  public static final IngressIdentifier<User> ID =
-      new IngressIdentifier<>(User.class, "example", "input-ingress");
-
-  public static final IngressSpec<User> kinesisIngress =
-      KinesisIngressBuilder.forIdentifier(ID)
-          .withAwsRegion("us-west-1")
-          .withAwsCredentials(AwsCredentials.fromDefaultProviderChain())
-          .withDeserializer(UserDeserializer.class)
-          .withStream("stream-name")
-          .withStartupPosition(KinesisIngressStartupPosition.fromEarliest())
-          .withClientConfigurationProperty("key", "value")
-          .build();
-}
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 version: "1.0"
@@ -125,6 +97,34 @@ module:
                   - MaxConnections: 15
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+package org.apache.flink.statefun.docs.io.kinesis;
+
+import org.apache.flink.statefun.docs.models.User;
+import org.apache.flink.statefun.sdk.io.IngressIdentifier;
+import org.apache.flink.statefun.sdk.io.IngressSpec;
+import org.apache.flink.statefun.sdk.kinesis.auth.AwsCredentials;
+import org.apache.flink.statefun.sdk.kinesis.ingress.KinesisIngressBuilder;
+import org.apache.flink.statefun.sdk.kinesis.ingress.KinesisIngressStartupPosition;
+
+public class IngressSpecs {
+
+  public static final IngressIdentifier<User> ID =
+      new IngressIdentifier<>(User.class, "example", "input-ingress");
+
+  public static final IngressSpec<User> kinesisIngress =
+      KinesisIngressBuilder.forIdentifier(ID)
+          .withAwsRegion("us-west-1")
+          .withAwsCredentials(AwsCredentials.fromDefaultProviderChain())
+          .withDeserializer(UserDeserializer.class)
+          .withStream("stream-name")
+          .withStartupPosition(KinesisIngressStartupPosition.fromEarliest())
+          .withClientConfigurationProperty("key", "value")
+          .build();
+}
+{% endhighlight %}
+</div>
 </div>
 
 The ingress also accepts properties to directly configure the Kinesis client, using ``KinesisIngressBuilder#withClientConfigurationProperty()``.
@@ -140,17 +140,17 @@ The ingress allows configuring the startup position to be one of the following:
 Start consuming from the latest position, i.e. head of the stream shards.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KinesisIngressStartupPosition#fromLatest();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
     type: latest
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KinesisIngressStartupPosition#fromLatest();
+{% endhighlight %}
+</div>
 </div>
 
 #### Earlist
@@ -158,17 +158,17 @@ startupPosition:
 Start consuming from the earliest position possible.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KinesisIngressStartupPosition#fromEarliest();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
     type: earliest
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KinesisIngressStartupPosition#fromEarliest();
+{% endhighlight %}
+</div>
 </div>
 
 #### Date
@@ -176,11 +176,6 @@ startupPosition:
 Starts from offsets that have an ingestion time larger than or equal to a specified date.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-KinesisIngressStartupPosition#fromDate(ZonedDateTime.now());
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 startupPosition:
@@ -188,6 +183,11 @@ startupPosition:
     date: 2020-02-01 04:15:00.00 Z
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+KinesisIngressStartupPosition#fromDate(ZonedDateTime.now());
+{% endhighlight %}
+</div>
 </div>
 
 ### Kinesis Deserializer
@@ -239,32 +239,6 @@ It accepts the following arguments:
 6. The number of max outstanding records before backpressure is applied
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-package org.apache.flink.statefun.docs.io.kinesis;
-
-import org.apache.flink.statefun.docs.models.User;
-import org.apache.flink.statefun.sdk.io.EgressIdentifier;
-import org.apache.flink.statefun.sdk.io.EgressSpec;
-import org.apache.flink.statefun.sdk.kinesis.auth.AwsCredentials;
-import org.apache.flink.statefun.sdk.kinesis.egress.KinesisEgressBuilder;
-
-public class EgressSpecs {
-
-  public static final EgressIdentifier<User> ID =
-      new EgressIdentifier<>("example", "output-egress", User.class);
-
-  public static final EgressSpec<User> kinesisEgress =
-      KinesisEgressBuilder.forIdentifier(ID)
-          .withAwsCredentials(AwsCredentials.fromDefaultProviderChain())
-          .withAwsRegion("us-west-1")
-          .withMaxOutstandingRecords(100)
-          .withClientConfigurationProperty("key", "value")
-          .withSerializer(UserSerializer.class)
-          .build();
-}
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 version: "1.0"
@@ -293,6 +267,32 @@ module:
                   - ThreadPoolSize: 10
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+package org.apache.flink.statefun.docs.io.kinesis;
+
+import org.apache.flink.statefun.docs.models.User;
+import org.apache.flink.statefun.sdk.io.EgressIdentifier;
+import org.apache.flink.statefun.sdk.io.EgressSpec;
+import org.apache.flink.statefun.sdk.kinesis.auth.AwsCredentials;
+import org.apache.flink.statefun.sdk.kinesis.egress.KinesisEgressBuilder;
+
+public class EgressSpecs {
+
+  public static final EgressIdentifier<User> ID =
+      new EgressIdentifier<>("example", "output-egress", User.class);
+
+  public static final EgressSpec<User> kinesisEgress =
+      KinesisEgressBuilder.forIdentifier(ID)
+          .withAwsCredentials(AwsCredentials.fromDefaultProviderChain())
+          .withAwsRegion("us-west-1")
+          .withMaxOutstandingRecords(100)
+          .withClientConfigurationProperty("key", "value")
+          .withSerializer(UserSerializer.class)
+          .build();
+}
+{% endhighlight %}
+</div>
 </div>
 
 Please refer to the Kinesis [producer default configuration properties](https://github.com/awslabs/amazon-kinesis-producer/blob/master/java/amazon-kinesis-producer-sample/default_config.properties) documentation for the full list of available properties.
@@ -347,17 +347,17 @@ Both the Kinesis ingress and egress can be configured to a specific AWS region.
 Consults AWS's default provider chain to determine the AWS region.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-AwsRegion.fromDefaultProviderChain();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 awsCredentials:
     type: default
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+AwsRegion.fromDefaultProviderChain();
+{% endhighlight %}
+</div>
 </div>
 
 #### Specific
@@ -365,11 +365,6 @@ awsCredentials:
 Specifies an AWS region using the region's unique id.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-AwsRegion.of("us-west-1");
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 awsCredentials:
@@ -377,6 +372,11 @@ awsCredentials:
     id: us-west-1
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+AwsRegion.of("us-west-1");
+{% endhighlight %}
+</div>
 </div>
 
 
@@ -386,11 +386,6 @@ Connects to an AWS region through a non-standard AWS service endpoint.
 This is typically used only for development and testing purposes.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-AwsRegion.ofCustomEndpoint("https://localhost:4567", "us-west-1");
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 awsCredentials:
@@ -399,6 +394,11 @@ awsCredentials:
     id: us-west-1
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+AwsRegion.ofCustomEndpoint("https://localhost:4567", "us-west-1");
+{% endhighlight %}
+</div>
 </div>
 
 ## AWS Credentials
@@ -410,17 +410,17 @@ Both the Kinesis ingress and egress can be configured using standard AWS credent
 Consults AWS’s default provider chain to determine the AWS credentials.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-AwsCredentials.fromDefaultProviderChain();
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 awsCredentials:
     type: default
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+AwsCredentials.fromDefaultProviderChain();
+{% endhighlight %}
+</div>
 </div>
 
 #### Basic
@@ -428,11 +428,6 @@ awsCredentials:
 Specifies the AWS credentials directly with provided access key ID and secret access key strings.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-AwsCredentials.basic("accessKeyId", "secretAccessKey");
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 awsCredentials:
@@ -441,6 +436,11 @@ awsCredentials:
     secretAccessKey: secret-access-key
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+AwsCredentials.basic("accessKeyId", "secretAccessKey");
+{% endhighlight %}
+</div>
 </div>
 
 #### Profile
@@ -448,11 +448,6 @@ awsCredentials:
 Specifies the AWS credentials using an AWS configuration profile, along with the profile's configuration path.
 
 <div class="codetabs" markdown="1">
-<div data-lang="Embedded Module" markdown="1">
-{% highlight java %}
-AwsCredentials.profile("profile-name", "/path/to/profile/config");
-{% endhighlight %}
-</div>
 <div data-lang="Remote Module" markdown="1">
 {% highlight yaml %}
 awsCredentials:
@@ -461,5 +456,10 @@ awsCredentials:
     profilePath: /path/to/profile/config
 {% endhighlight %}
 </div>
+<div data-lang="Embedded Module" markdown="1">
+{% highlight java %}
+AwsCredentials.profile("profile-name", "/path/to/profile/config");
+{% endhighlight %}
+</div>
 </div>
 
diff --git a/docs/io-module/flink-connectors.md b/docs/io-module/flink-connectors.md
index dac8c2a..5856845 100644
--- a/docs/io-module/flink-connectors.md
+++ b/docs/io-module/flink-connectors.md
@@ -26,7 +26,7 @@ under the License.
 
 
 The source-sink I/O module allows you to plug in existing, or custom, Flink connectors that are not already integrated into a dedicated I/O module.
-For details details of how to build a custom connector see the official [Apache Flink documentation](https://ci.apache.org/projects/flink/flink-docs-stable).
+For details of how to build a custom connector see the official [Apache Flink documentation](https://ci.apache.org/projects/flink/flink-docs-stable).
 
 * This will be replaced by the TOC
 {:toc}
diff --git a/docs/io-module/index.md b/docs/io-module/index.md
index 9da09c1..b60c530 100644
--- a/docs/io-module/index.md
+++ b/docs/io-module/index.md
@@ -42,6 +42,22 @@ An ingress identifier, similar to a function type, uniquely identifies an ingres
 The spec defines the details of how to connect to the external system, which is specific to each individual I/O module. Each identifier-spec pair is bound to the system inside an stateful function module.
 
 <div class="codetabs" markdown="1">
+<div data-lang="Remote Module" markdown="1">
+{% highlight yaml %}
+version: "1.0"
+
+module:
+     meta:
+         type: remote
+     spec:
+         ingresses:
+           - ingress:
+               meta:
+                 id: example/user-ingress
+                 type: # ingress type
+               spec: # ingress specific configurations
+{% endhighlight %}
+</div>
 <div data-lang="Embedded Module" markdown="1">
 {% highlight java %}
 package org.apache.flink.statefun.docs.io.ingress;
@@ -79,22 +95,6 @@ public class ModuleWithIngress implements StatefulFunctionModule {
 }
 {% endhighlight %}
 </div>
-<div data-lang="Remote Module" markdown="1">
-{% highlight yaml %}
-version: "1.0"
-
-module:
-     meta:
-         type: remote
-     spec:
-         ingresses:
-           - ingress:
-               meta:
-                 id: example/user-ingress
-                 type: # ingress type
-               spec: # ingress specific configurations
-{% endhighlight %}
-</div>
 </div>
 
 ## Router
@@ -103,6 +103,15 @@ A router is a stateless operator that takes each record from an ingress and rout
 Routers are bound to the system via a stateful function module, and unlike other components, an ingress may have any number of routers.
 
 <div class="codetabs" markdown="1">
+<div data-lang="Remote Module" markdown="1">
+When defined in ``yaml``, routers are defined by a list of function types.
+The ``id`` component of the address is pulled from the key associated with each record in its underlying source implementation.
+{% highlight yaml %}
+targets:
+    - example-namespace/my-function-1
+    - example-namespace/my-function-2
+{% endhighlight %}
+</div>
 <div data-lang="Embedded Module" markdown="1">
 {% highlight java %}
 package org.apache.flink.statefun.docs.io.ingress;
@@ -146,15 +155,6 @@ public class ModuleWithRouter implements StatefulFunctionModule {
 }
 {% endhighlight %}
 </div>
-<div data-lang="Remote Module" markdown="1">
-When defined in ``yaml``, routers are defined by a list of function types.
-The ``id`` component of the address is pulled from the key associated with each record in its underlying source implementation.
-{% highlight yaml %}
-targets:
-    - example-namespace/my-function-1
-    - example-namespace/my-function-2
-{% endhighlight %}
-</div>
 </div>
 
 ## Egress
@@ -167,6 +167,22 @@ An egress spec defines the details of how to connect to the external system, the
 Each identifier-spec pair are bound to the system inside a stateful function module.
 
 <div class="codetabs" markdown="1">
+<div data-lang="Remote Module" markdown="1">
+{% highlight yaml %}
+version: "1.0"
+
+module:
+    meta:
+        type: remote
+    spec:
+        egresses:
+          - egress:
+              meta:
+                id: example/user-egress
+                type: # egress type
+              spec: # egress specific configurations
+{% endhighlight %}
+</div>
 <div data-lang="Embedded Module" markdown="1">
 {% highlight java %}
 package org.apache.flink.statefun.docs.io.egress;
@@ -205,22 +221,6 @@ public class ModuleWithEgress implements StatefulFunctionModule {
 }
 {% endhighlight %}
 </div>
-<div data-lang="Remote Module" markdown="1">
-{% highlight yaml %}
-version: "1.0"
-
-module:
-    meta:
-        type: remote
-    spec:
-        egresses:
-          - egress:
-              meta:
-                id: example/user-egress
-                type: # egress type
-              spec: # egress specific configurations
-{% endhighlight %}
-</div>
 </div>
 
 Stateful functions may then message an egress the same way they message another function, passing the egress identifier as function type.