Documentation
¶
Index ¶
- type Metadata
- func (m *Metadata) Close() error
- func (m *Metadata) Flush() error
- func (m *Metadata) GetCapacity() int
- func (m *Metadata) GetCommittedOffset() (segmentID, offset int64)
- func (m *Metadata) GetReadingOffset() (segmentID, offset int64)
- func (m *Metadata) GetVersion() int
- func (m *Metadata) GetWatermarkOffset() (segmentID, offset int64)
- func (m *Metadata) GetWritingOffset() (segmentID, offset int64)
- func (m *Metadata) PutCapacity(version int64)
- func (m *Metadata) PutCommittedOffset(segmentID, offset int64)
- func (m *Metadata) PutReadingOffset(segmentID, offset int64)
- func (m *Metadata) PutVersion(version int64)
- func (m *Metadata) PutWatermarkOffset(segmentID, offset int64)
- func (m *Metadata) PutWritingOffset(segmentID, offset int64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata only needs 80B to store the Metadata for the pipe. But for memory alignment, it takes at least one memory page size, which is generally 4K.
[ 8Bit ][ 8Bit ][ 8Bit ][ 8Bit ][ 8Bit ][ 8Bit ][ 8Bit ][ 8Bit ][ 8Bit ][ 8Bit ] [metaVersion][ ID ][ offset][ ID ][ offset][ ID ][ offset][ ID ][ offset][capacity] [metaVersion][writing offset][watermark offset][committed offset][reading offset][capacity]
func NewMetaData ¶
NewMetaData read or create a Metadata with supported metaVersion
func (*Metadata) GetCapacity ¶
GetCapacity returns the capacity of the queue.
func (*Metadata) GetCommittedOffset ¶
GetCommittedOffset returns the committed offset, which contains the segment ID and the offset of the segment.
func (*Metadata) GetReadingOffset ¶
GetReadingOffset returns the reading offset, which contains the segment ID and the offset of the segment.
func (*Metadata) GetVersion ¶
GetVersion returns the meta version.
func (*Metadata) GetWatermarkOffset ¶
GetWatermarkOffset returns the watermark offset, which contains the segment ID and the offset of the segment.
func (*Metadata) GetWritingOffset ¶
GetWritingOffset returns the writing offset, which contains the segment ID and the offset of the segment.
func (*Metadata) PutCapacity ¶
PutCapacity put the capacity into the memory mapped file.
func (*Metadata) PutCommittedOffset ¶
PutCommittedOffset put the segment ID and the offset of the segment into the committed offset.
func (*Metadata) PutReadingOffset ¶
PutReadingOffset put the segment ID and the offset of the segment into the reading offset.
func (*Metadata) PutVersion ¶
PutVersion put the version into the memory mapped file.
func (*Metadata) PutWatermarkOffset ¶
PutWatermarkOffset put the segment ID and the offset of the segment into the watermark offset.
func (*Metadata) PutWritingOffset ¶
PutWritingOffset put the segment ID and the offset of the segment into the writing offset.