Package org.apache.hadoop.hdfs.net
Interface PeerServer
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DomainPeerServer,TcpPeerServer
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.hdfs.net.Peeraccept()Listens for a connection to be made to this server and accepts it.voidclose()Free the resources associated with this peer server.intGet the receive buffer size of the PeerServer.voidsetReceiveBufferSize(int size) Set the receive buffer size of the PeerServer.
-
Method Details
-
setReceiveBufferSize
Set the receive buffer size of the PeerServer.- Parameters:
size- The receive buffer size.- Throws:
IOException
-
getReceiveBufferSize
Get the receive buffer size of the PeerServer.- Returns:
- The receive buffer size.
- Throws:
IOException
-
accept
Listens for a connection to be made to this server and accepts it. The method blocks until a connection is made.- Throws:
IOException- if an I/O error occurs when waiting for a connection.SecurityException- if a security manager exists and itscheckAcceptmethod doesn't allow the operation.SocketTimeoutException- if a timeout was previously set and the timeout has been reached.
-
getListeningString
String getListeningString()- Returns:
- A string representation of the address we're listening on.
-
close
Free the resources associated with this peer server. This normally includes sockets, etc.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- If there is an error closing the PeerServer
-