org.apache.s4.comm.tcp
Class TCPEmitter
java.lang.Object
org.apache.s4.comm.tcp.TCPEmitter
- All Implemented Interfaces:
- Emitter, ClusterChangeListener
- Direct Known Subclasses:
- TCPRemoteEmitter
public class TCPEmitter
- extends java.lang.Object
- implements Emitter, ClusterChangeListener
TCPEmitter - Uses TCP to send messages across partitions.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TCPEmitter
@Inject
public TCPEmitter(Cluster topology,
int timeout)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
send
public boolean send(int partitionId,
EventMessage message)
- Specified by:
send
in interface Emitter
- Parameters:
partitionId
- - destination partitionmessage
- - message payload that needs to be sent
- Returns:
- - true - if message is sent across successfully - false - if send fails
removeChannel
protected void removeChannel(int partition)
close
public void close()
- Specified by:
close
in interface Emitter
onChange
public void onChange()
- Specified by:
onChange
in interface ClusterChangeListener
getPartitionCount
public int getPartitionCount()
- Specified by:
getPartitionCount
in interface Emitter