org.apache.storm.topology

## Class BaseStatefulBoltExecutor.AnchoringOutputCollector

- java.lang.Object
- - org.apache.storm.task.OutputCollector
  - - org.apache.storm.topology.BaseStatefulBoltExecutor.AnchoringOutputCollector

- All Implemented Interfaces:
    IErrorReporter, IOutputCollector
  Enclosing class:
    BaseStatefulBoltExecutor

      protected static class BaseStatefulBoltExecutor.AnchoringOutputCollector
      extends OutputCollector

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<Integer>` | `emit(String streamId, List<Object> tuple)` Emits a new unanchored tuple to the specified stream.
    `void` | `emitDirect(int taskId, String streamId, List<Object> tuple)` Emits a tuple directly to the specified task id on the specified stream.

    - ### Methods inherited from class org.apache.storm.task.OutputCollector

      `ack, emit, emit, emit, emit, emit, emitDirect, emitDirect, emitDirect, emitDirect, emitDirect, fail, flush, reportError, resetTimeout`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### emit

          public List<Integer> emit(String streamId,
                                    List<Object> tuple)

      Description copied from class: `OutputCollector`

      Emits a new unanchored tuple to the specified stream. Because it’s unanchored, if a failure happens downstream, this new tuple won’t affect whether any spout tuples are considered failed or not. The emitted values must be immutable.

      Overrides:
        `emit` in class `OutputCollector`
      Parameters:
        `streamId` - the stream to emit to
        `tuple` - the new output tuple from this bolt
      Returns:
        the list of task ids that this new tuple was sent to

    - #### emitDirect

          public void emitDirect(int taskId,
                                 String streamId,
                                 List<Object> tuple)

      Description copied from class: `OutputCollector`

      Emits a tuple directly to the specified task id on the specified stream. If the target bolt does not subscribe to this bolt using a direct grouping, the tuple will not be sent. If the specified output stream is not declared as direct, or the target bolt subscribes with a non-direct grouping, an error will occur at runtime. Note that this method does not use anchors, so downstream failures won’t affect the failure status of any spout tuples. The emitted values must be immutable.

      Overrides:
        `emitDirect` in class `OutputCollector`
      Parameters:
        `taskId` - the taskId to send the new tuple to
        `streamId` - the stream to send the tuple on. It must be declared as a direct stream in the topology definition.
        `tuple` - the new output tuple from this bolt

Copyright © 2021 The Apache Software Foundation. All rights reserved.