Scala no-parenthesis methods on DataStream

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Scala no-parenthesis methods on DataStream

Stephan Ewen
Hi all!

I just noticed that all Scala DataStream methods like "rebalance",
"broadcast", "shuffle", etc are defined without parenthesis.

I am a bit puzzled about this. Even though these methods do not modify the
DataStream object on which they are called, they define for example a
distributed shuffle, which makes them not really side effect free.

I would define them with parenthesis. If we decide to do this, and since
this is API breaking, we should do it before 1.0

Greetings,
Stephan


PS: I suspect that this comes from the fact that IntelliJ has the annoying
behavior to define all methods with empty parenthesis by default as
no-parenthesis methods.
Reply | Threaded
Open this post in threaded view
|

Re: Scala no-parenthesis methods on DataStream

Aljoscha Krettek-2
Hi,
I see what you mean and I would also feel that they could have parentheses? On the other hand, the methods are really side-effect free, they don’t modify the original stream in any way, they just just create a new “shuffle operator” that will affect operations performed on this shuffled stream.

Cheers,
Aljoscha
> On 17 Jan 2016, at 21:23, Stephan Ewen <[hidden email]> wrote:
>
> am