flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Wei <tony19920...@gmail.com>
Subject Re: StreamTransformation<T> object
Date Thu, 26 Oct 2017 01:54:31 GMT
Hi Andrea,

How about return `SingleOutputStreamOperator` when you called
`HTM.learn()`, instead of create a new method in the external library.
Since I guessed it called the API of Flink inner that function and the
transformation in Flink, such as map, is actually return
`SingleOutputStreamOperator` [1], I think it is easier to just change the
return type of that function.
And you can leverage the functionality of the `SingleOutputStreamOperator`.
Hope this will help you.

Best Regards,
Tony Wei

[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.3/api/java/org/apache/flink/streaming/api/datastream/DataStream.html#map-org.apache.flink.api.common.functions.MapFunction-

2017-10-26 0:27 GMT+08:00 AndreaKinn <kinn6aer@hotmail.it>:

> Hi,
> I'm using an external library with Flink I'm trying to implement
> slotSharingGroup(String) method on it.
> To do it I looked at SingleOutputStreamOperator Flink's class to see how
> the
> method slotSharingGroup(String) is implemented.
>
> An abstract:
>
> /public class SingleOutputStreamOperator<T> extends DataStream<T> {
>
> SingleOutputStreamOperator(StreamExecutionEnvironment environment,
> StreamTransformation<T> transformation) {
>                 super(environment, transformation);
>         }
>
> SingleOutputStreamOperator<T> slotSharingGroup(String slotSharingGroup) {
>                 transformation.setSlotSharingGroup(slotSharingGroup);
>                 return this;
>         }
> }/
>
> so I changed the constructor of external library class which has to offer
> the slotSharingGroup() method making it more adherent to
> SingleOutputStreamOperator template.
>
> Now my problem is how to call it (see below) because I don't understand
> what
> is StreamTransformation<T> object among the parameters of the constructor
> of
> SingleOutputStreamOperator and how to obtain it in main class.
>
> Following the method I call:
>
> /DataStream<Tuple7&lt;String, String, Date, String, String, Double,
> Double>>
> LCxAccResult = HTM.learn(env, */* what STREAMTRANSFORMATION<T> here?
> */*).slotSharingGroup("group");
> /
>
> Hope you can help me, thanks in advance
> Andrea
>
>
>
> --
> Sent from: http://apache-flink-user-mailing-list-archive.2336050.
> n4.nabble.com/
>

Mime
View raw message