public class SocketStreamer<T,K,V> extends StreamAdapter<T,K,V>
StreamTupleExtractor
and
streams into IgniteDataStreamer
instance.
By default server uses size-based message processing. That is every message sent over the socket is prepended with
4-byte integer header containing message size. If message delimiter is defined (see setDelimiter(byte[])
) then
delimiter-based message processing will be used. That is every message sent over the socket is appended with
provided delimiter.
Received messages through socket converts to Java object using standard serialization. Conversion functionality
can be customized via user defined SocketMessageConverter
(e.g. in order to convert messages from
non Java clients).
ignite
Constructor and Description |
---|
SocketStreamer() |
Modifier and Type | Method and Description |
---|---|
void |
setAddr(InetAddress addr)
Sets server address.
|
void |
setConverter(SocketMessageConverter<T> converter)
Sets message converter.
|
void |
setDelimiter(byte[] delim)
Sets message delimiter.
|
void |
setDirectMode(boolean directMode)
Sets direct mode flag.
|
void |
setPort(int port)
Sets port number.
|
void |
setThreads(int threads)
Sets threadds amount.
|
void |
start()
Starts streamer.
|
void |
stop()
Stops streamer.
|
addMessage, getIgnite, getMultipleTupleExtractor, getSingleTupleExtractor, getStreamer, getTupleExtractor, setIgnite, setMultipleTupleExtractor, setSingleTupleExtractor, setStreamer, setTupleExtractor
public void setAddr(InetAddress addr)
addr
- Address.public void setPort(int port)
port
- Port.public void setThreads(int threads)
threads
- Threads.public void setDirectMode(boolean directMode)
directMode
- Direct mode.public void setDelimiter(byte[] delim)
delim
- Delimiter.public void setConverter(SocketMessageConverter<T> converter)
converter
- Converter.public void start()
IgniteException
- If failed.public void stop()
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024