基于Java的RDMA高性能通信库(五):JXIO

JXIO 是 Mellanox 公司的RDMA中间件accelio在Java上的包装,JXIO使用类似于Java nio的ServerChannel方式,熟悉接口可以做好变换。AcceliO是针对硬件加速而优化的高性能异步可靠消息传递和RPC库。 实现RDMA和TCP / IP传输,并且其他传输(例如共享存储器)可以利用高效且方便的API。

libxio(又名库accelio)是一个位于RDMA之上的轻量级消息传递库。该库为零拷贝消息传递和无锁定可扩展性,提供了异步消息传递设计。由于Accelio是基于C++高性能通信库,AcceliO相应的提出了Java上的开发库JXIO,我们利用JXIO就可用调用Accelio高性能,异步,可靠消息传递和远程过程调用(RPC)的库,其中包括高性能RDMA传输通信接口。

JXIO使用广泛,包括RDMA for Hadoop Distributed FileSystem,其中使用的RDMA通信库就是JXIO。但是现如今JXIO项目已经两年停滞更新了。最近的Mellanox 公司推出的SparkRDMA,4个月前刚刚更新。其中使用的就是IBM的RDMA高性能通信框架DiSNI,可以看出JXIO渐渐被DiSNI所替代。下面我们介绍一下JXIO的使用。

1.Build instructions

1. Download: git clone https://github.com/accelio/JXIO.git
2. Move into folder: cd JXIO
3. Set JAVA_HOME: export JAVA_HOME=/usr/java/jdk1.7.0_25/
4. Build: ./build.sh (this pulls the relevant C level Accelio library and builds everything you need)

2.Examples

在examples文件夹中有HelloWorld示例。 客户端和服务器都是单线程的。 客户端向服务器发送单个消息,并在收到响应后退出。JXIO开源地址:https://github.com/accelio/JXIO

  1. Run Server side: ./examples/runHelloWorld.sh server 36.0.0.120 1234
    LD library is: /.autodirect/mtrswgwork/katyak/tmp/jxio/examples
    Compiling JAVA files....
    Running Server side test
    2014-02-16 11:17:35,013 main INFO HelloServer:44 waiting for JXIO incoming connections
    2014-02-16 11:17:46,576 main INFO HelloServer:90 [SUCCESS] Got event onSessionNew from 36.0.0.121, URI='rdma://36.0.0.120:1234/'
    2014-02-16 11:17:46,578 main INFO HelloServer:108 [SUCCESS] Got a message request! Prepare the champagne!
    2014-02-16 11:17:46,579 main INFO HelloServer:116 msg is: 'Hello Server'
    2014-02-16 11:17:46,583 main INFO HelloServer:135 [EVENT] Got event SESSION_CLOSED

  2. Run Client side: ./examples/runHelloWorld.sh client 36.0.0.120 1234
    LD library is: /.autodirect/mtrswgwork/katyak/tmp/jxio/examples
    Compiling JAVA files....
    Running Client side test...
    2014-02-16 11:17:46,552 main INFO HelloClient:68 Try to establish a new session to 'rdma://36.0.0.120:1234/'
    2014-02-16 11:17:46,580 main INFO HelloClient:102 [SUCCESS] Session established! Hurray !
    2014-02-16 11:17:46,581 main INFO HelloClient:106 [SUCCESS] Got a message! Bring the champagne!
    2014-02-16 11:17:46,582 main INFO HelloClient:114 msg is: 'Hello to you too, Client'
    2014-02-16 11:17:46,582 main INFO HelloClient:118 Closing the session...
    2014-02-16 11:17:46,585 main INFO HelloClient:126 [EVENT] Got event SESSION_CLOSED
    2014-02-16 11:17:46,586 main INFO HelloClient:57 Client is releasing JXIO resources and exiting

猜你喜欢

转载自blog.csdn.net/qq_21125183/article/details/81134142