jhunters / bigqueue

Golang implements for BigQueue
Apache License 2.0
57 stars 23 forks source link

add Status method to watch current queue file status #15

Closed jhunters closed 3 years ago

jhunters commented 3 years ago

method defines as follow: func (q FileQueue) Status() QueueFilesStatus

type QueueFilesStatus struct { // front index of the big queue, FrontIndex int64

// head index of the array, this is the read write barrier.
// readers can only read items before this index, and writes can write this index or after
HeadIndex int64

// tail index of the array,
// readers can't read items before this tail
TailIndex int64

// head index of the data page, this is the to be appended data page index
HeadDataPageIndex int64

// head offset of the data page, this is the to be appended data offset
HeadDataItemOffset int64

IndexFileList []*QueueFileInfo
DataFileList  []*QueueFileInfo
MetaFileInfo  *QueueFileInfo
FrontFileInfo *QueueFileInfo

}

// queue file info type QueueFileInfo struct { Name string Path string Size int64 }