org.apache.storm.topology.base

## Class BaseRichSpout

- java.lang.Object
- - org.apache.storm.topology.base.BaseComponent
  - - org.apache.storm.topology.base.BaseRichSpout

- All Implemented Interfaces:
    Serializable, ISpout, IComponent, IRichSpout
  Direct Known Subclasses:
    AnchoredWordCount.RandomSentenceSpout, BlobStoreAPIWordCountTopology.RandomSentenceSpout, BucketTestHiveTopology.UserDataSpout, CheckpointSpout, ConstSpout, DRPCSpout, EsIndexTopology.UserDataSpout, EventHubSpout, ExclamationTopology.FixedOrderWordSpout, FastWordCountTopology.FastRandomSentenceSpout, FeederSpout, FileReadSpout, HdfsFileTopology.SentenceSpout, HdfsSpout, HiveTopology.UserDataSpout, HiveTopologyPartitioned.UserDataSpout, IncrementingSpout, InOrderDeliveryTest.InOrderSpout, JmsSpout, KafkaSpout, KinesisSpout, LambdaSpout, LoadSpout, MasterBatchCoordinator, MetricGenSpout, RandomIntegerSpout, RandomSentenceSpout, RawInputFromCSVSpout, SequenceFileTopology.SentenceSpout, SolrFieldsSpout, SolrJsonSpout, SpoutTracker, StringGenSpout, TestEventLogSpout, TestPlannerSpout, TestWordSpout, TimeDataIncrementingSpout, WordGenSpout

      public abstract class BaseRichSpout
      extends BaseComponent
      implements IRichSpout

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseRichSpout()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `ack(Object msgId)` Storm has determined that the tuple emitted by this spout with the msgId identifier has been fully processed.
    `void` | `activate()` Called when a spout has been activated out of a deactivated mode.
    `void` | `close()` Called when an ISpout is going to be shutdown.
    `void` | `deactivate()` Called when a spout has been deactivated.
    `void` | `fail(Object msgId)` The tuple emitted by this spout with the msgId identifier has failed to be fully processed.

    - ### Methods inherited from class org.apache.storm.topology.base.BaseComponent

      `getComponentConfiguration`

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

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

    - ### Methods inherited from interface org.apache.storm.spout.ISpout

      `nextTuple, open`

    - ### Methods inherited from interface org.apache.storm.topology.IComponent

      `declareOutputFields, getComponentConfiguration`

- - ### Constructor Detail

    - #### BaseRichSpout

          public BaseRichSpout()

  - ### Method Detail

    - #### close

          public void close()

      Description copied from interface: `ISpout`

      Called when an ISpout is going to be shutdown. There is no guarentee that close will be called, because the supervisor kill -9’s worker processes on the cluster.

      The one context where close is guaranteed to be called is a topology is killed when running Storm in local mode.

      Specified by:
        `close` in interface `ISpout`

    - #### activate

          public void activate()

      Description copied from interface: `ISpout`

      Called when a spout has been activated out of a deactivated mode. nextTuple will be called on this spout soon. A spout can become activated after having been deactivated when the topology is manipulated using the `storm` client.

      Specified by:
        `activate` in interface `ISpout`

    - #### deactivate

          public void deactivate()

      Description copied from interface: `ISpout`

      Called when a spout has been deactivated. nextTuple will not be called while a spout is deactivated. The spout may or may not be reactivated in the future.

      Specified by:
        `deactivate` in interface `ISpout`

    - #### ack

          public void ack(Object msgId)

      Description copied from interface: `ISpout`

      Storm has determined that the tuple emitted by this spout with the msgId identifier has been fully processed. Typically, an implementation of this method will take that message off the queue and prevent it from being replayed.

      Specified by:
        `ack` in interface `ISpout`

    - #### fail

          public void fail(Object msgId)

      Description copied from interface: `ISpout`

      The tuple emitted by this spout with the msgId identifier has failed to be fully processed. Typically, an implementation of this method will put that message back on the queue to be replayed at a later time.

      Specified by:
        `fail` in interface `ISpout`

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