mmap

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name     = "mmap-queue"
	ShowName = "Mmap Queue"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue struct {
	config.CommonFields
	SegmentSize           int   `mapstructure:"segment_size"`            // The size of each segment. The unit is byte.
	MaxInMemSegments      int32 `mapstructure:"max_in_mem_segments"`     // The max num of segments in memory.
	QueueCapacitySegments int   `mapstructure:"queue_capacity_segments"` // The capacity of Queue = segment_size * queue_capacity_segments.
	FlushPeriod           int   `mapstructure:"flush_period"`            // The period flush time. The unit is ms.
	FlushCeilingNum       int   `mapstructure:"flush_ceiling_num"`       // The max number in one flush time.
	MaxEventSize          int   `mapstructure:"max_event_size"`          // The max size of the input event.
	// contains filtered or unexported fields
}

Queue is a memory mapped queue to store the input data.

func (*Queue) Ack

func (q *Queue) Ack(lastOffset *event.Offset)

func (*Queue) Close

func (q *Queue) Close() error

func (*Queue) DefaultConfig

func (q *Queue) DefaultConfig() string

func (*Queue) Dequeue

func (q *Queue) Dequeue() (*api.SequenceEvent, error)

func (*Queue) Description

func (q *Queue) Description() string

func (*Queue) Enqueue

func (q *Queue) Enqueue(e *v1.SniffData) error

func (*Queue) GetIndex

func (q *Queue) GetIndex(segmentID int64) int

GetIndex returns the index of the segments.

func (*Queue) GetSegment

func (q *Queue) GetSegment(segmentID int64) (*mmap.File, error)

GetSegment returns a memory mapped file at the segmentID position.

func (*Queue) Initialize

func (q *Queue) Initialize() error

func (*Queue) IsFull added in v0.4.0

func (q *Queue) IsFull() bool

func (*Queue) Name

func (q *Queue) Name() string

func (*Queue) ShowName added in v0.4.0

func (q *Queue) ShowName() string

func (*Queue) TotalSize added in v0.4.0

func (q *Queue) TotalSize() int64

func (*Queue) UsedCount added in v0.4.0

func (q *Queue) UsedCount() int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL