@Target(value=PARAMETER) @Retention(value=RUNTIME) @Documented public @interface Spill
CoGroup and GroupSort operator methods.
A parameter with this annotation may have too many elements in its list.
In such the case, we spill the elements into a temporary file, and flush the elements from the Java heap.
With this annotation, obtaining elements from the sequence will change the previously obtained object.
For example, the operations are not guaranteed in the following case:
@CoGroup
public void invalid(@Key(...) @Spill List<Hoge> input, Result<Hoge> result) {
Hoge a = input.get(0);
Hoge b = input.get(1); // this operation may break out contents of 'a'
...
}
In such the case, application developers should create a copy of the object:
final Hoge a = new Hoge();
final Hoge b = new Hoge();
@CoGroup
public void invalid(@Key(...) @Spill List<Hoge> input, Result<Hoge> result) {
a.copyFrom(input.get(0)); // take a copy
b.copyFrom(input.get(1));
...
}
OnceCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.