Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageQueueExt ¶
type MessageQueueExt struct {
message.MessageQueue
Offset int64 `json:"offset"`
}
type OffsetSerializeWrapper ¶
type OffsetSerializeWrapper struct {
// 保存每个队列的offset
sync.RWMutex `json:"-"`
OffsetTable map[string]MessageQueueExt `json:"offsetTable"`
}
func NewOffsetSerializeWrapper ¶
func NewOffsetSerializeWrapper() *OffsetSerializeWrapper
type OffsetStore ¶
type OffsetStore interface {
Load()
// Persist all offsets,may be in local storage or remote name server
// Set<MessageQueue>
PersistAll(mqs set.Set)
// Persist the offset,may be in local storage or remote name server
Persist(mq *message.MessageQueue)
// Remove offset
RemoveOffset(mq *message.MessageQueue)
// Get offset from local storage
ReadOffset(mq *message.MessageQueue, rType ReadOffsetType) int64
// Update the offset,store it in memory
UpdateOffset(mq *message.MessageQueue, offset int64, increaseOnly bool)
}
type ReadOffsetType ¶
type ReadOffsetType int
const ( READ_FROM_MEMORY ReadOffsetType = iota READ_FROM_STORE MEMORY_FIRST_THEN_STORE )
func (ReadOffsetType) String ¶
func (rType ReadOffsetType) String() string
Source Files
¶
- offset_serialize_wrapper.go
- offset_store.go
- read_offset_type.go
Click to show internal directories.
Click to hide internal directories.