Class StreamletShadow<R>

  • All Implemented Interfaces:
    Streamlet<R>, StreamletBase<R>
    Direct Known Subclasses:
    KVStreamletShadow

    public class StreamletShadow<R>
    extends StreamletImpl<R>
    StreamletShadow is a special kind of StreamletImpl object: - It is still an StreamletImpl therefore it supports all Streamlet functions like filter() and map(), and can be the parent object of other StreamletImpl objects. Therefore, from API point of view, it can be used in the same way as a normal StreamletImpl object. - However it is just an shadow object of a real StreamletImpl object and it doesn't represent a node in the topology DAG. Therefore it can not be a child of another StreamletImpl object. As the result, the shadow object is clonable, and it is fine to create multiple StreamletShadow objects pointing to the same StreamletImpl object and have different properties. A StreamletShadow object can be used to decorate the real Streamletimpl object. This is important for children StreamletImpl objects to consume output data from the same parent in different ways, such as selecting different stream. Usage: To create a shadow object that selecting "test" stream from an existing StreamletImpl object(stream): StreamletImpl shadow = new StreamletShadow(stream) { Override public String getStreamId() { return "test"; } }