public class TMasterClient extends HeronClient implements java.lang.Runnable
contextMap, messageMap, responseMessageMap
Constructor and Description |
---|
TMasterClient(NIOLooper s,
java.lang.String host,
int port,
HeronSocketOptions options,
Communicator<TopologyMaster.PublishMetrics> publishMetricsCommunicator)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
onClose() |
void |
onConnect(StatusCode status) |
void |
onError() |
void |
onIncomingMessage(com.google.protobuf.Message message) |
void |
onResponse(StatusCode status,
java.lang.Object ctx,
com.google.protobuf.Message response) |
void |
run() |
void |
setReconnectIntervalSec(long interval) |
forceFlushWithBestEffort, getContextMap, getMessageMap, getNIOLooper, getOutstandingPackets, getResponseMessageMap, getSocketChannel, getSocketChannelHelper, handleAccept, handleConnect, handleError, handlePacket, handleRead, handleTimeout, handleWrite, isConnected, registerOnMessage, registerTimerEventInNanoSeconds, registerTimerEventInSeconds, sendMessage, sendRequest, sendRequest, start, startReading, startWriting, stop, stopReading, stopWriting
public TMasterClient(NIOLooper s, java.lang.String host, int port, HeronSocketOptions options, Communicator<TopologyMaster.PublishMetrics> publishMetricsCommunicator)
s
- the NIOLooper bind with this socket clienthost
- the host of remote endpoint to communicate withport
- the port of remote endpoint to communicate withpublishMetricsCommunicator
- the queue to read PublishMetrics from and send to TMasterpublic void setReconnectIntervalSec(long interval)
public void onError()
onError
in class HeronClient
public void onConnect(StatusCode status)
onConnect
in class HeronClient
public void onResponse(StatusCode status, java.lang.Object ctx, com.google.protobuf.Message response)
onResponse
in class HeronClient
public void onIncomingMessage(com.google.protobuf.Message message)
onIncomingMessage
in class HeronClient
public void onClose()
onClose
in class HeronClient
public void run()
run
in interface java.lang.Runnable