tzulitai commented on a change in pull request #63: [FLINK-16557][docs] Document YAML-ized Kafka egresses / ingresses in … URL: https://github.com/apache/flink-statefun/pull/63#discussion_r396062964
########## File path: statefun-docs/docs/io_module/index.rst ########## @@ -32,70 +32,115 @@ Based on the concept of Ingress (input) and Egress (output) points, and built on .. _ingress: Ingress -^^^^^^^^ +======= An Ingress is an input point where data is consumed from an external system and forwarded to zero or more functions. -An ``IngressIdentifier`` and an ``IngressSpec`` define it. +It is defined via an ``IngressIdentifier`` and an ``IngressSpec``. An ingress identifier, similar to a function type, uniquely identifies an ingress by specifying its input type, a namespace, and a name. -.. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/Identifiers.java - :language: java - :lines: 18- +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. -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. +.. tabs:: -.. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/ModuleWithIngress.java - :language: java - :lines: 18- + .. group-tab:: Java + + .. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/Identifiers.java + :language: java + :lines: 18- + + .. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/ModuleWithIngress.java + :language: java + :lines: 18- + + .. group-tab:: Yaml + + .. code-block:: Yaml + + version: "1.0" + + module: + meta: + type: remote + spec: + ingresses: + - ingress: + meta: + id: example/user-ingress + type: # ingress type + spec: # ingress specific configurations Router -"""""" +^^^^^^ A router is a stateless operator that takes each record from an ingress and routes it to zero or more functions. +Routers are bound to the system via a stateful function module, and unlike other components, an ingress may have any number of routers. -.. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/UserRouter.java - :language: java - :lines: 18- +.. tabs:: -Routers are bound to the system via a stateful function module. -Unlike other components, an ingress may have any number of routers. + .. group-tab:: Java -.. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/ModuleWithRouter.java - :language: java - :lines: 18- + .. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/UserRouter.java + :language: java + :lines: 18- + + .. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/ingress/ModuleWithRouter.java + :language: java + :lines: 18- + + .. group-tab:: Yaml + + 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. + .. code-block:: Yaml + + targets: + - example-namespace/my-function-1 + - example-namespace/my-function-2 .. _egress: Egress -^^^^^^ +====== Egress is the opposite of ingress; it is a point that takes messages and writes them to external systems. Each egress is defined using two components, an ``EgressIdentifier`` and an ``EgressSpec``. An egress identifier uniquely identifies an egress based on a namespace, name, and producing type. - -.. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/egress/Identifiers.java - :language: java - :lines: 18- - An egress spec defines the details of how to connect to the external system, the details are specific to each individual I/O module. Each identifier-spec pair are bound to the system inside a stateful function module. -.. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/egress/ModuleWithEgress.java - :language: java - :lines: 18- +.. tabs:: + + .. group-tab:: Java + + .. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/egress/Identifiers.java + :language: java + :lines: 18- + + .. literalinclude:: ../../src/main/java/org/apache/flink/statefun/docs/io/egress/ModuleWithEgress.java + :language: java + :lines: 18- + + .. group-tab:: Yaml + + .. code-block:: Yaml + + version: "1.0" + + module: + meta: + type: remote + spec: + egresses: + - egress: Review comment: Same here: indentation ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
