com.ibm.net.rdma.jverbs.endpoints

Class RdmaEndpoint

  • java.lang.Object
    • com.ibm.net.rdma.jverbs.endpoints.RdmaEndpoint
  • Direct Known Subclasses:
    RdmaActiveEndpoint


    public class RdmaEndpoint
    extends java.lang.Object
    This class represents an RDMA endpoint similar to Socket. Conceptually, endpoints behave like sockets for control operations (e.g., connect(), disconnect()), but behave like RDMA ConnectionId's once connected (offering preparePostSend(), preparePostRecv(), registerMemory()). The default queue pair created assumes MAX_SGE as 10 and MAX_WR as 400. To create queue pair with preferred size override createQueuePair of RdmaActiveEndpointGroup class by extending as custom EndPointGroup class
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Close this endpoint. This closes the connection and free's all the resources like queue pair.
        Throws:
        java.io.IOException - If an I/O error occurs
      • connect

        public void connect(java.net.SocketAddress destinationAddress,
                            int timeout)
                     throws java.lang.IllegalArgumentException,
                            java.io.IOException
        Connect this endpoint to a remote server endpoint. This method does resolve address and route before making connection.
        Parameters:
        destinationAddress - the IP address of the remote server endpoint.
        timeout - not supported.
        Throws:
        java.io.IOException - If an I/O error occurs like Address or Route can not be resolved.
        java.lang.IllegalArgumentException - If the value of any of the parameter is invalid
      • deregisterMemory

        public void deregisterMemory(MemoryRegion memoryRegion)
                              throws java.lang.IllegalArgumentException,
                                     java.io.IOException
        Deregister memory.
        Parameters:
        memoryRegion - the memory region to be de-registered.
        Throws:
        java.lang.IllegalArgumentException
        java.io.IOException
      • getConnectionId

        public ConnectionId getConnectionId()
        Gets the connection id of this endpoint.
        Returns:
        the RDMA connection identifier.
      • getDestinationAddress

        public java.net.SocketAddress getDestinationAddress()
                                                     throws java.io.IOException
        Gets the destination address of this endpoint.
        Returns:
        the dst addr.
        Throws:
        java.io.IOException
      • getDestinationPort

        public int getDestinationPort()
                               throws java.io.IOException
        Gets the destination port of this endpoint.
        Returns:
        the dst port.
        Throws:
        java.io.IOException
      • getProtectionDomain

        public ProtectionDomain getProtectionDomain()
        Returns the protection domain.
        Returns:
        the protection domain..
      • getQueuePair

        public QueuePair getQueuePair()
        Gets the Queue Pair (QP) of this connection.
        Returns:
        the Queue Pair (QP).
      • getSourceAddress

        public java.net.SocketAddress getSourceAddress()
                                                throws java.io.IOException
        Gets the source address of this endpoint.
        Returns:
        the src addr.
        Throws:
        java.io.IOException - If an I/O error occurs
      • getSourcePort

        public int getSourcePort()
                          throws java.io.IOException
        Gets the source port of this endpoint.
        Returns:
        the src port.
        Throws:
        java.io.IOException
      • isClosed

        public boolean isClosed()
        Checks if the endpoint is closed.
        Returns:
        true, if is closed
      • isConnected

        public boolean isConnected()
        Checks if the endpoint is connected.
        Returns:
        true, if is connected
      • preparePostReceive

        public PostReceiveMethod preparePostReceive(java.util.List<ReceiveWorkRequest> receiveList)
                                             throws java.lang.IllegalArgumentException,
                                                    java.io.IOException
        Post a receive operation on this endpoint.
        Parameters:
        receiveList - list of receive requests.
        Returns:
        a stateful verb method (SVM) ready to execute the receive operations.
        Throws:
        java.lang.IllegalArgumentException
        java.io.IOException
      • preparePostSend

        public PostSendMethod preparePostSend(java.util.List<SendWorkRequest> sendList)
                                       throws java.lang.IllegalArgumentException,
                                              java.io.IOException
        Post a send operation on this endpoint.
        Parameters:
        sendList - list of send requests.
        Returns:
        a stateful verb method (SVM) ready to execute the send operations.
        Throws:
        java.lang.IllegalArgumentException
        java.io.IOException
      • registerMemory

        public RegisterMemoryRegionMethod registerMemory(java.nio.ByteBuffer buffer)
                                                  throws java.lang.IllegalArgumentException,
                                                         java.io.IOException
        Register memory on this endpoint.
        Parameters:
        buffer - the buffer to be registered. The buffer needs to represent off-heap memory.
        Returns:
        a stateful verb method (SVM) ready to execute the memory registration.
        Throws:
        java.lang.IllegalArgumentException
        java.io.IOException