Re: Does Flink allows for encapsulation of transformations?

2016-06-09 Thread Ser Kho
et compute() throws Exception { return this.env.generateSequence(1, NumIter) .map(new Sampler()) .reduce(new SumReducer()) .map(/*return 4 * x*/);} ... public ? computeWhatever(DataSet pi) throws Exception { ... } On 07.06.2016 13:35, Ser Kho wrote

Re: Does Flink allows for encapsulation of transformations?

2016-06-07 Thread Ser Kho
a function in Apache Flink Java setting." Implement CustomUnaryOperation. This can then be applied to a DataSet by calling `DataSet result = DataSet.runOperation(new MyOperation<>(...));`. On Mon, Jun 6, 2016 at 3:14 PM, Ser Kho <khov2...@yahoo.com> wrote: The question is

Re: Does Flink allows for encapsulation of transformations?

2016-06-07 Thread Ser Kho
trying to execute a job within a job. This just doesn't work. your main method should look like this: public static void main(String[] args) throws Exception { double pi = new classPI().compute(); System.out.println("We estimate Pi to be: " + pi); } On 06.06.2016 21:1

Does Flink allows for encapsulation of transformations?

2016-06-06 Thread Ser Kho
The question is how to encapsulate numerous transformations into one object or may be a function in Apache Flink Java setting. I have tried to investigate this question using an example of Pi calculation (see below). I am wondering whether or not the suggested approach is valid from the Flink's