org.apache.kafka.common.network
Interface Selectable

All Known Implementing Classes:
Selector

public interface Selectable

An interface for asynchronous, multi-channel network I/O


Method Summary
 void close()
          Close this selector
 java.util.List<NetworkReceive> completedReceives()
          The list of receives that completed on the last poll() call.
 java.util.List<NetworkSend> completedSends()
          The list of sends that completed on the last poll() call.
 void connect(int id, java.net.InetSocketAddress address, int sendBufferSize, int receiveBufferSize)
          Begin establishing a socket connection to the given address identified by the given address
 java.util.List<java.lang.Integer> connected()
          The list of connections that completed their connection on the last poll() call.
 void disconnect(int id)
          Begin disconnecting the connection identified by the given id
 java.util.List<java.lang.Integer> disconnected()
          The list of connections that finished disconnecting on the last poll() call.
 void poll(long timeout, java.util.List<NetworkSend> sends)
          Initiate any sends provided, and make progress on any other I/O operations in-flight (connections, disconnections, existing sends, and receives)
 void wakeup()
          Wakeup this selector if it is blocked on I/O
 

Method Detail

connect

void connect(int id,
             java.net.InetSocketAddress address,
             int sendBufferSize,
             int receiveBufferSize)
             throws java.io.IOException
Begin establishing a socket connection to the given address identified by the given address

Parameters:
id - The id for this connection
address - The address to connect to
sendBufferSize - The send buffer for the socket
receiveBufferSize - The receive buffer for the socket
Throws:
java.io.IOException - If we cannot begin connecting

disconnect

void disconnect(int id)
Begin disconnecting the connection identified by the given id


wakeup

void wakeup()
Wakeup this selector if it is blocked on I/O


close

void close()
Close this selector


poll

void poll(long timeout,
          java.util.List<NetworkSend> sends)
          throws java.io.IOException
Initiate any sends provided, and make progress on any other I/O operations in-flight (connections, disconnections, existing sends, and receives)

Parameters:
timeout - The amount of time to block if there is nothing to do
sends - The new sends to initiate
Throws:
java.io.IOException

completedSends

java.util.List<NetworkSend> completedSends()
The list of sends that completed on the last poll() call.


completedReceives

java.util.List<NetworkReceive> completedReceives()
The list of receives that completed on the last poll() call.


disconnected

java.util.List<java.lang.Integer> disconnected()
The list of connections that finished disconnecting on the last poll() call.


connected

java.util.List<java.lang.Integer> connected()
The list of connections that completed their connection on the last poll() call.