rocketmq-baiji / rocketmq

Mirror of Apache RocketMQ
Apache License 2.0
4 stars 20 forks source link

Create BufferMessageStore Group 9 #20

Open A-MuMu opened 5 years ago

A-MuMu commented 5 years ago

ISSUE https://github.com/rocketmq-baiji/rocketmq/issues/1

What is the purpose of the change

实现一个非持久化的broker

思路

考虑队列堆积等情况,我们采用堆外内存.

  1. Start: 采用ByteBuffer.allocatDirect()分配内存
  2. Shutdown:采用Runtime.getRuntime().freeMemory();释放空间
  3. putMessage:采用wrap(ByteBuffer, int offset, int length)进行存储,并记录更新偏移位置offset
  4. getMessage :采用get(ByteBuffer, int offset, int length)进行定向读取缓存数据。

Brief changelog

add a java class

Verifying this change

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.