/** * Subscribe the feed of publisher. To prevent cycles, a task can only subscribe to its ancestor. * Feed is a generic form of execution-time feedback (type, value) pair from one task to another * task. Examples include dynamic partitions (which are only available at execution time). The * MoveTask may pass the list of dynamic partitions to the StatsTask since after the MoveTask the * list of dynamic partitions are lost (MoveTask moves them to the table's destination directory * which is mixed with old partitions). * * @param publisher this feed provider. */ public void subscribeFeed(Task<? extends Serializable> publisher) { if (publisher != this && publisher.ancestorOrSelf(this)) { if (publisher.getFeedSubscribers() == null) { publisher.setFeedSubscribers(new LinkedList<Task<? extends Serializable>>()); } publisher.getFeedSubscribers().add(this); } }