v9.6.2017.0808   重构正向工程,基于映射表查找数据库字段类型到实体类型的映射
大石头 authored at 2017-08-08 21:38:06
1.46 KiB
X
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NewLife.Queue.Protocols;

namespace NewLife.Queue.Broker
{
    public interface IMessageStore
    {
        /// <summary>
        /// 
        /// </summary>
        long MinMessagePosition { get; }
        /// <summary>
        /// 
        /// </summary>
        long CurrentMessagePosition { get; }
        /// <summary>
        /// 
        /// </summary>
        int ChunkCount { get; }
        /// <summary>
        /// 
        /// </summary>
        int MinChunkNum { get; }
        /// <summary>
        /// 
        /// </summary>
        int MaxChunkNum { get; }
        /// <summary>
        /// 
        /// </summary>
        void Load();
        /// <summary>
        /// 
        /// </summary>
        void Start();
        /// <summary>
        /// 
        /// </summary>
        void Shutdown();

        void StoreMessageAsync(IQueue queue, Message message, Action<MessageLogRecord, object> callback, object parameter, string producerAddress);
        void BatchStoreMessageAsync(IQueue queue, IEnumerable<Message> messages, Action<BatchMessageLogRecord, object> callback, object parameter, string producerAddress);
        byte[] GetMessageBuffer(long position);
        QueueMessage GetMessage(long position);
        bool IsMessagePositionExist(long position);
        void UpdateMinConsumedMessagePosition(long minConsumedMessagePosition);
    }
}