Example #1
0
        /// <summary>
        /// Method for passing user defined operators along with the type information that will transform the DataStream.
        /// </summary>
        /// <typeparam name="TOutput">type of the return stream</typeparam>
        /// <param name="operatorName">name of the operator, for logging purposes</param>
        /// <param name="outTypeInfo">the output type of the operator</param>
        /// <param name="operator">the object containing the transformation logic</param>
        /// <returns>type of the return stream</returns>
        public SingleOutputStreamOperator <TOutput> Transform <TOutput>(
            string operatorName,
            TypeInformation <TOutput> outTypeInfo,
            IOneInputStreamOperator <TElement, TOutput> @operator)
        {
            var resultTransform = new OneInputTransformation <TElement, TOutput>(Transformation, operatorName, @operator, outTypeInfo, ExecutionEnvironment.Parallelism);
            var returnStream    = new SingleOutputStreamOperator <TOutput>(ExecutionEnvironment, resultTransform);

            ExecutionEnvironment.AddOperator(resultTransform);

            return(returnStream);
        }