Java 套接字直接协议
众所周知,套接字直接协议(SDP)提供了对高性能网络连接的访问,例如 InfiniBand 提供的连接,
任何人都可以给我任何一个很好的例子,说明如何使用 java 的套接字直接协议(SDP)吗?
As we know the Sockets Direct Protocol (SDP) provides access to high performance network connections, such as that provided by InfiniBand
can any one please give me any good example of how can i use Sockets Direct Protocol (SDP) of java ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在运行最新版本的 Solaris 或 OpenSolaris,我想您已经准备好尝试一些东西了。
Linux 需要使用 libsdp 库和 外部内核模块可从 OpenFabrics (OFED) 获得,似乎有强烈的愿望将这些模块纳入 Linux 主线,但 OFED 的人似乎在一些问题上与内核开发人员发生了错误的冲突涉及。
有一个有用的 Debian Linux 下的 Infiniband 设置指南,其中详细介绍了如何设置并编译 OFED 内核模块和 libsdp 库等。完成后,您可以按照 SDP 部分,以便使 SDP 正常工作并进行测试。
之后,我认为这就像获取最近的 JDK7 快照(目前在 M12)一样简单,然后尝试一下。 设置您的配置并在 SDP 配置中指定的地址之间创建连接,所有这些都通过与网络套接字相同的 API,即用于“旧”IO 的 Socket 和用于NIO(甚至是 JDK7 中的 AIO:)。据我所知,一旦您遵循了设置指南并配置了将使用 SDP 的地址,只要您提供 SDP 映射范围内的地址,JVM 就会使用基于 SDP 的 Sockets/SocketChannel。因此,您现有的使用套接字的网络代码应该能够透明地使用 SDP 连接,并且速度极快且延迟极小。
据我所知,Windows 用户暂时运气不佳。
另外:
Alan Bateman 的 SDP 博客文章(Oracle JDK SDP 负责人)
If you are running a recent version of Solaris or OpenSolaris I think you are all set to try stuff out.
Linux requires use of the libsdp library and external kernel modules available from OpenFabrics (OFED), there seems to be strong desire to get the modules into Linux mainline but OFED guys seem to be rubbing the kernel developers up the wrong way over some of the issues involved.
There's a useful setup guide for Infiniband under Debian Linux which gives details on how to set up and compile the OFED kernel modules and the libsdp library etc. Once you have that done you can follow the SDP section of that how-to in order to get SDP working and tested.
After that I think it is as simple as getting a recent JDK7 snapshot, currently at M12, and trying stuff out. Set up your config and create connections between addresses specified in your SDP config, all done via the same APIs as network sockets, i.e. Socket for 'old' IO, and SocketChannel for NIO (or even AIO in JDK7 :). As far as I can see, once you have followed the set up guides and configured the addresses that will use SDP the JVM will use SDP based Sockets/SocketChannels whenever you provide addresses within the SDP mapped range. So your existing networking code that uses sockets should be able to use the SDP connections transparently, just at blazingly fast speeds and tiny latencies.
Windows users are out of luck for the time being, as far as I can tell.
Also:
Alan Bateman's SDP blog entry (Oracle JDK SDP lead)