org.apache.ignite.stream

## Class StreamAdapter<T,K,V>

- java.lang.Object
- - org.apache.ignite.stream.StreamAdapter<T,K,V>

Direct Known Subclasses:
  SocketStreamer

    public abstract class StreamAdapter<T,K,V>
    extends Object

Convenience adapter for streamers. Adapters are optional components for streaming from different data sources. The purpose of adapters is to convert different message formats into Ignite stream key-value tuples and feed the tuples into the provided `IgniteDataStreamer`.

### Constructor Summary

Constructors
`protected` `StreamAdapter()` Empty constructor.
`protected` `StreamAdapter(IgniteDataStreamer<K,V> stmr, StreamTupleExtractor<T,K,V> extractor)` Stream adapter.

### Method Summary

Methods
`protected void` `addMessage(T msg)` Converts given message to a tuple and adds it to the underlying streamer.
`Ignite` `getIgnite()`
`IgniteDataStreamer<K,V>` `getStreamer()`
`StreamTupleExtractor<T,K,V>` `getTupleExtractor()`
`void` `setIgnite(Ignite ignite)`
`void` `setStreamer(IgniteDataStreamer<K,V> stmr)`
`void` `setTupleExtractor(StreamTupleExtractor<T,K,V> extractor)`

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

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

### Constructor Detail

#### StreamAdapter

    protected StreamAdapter()

Empty constructor.

#### StreamAdapter

    protected StreamAdapter(IgniteDataStreamer<K,V> stmr,
                 StreamTupleExtractor<T,K,V> extractor)

Stream adapter.

Parameters:
  `stmr` - Streamer.
  `extractor` - Tuple extractor.

### Method Detail

#### getStreamer

    public IgniteDataStreamer<K,V> getStreamer()

Returns:
  Provided data streamer.

#### setStreamer

    public void setStreamer(IgniteDataStreamer<K,V> stmr)

Parameters:
  `stmr` - Ignite data streamer.

#### getTupleExtractor

    public StreamTupleExtractor<T,K,V> getTupleExtractor()

Returns:
  Provided tuple extractor.

#### setTupleExtractor

    public void setTupleExtractor(StreamTupleExtractor<T,K,V> extractor)

Parameters:
  `extractor` - Extractor for key-value tuples from messages.

#### getIgnite

    public Ignite getIgnite()

Returns:
  Provided `Ignite` instance.

#### setIgnite

    public void setIgnite(Ignite ignite)

Parameters:
  `ignite` - `Ignite` instance.

#### addMessage

    protected void addMessage(T msg)

Converts given message to a tuple and adds it to the underlying streamer.

Parameters:
  `msg` - Message to convert.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.3.0-incubating
Release Date | : July 10 2015