adding rsockets support into JDK

Alan Bateman Alan.Bateman at oracle.com
Sun Apr 15 16:27:42 UTC 2018


On 12/04/2018 20:44, Lu, Yingqi wrote:
> Dear all,
>
> I have created a new version of the patch which is available at http://cr.openjdk.java.net/~ylu/8195160.01/. There are also two class diagrams available at http://cr.openjdk.java.net/~ylu/8195160-class-diagram.pdf which describe the high level interactions between RDMA Sockets and regular Sockets.
>
> In this version, I have added RDMA support to Socket, ServerSocket, SocketChannel and ServerSocketChannel. All the newly introduced classes are added into jdk.net module. Before I continue with the effort, I would like to get some feedback to see if this is a reasonable approach to enable the feature.
>
Good to see this moved to the jdk.net module. One initial concern is the 
API surface:

jdk.net.RdmaSocket
jdk.net.RdmaServerSocket
jdk.net.RdmaSocketImpl
jdk.net.RdmaSocketOptions
jdk.net.RdmaSocketChannel
jdk.net.RdmaServerSocketChannel
jdk.net.RdmaNet ???

RdmaSocketOptions aside, I don't think these classes need to be in the 
API. Instead I think it would be simpler to add factory to 
jdk.net.Sockes so you can do this:

Socket s = jdk.net.Sockets.openRdmaSocket();
ServerSocket ss = jdk.net.Sockets.openRdmaServerSocket();

These methods will be specified to throw UOE when not supported on the 
platform.

jdk.net.RdmaSocketOptions looks right although some of the constants are 
probably not meant to be exposed in the API.

The NIO channels will be similar, and just needs deciding if they should 
be created by factory methods on jdk.net.Sockets or whether to introduce 
a new factory class in the jdk.nio package.

One thing that I can't immediately understand from the webrev is how to 
obtain a Selector that can be used with an RDMA selectable channel. In 
previous mails you mentioned that RDMA socket can only be multiplexed 
with rpoll. No issue introducing a epoll based Selector but it's not 
clear how to obtain this in the API as the method to create this 
Selector is in the non-exported rdma.ch package. If it helps, I'm happy 
to sketch out how this could work with a factory method to obtain a 
capable Selector.

I see the current patch is based on JDK 10 and some of the code that you 
have cloned has changed significantly in the jdk/jdk repo. You will need 
to re-base at some point.

Not important yet but I see you've changed the no-arg InetAdress 
constructor to be public. We can't do that so at some point we will need 
to explain how accept can work outside of the java.net package.

That's all I have now, I'm happy to do a more detail pass when you are 
ready.

-Alan



More information about the nio-dev mailing list