org.apache.ignite.stream.storm

## Class StormStreamer<K,V>

- java.lang.Object
- - org.apache.ignite.stream.StreamAdapter<org.apache.storm.tuple.Tuple,K,V>
  - - org.apache.ignite.stream.storm.StormStreamer<K,V>

- All Implemented Interfaces:
    Serializable, org.apache.storm.task.IBolt, org.apache.storm.topology.IComponent, org.apache.storm.topology.IRichBolt

      public class StormStreamer<K,V>
      extends StreamAdapter<org.apache.storm.tuple.Tuple,K,V>
      implements org.apache.storm.topology.IRichBolt

  Apache Storm streamer implemented as a Storm bolt. Obtaining data from other bolts and spouts is done by the specified tuple field.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StormStreamer.StreamerContext` Streamer context initializing grid and data streamer instances on demand.

  - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.stream.StreamAdapter

      `ignite`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StormStreamer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup()` Cleans up the streamer when the bolt is going to shutdown.
    `void` | `declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer declarer)` Normally declares output fields for the stream of the topology.
    `void` | `execute(org.apache.storm.tuple.Tuple tuple)` Transfers data into grid.
    `boolean` | `getAllowOverwrite()` Obtains flag for enabling overwriting existing values in cache.
    `long` | `getAutoFlushFrequency()` Obtains data flush frequency.
    `String` | `getCacheName()` Gets the cache name.
    `Map<String,Object>` | `getComponentConfiguration()` Not used.
    `String` | `getIgniteConfigFile()` Gets Ignite configuration file.
    `String` | `getIgniteTupleField()` Gets Ignite tuple field, by which tuple data is obtained in topology.
    `void` | `prepare(Map map, org.apache.storm.task.TopologyContext topologyContext, org.apache.storm.task.OutputCollector collector)` Initializes Ignite client instance from a configuration file and declares the output collector of the bolt.
    `void` | `setAllowOverwrite(boolean allowOverwrite)` Enables overwriting existing values in cache.
    `void` | `setAutoFlushFrequency(long autoFlushFrequency)` Specifies data flush frequency into the grid.
    `void` | `setCacheName(String cacheName)` Sets the cache name.
    `void` | `setIgniteConfigFile(String igniteConfigFile)` Specifies Ignite configuration file.
    `void` | `setIgniteTupleField(String igniteTupleField)` Names Ignite tuple field, by which tuple data is obtained in topology.
    `void` | `start()` Starts streamer.
    `void` | `stop()` Stops streamer.

    - ### Methods inherited from class org.apache.ignite.stream.StreamAdapter

      `addMessage, getIgnite, getMultipleTupleExtractor, getSingleTupleExtractor, getStreamer, getTupleExtractor, setIgnite, setMultipleTupleExtractor, setSingleTupleExtractor, setStreamer, setTupleExtractor`

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

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

- - ### Constructor Detail

    - #### StormStreamer

          public StormStreamer()

  - ### Method Detail

    - #### getIgniteTupleField

          public String getIgniteTupleField()

      Gets Ignite tuple field, by which tuple data is obtained in topology.
      Returns:
        Tuple field.

    - #### setIgniteTupleField

          public void setIgniteTupleField(String igniteTupleField)

      Names Ignite tuple field, by which tuple data is obtained in topology.
      Parameters:
        `igniteTupleField` - Name of tuple field.

    - #### getCacheName

          public String getCacheName()

      Gets the cache name.
      Returns:
        Cache name.

    - #### setCacheName

          public void setCacheName(String cacheName)

      Sets the cache name.
      Parameters:
        `cacheName` - Cache name.

    - #### getIgniteConfigFile

          public String getIgniteConfigFile()

      Gets Ignite configuration file.
      Returns:
        Configuration file.

    - #### setIgniteConfigFile

          public void setIgniteConfigFile(String igniteConfigFile)

      Specifies Ignite configuration file.
      Parameters:
        `igniteConfigFile` - Ignite config file.

    - #### getAutoFlushFrequency

          public long getAutoFlushFrequency()

      Obtains data flush frequency.
      Returns:
        Flush frequency.

    - #### setAutoFlushFrequency

          public void setAutoFlushFrequency(long autoFlushFrequency)

      Specifies data flush frequency into the grid.
      Parameters:
        `autoFlushFrequency` - Flush frequency.

    - #### getAllowOverwrite

          public boolean getAllowOverwrite()

      Obtains flag for enabling overwriting existing values in cache.
      Returns:
        True if overwriting is allowed, false otherwise.

    - #### setAllowOverwrite

          public void setAllowOverwrite(boolean allowOverwrite)

      Enables overwriting existing values in cache.
      Parameters:
        `allowOverwrite` - Flag value.

    - #### start

          public void start()
                     throws IgniteException

      Starts streamer.
      Throws:
        `IgniteException` - If failed.

    - #### stop

          public void stop()
                    throws IgniteException

      Stops streamer.
      Throws:
        `IgniteException` - If failed.

    - #### prepare

          public void prepare(Map map,
                              org.apache.storm.task.TopologyContext topologyContext,
                              org.apache.storm.task.OutputCollector collector)

      Initializes Ignite client instance from a configuration file and declares the output collector of the bolt.
      Specified by:
        `prepare` in interface `org.apache.storm.task.IBolt`
      Parameters:
        `map` - Map derived from topology.
        `topologyContext` - Context topology in storm.
        `collector` - Output collector.

    - #### execute

          public void execute(org.apache.storm.tuple.Tuple tuple)

      Transfers data into grid.
      Specified by:
        `execute` in interface `org.apache.storm.task.IBolt`
      Parameters:
        `tuple` - Storm tuple.

    - #### cleanup

          public void cleanup()

      Cleans up the streamer when the bolt is going to shutdown.
      Specified by:
        `cleanup` in interface `org.apache.storm.task.IBolt`

    - #### declareOutputFields

          public void declareOutputFields(org.apache.storm.topology.OutputFieldsDeclarer declarer)

      Normally declares output fields for the stream of the topology. Empty because we have no tuples for any further processing.
      Specified by:
        `declareOutputFields` in interface `org.apache.storm.topology.IComponent`
      Parameters:
        `declarer` - OutputFieldsDeclarer.

    - #### getComponentConfiguration

          public Map<String,Object> getComponentConfiguration()

      Not used.
      Specified by:
        `getComponentConfiguration` in interface `org.apache.storm.topology.IComponent`
      Returns:
        Configurations.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020