示例#1
0
  /** 根据offset获取特定消息的存储时间 如果出错,则返回-1 */
  public long pickupStoretimestamp(final long offset, final int size) {
    SelectMapedBufferResult result = this.getMessage(offset, size);
    if (null != result) {
      try {
        return result.getByteBuffer().getLong(MessageDecoder.MessageStoreTimestampPostion);
      } finally {
        result.release();
      }
    }

    return -1;
  }
 public void release() {
   for (SelectMapedBufferResult select : this.messageMapedList) {
     select.release();
   }
 }
 public void addMessage(final SelectMapedBufferResult mapedBuffer) {
   this.messageMapedList.add(mapedBuffer);
   this.messageBufferList.add(mapedBuffer.getByteBuffer());
   this.bufferTotalSize += mapedBuffer.getSize();
 }