You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/04/29 12:03:55 UTC
[1/2] camel git commit: [CAMEL-9869] Create Apache Flink Component
Repository: camel
Updated Branches:
refs/heads/master 1608f76e7 -> a3f468c27
[CAMEL-9869] Create Apache Flink Component
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4c5b9c03
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4c5b9c03
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4c5b9c03
Branch: refs/heads/master
Commit: 4c5b9c032207caca2068007fc1943736f4f68dde
Parents: 1608f76
Author: Subhobrata Dey <sb...@gmail.com>
Authored: Thu Apr 28 22:40:04 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Apr 29 11:59:50 2016 +0200
----------------------------------------------------------------------
components/camel-flink/src/main/docs/flink.adoc | 103 +++++++++++++++++++
1 file changed, 103 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/4c5b9c03/components/camel-flink/src/main/docs/flink.adoc
----------------------------------------------------------------------
diff --git a/components/camel-flink/src/main/docs/flink.adoc b/components/camel-flink/src/main/docs/flink.adoc
new file mode 100644
index 0000000..1660a66
--- /dev/null
+++ b/components/camel-flink/src/main/docs/flink.adoc
@@ -0,0 +1,103 @@
+[[camel-flink-CamelFlinkComponent]]
+Camel Flink Component
+~~~~~~~~~~~~~~~~~~~~~
+
+*Available as of Camel 2.18*
+
+This documentation page covers the https://flink.apache.org[Apache Flink]
+component for the Apache Camel. The�*camel-flink*�component provides a
+bridge between Camel connectors and Flink tasks. +
+This Camel Flink connector provides a way to route message from various
+transports, dynamically choosing a flink task to execute, use incoming
+message as input data for the task and finally deliver the results back to
+the Camel pipeline.
+
+Maven users will need to add the following dependency to
+their�`pom.xml`�for this component:
+
+[source,xml]
+------------------------------------------------------------
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-flink</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+------------------------------------------------------------
+
+[[camel-flink-URIFormat]]
+URI Format
+^^^^^^^^^^
+
+Currently, the Flink Component supports only Producers. One can create DataSet, DataStream jobs.
+
+[source,java]
+-------------------------------------------------
+flink:dataset?dataset=#myDataSet&dataSetCallback=#dataSetCallback
+flink:datastream?datastream=#myDataStream&dataStreamCallback=#dataStreamCallback
+-------------------------------------------------
+
+Flink DataSet Callback
+^^^^^^^^^^^^^^^^^^^^^^
+
+[source,java]
+-----------------------------------
+@Bean
+public DataSetCallback<Long> dataSetCallback() {
+ return new DataSetCallback<Long>() {
+ public Long onDataSet(DataSet dataSet, Object... objects) {
+ try {
+ dataSet.print();
+ return new Long(0);
+ } catch (Exception e) {
+ return new Long(-1);
+ }
+ }
+ };
+}
+-----------------------------------
+
+Flink DataStream Callback
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+[source,java]
+---------------------------
+@Bean
+public VoidDataStreamCallback dataStreamCallback() {
+ return new VoidDataStreamCallback() {
+ @Override
+ public void doOnDataStream(DataStream dataStream, Object... objects) throws Exception {
+ dataStream.flatMap(new Splitter()).print();
+
+ environment.execute("data stream test");
+ }
+ };
+}
+---------------------------
+
+Camel-Flink Producer call
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+[source,java]
+-----------------------------------
+CamelContext camelContext = new SpringCamelContext(context);
+
+String pattern = "foo";
+
+try {
+ ProducerTemplate template = camelContext.createProducerTemplate();
+ camelContext.start();
+ Long count = template.requestBody("flink:dataSet?dataSet=#myDataSet&dataSetCallback=#countLinesContaining", pattern, Long.class);
+ } finally {
+ camelContext.stop();
+ }
+-----------------------------------
+
+See Also
+^^^^^^^^
+
+* link:configuring-camel.html[Configuring Camel]
+* link:component.html[Component]
+* link:endpoint.html[Endpoint]
+* link:getting-started.html[Getting Started]
+
[2/2] camel git commit: Component docs. This closes #969
Posted by da...@apache.org.
Component docs. This closes #969
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a3f468c2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a3f468c2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a3f468c2
Branch: refs/heads/master
Commit: a3f468c27f7831249fce35403c47fe67ed8d8c16
Parents: 4c5b9c0
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Apr 29 12:03:46 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Apr 29 12:03:46 2016 +0200
----------------------------------------------------------------------
components/camel-flink/src/main/docs/flink.adoc | 44 ++++++++++++++++++++
1 file changed, 44 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/a3f468c2/components/camel-flink/src/main/docs/flink.adoc
----------------------------------------------------------------------
diff --git a/components/camel-flink/src/main/docs/flink.adoc b/components/camel-flink/src/main/docs/flink.adoc
index 1660a66..d337530 100644
--- a/components/camel-flink/src/main/docs/flink.adoc
+++ b/components/camel-flink/src/main/docs/flink.adoc
@@ -37,6 +37,50 @@ flink:dataset?dataset=#myDataSet&dataSetCallback=#dataSetCallback
flink:datastream?datastream=#myDataStream&dataStreamCallback=#dataStreamCallback
-------------------------------------------------
+[[Flink-FlinkEndpointOptions]]
+FlinkEndpoint Options
+
+
+// endpoint options: START
+The Apache Flink component supports 8 endpoint options which are listed below:
+
+[width="100%",cols="2s,1,1m,1m,5",options="header"]
+|=======================================================================
+| Name | Group | Default | Java Type | Description
+| endpointType | producer | | EndpointType | *Required* Type of the endpoint (dataset datastream).
+| collect | producer | true | boolean | Indicates if results should be collected or counted.
+| dataSet | producer | | DataSet | DataSet to compute against.
+| dataSetCallback | producer | | DataSetCallback | Function performing action against a DataSet.
+| dataStream | producer | | DataStream | DataStream to compute against.
+| dataStreamCallback | producer | | DataStreamCallback | Function performing action against a DataStream.
+| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange
+| synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
+|=======================================================================
+// endpoint options: END
+
+
+[[Flink-FlinkComponentOptions]]
+FlinkComponent Options
+^^^^^^^^^^^^^^^^^^^^
+
+
+// component options: START
+The Apache Flink component supports 4 options which are listed below.
+
+
+
+[width="100%",cols="2s,1m,8",options="header"]
+|=======================================================================
+| Name | Java Type | Description
+| dataSet | DataSet | DataSet to compute against.
+| dataStream | DataStream | DataStream to compute against.
+| dataSetCallback | DataSetCallback | Function performing action against a DataSet.
+| dataStreamCallback | DataStreamCallback | Function performing action against a DataStream.
+|=======================================================================
+// component options: END
+
+
+
Flink DataSet Callback
^^^^^^^^^^^^^^^^^^^^^^