stratosphere/stratosphere — pull request #319 by aljoscha (2013-12-04 15:01:11+00:00)
Title: Rich scala stubs

Change map operator to allow a map stub with open/close etc. You might call them rich stubs, but in the code it's just MapStub, FlatMapStub, or FilterStub. They derive from MapStub (the java one), so you can do things like getting the iteration context or what you might have...

This allows something like:
```scala
.map( new MapStub[(String, Int), (String, Int)] {
override def open(config: Configuration) = {
println("Opening up this badboy.")
}
override def map(in: (String, Int)) = {
println("IN RICH MAPPER: " + in)
val (w, c) = in
(w, c + 1)
}
})
```
and likewise for flatMap and filter, for example:
```scala
.map( new FlatMapStub[(String, Int), (String, Int)] {
override def open(config: Configuration) = {
println("Opening up this badboy.")
}
override def flatMap(in: (String, Int)) = {
println("IN RICH MAPPER: " + in)
in
}
})
```

If people like this I will also make this available for all the other operators.