org.apache.storm.trident.testing

## Class FeederBatchSpout

- java.lang.Object
- - org.apache.storm.trident.testing.FeederBatchSpout

- All Implemented Interfaces:
    Serializable, ITridentDataSource, ITridentSpout<Map<Integer,List<List<Object>>>>, IFeeder

      public class FeederBatchSpout
      extends Object
      implements ITridentSpout<Map<Integer,List<List<Object>>>>, IFeeder

  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `FeederBatchSpout.FeederCoordinator`

    - ### Nested classes/interfaces inherited from interface org.apache.storm.trident.spout.ITridentSpout

      `ITridentSpout.BatchCoordinator<X>, ITridentSpout.Emitter<X>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FeederBatchSpout(List<String> fields)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `feed(Object tuples)`
    `Map<String,Object>` | `getComponentConfiguration()`
    `ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>>` | `getCoordinator(String txStateId, Map<String,Object> conf, TopologyContext context)` The coordinator for a TransactionalSpout runs in a single thread and indicates when batches of tuples should be emitted.
    `ITridentSpout.Emitter<Map<Integer,List<List<Object>>>>` | `getEmitter(String txStateId, Map<String,Object> conf, TopologyContext context)` The emitter for a TransactionalSpout runs as many tasks across the cluster.
    `Fields` | `getOutputFields()`
    `void` | `setWaitToEmit(boolean trueIfWait)`

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

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

- - ### Constructor Detail

    - #### FeederBatchSpout

          public FeederBatchSpout(List<String> fields)

  - ### Method Detail

    - #### setWaitToEmit

          public void setWaitToEmit(boolean trueIfWait)

    - #### feed

          public void feed(Object tuples)

      Specified by:
        `feed` in interface `IFeeder`

    - #### getComponentConfiguration

          public Map<String,Object> getComponentConfiguration()

      Specified by:
        `getComponentConfiguration` in interface `ITridentSpout<Map<Integer,List<List<Object>>>>`

    - #### getOutputFields

          public Fields getOutputFields()

      Specified by:
        `getOutputFields` in interface `ITridentSpout<Map<Integer,List<List<Object>>>>`

    - #### getCoordinator

          public ITridentSpout.BatchCoordinator<Map<Integer,List<List<Object>>>> getCoordinator(String txStateId,
                                                                                                Map<String,Object> conf,
                                                                                                TopologyContext context)

      Description copied from interface: `ITridentSpout`

      The coordinator for a TransactionalSpout runs in a single thread and indicates when batches of tuples should be emitted. The Coordinator that you provide in a TransactionalSpout provides metadata for each transaction so that the transactions can be replayed in case of failure.

      Two instances are requested, one on the master batch coordinator where isReady() is called, and an instance in the coordinator bolt which is used for all other operations. The two instances do not necessarily share a worker JVM.

      Specified by:
        `getCoordinator` in interface `ITridentSpout<Map<Integer,List<List<Object>>>>`
      Parameters:
        `txStateId` - stream id
        `conf` - Storm config map
        `context` - topology context
      Returns:
        spout coordinator instance

    - #### getEmitter

          public ITridentSpout.Emitter<Map<Integer,List<List<Object>>>> getEmitter(String txStateId,
                                                                                   Map<String,Object> conf,
                                                                                   TopologyContext context)

      Description copied from interface: `ITridentSpout`

      The emitter for a TransactionalSpout runs as many tasks across the cluster. Emitters are responsible for emitting batches of tuples for a transaction and must ensure that the same batch of tuples is always emitted for the same transaction id.

      All emitter tasks get the same transaction metadata. The topology context parameter contains the instance task id that can be used to distribute the work across the tasks.

      Specified by:
        `getEmitter` in interface `ITridentSpout<Map<Integer,List<List<Object>>>>`
      Parameters:
        `txStateId` - stream id
        `conf` - Storm config map
        `context` - topology context
      Returns:
        spout emitter

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