Interface PeerServer

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
DomainPeerServer, TcpPeerServer

@Private public interface PeerServer extends Closeable
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.hdfs.net.Peer
    Listens for a connection to be made to this server and accepts it.
    void
    Free the resources associated with this peer server.
     
    int
    Get the receive buffer size of the PeerServer.
    void
    Set the receive buffer size of the PeerServer.
  • Method Details

    • setReceiveBufferSize

      void setReceiveBufferSize(int size) throws IOException
      Set the receive buffer size of the PeerServer.
      Parameters:
      size - The receive buffer size.
      Throws:
      IOException
    • getReceiveBufferSize

      int getReceiveBufferSize() throws IOException
      Get the receive buffer size of the PeerServer.
      Returns:
      The receive buffer size.
      Throws:
      IOException
    • accept

      org.apache.hadoop.hdfs.net.Peer accept() throws IOException, SocketTimeoutException
      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 its checkAccept method 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

      void close() throws IOException
      Free the resources associated with this peer server. This normally includes sockets, etc.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException - If there is an error closing the PeerServer