set

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppendFile

type AppendFile struct {
	// contains filtered or unexported fields
}

func NewAppendFile

func NewAppendFile(logSize, step int, appendFile string) (*AppendFile, error)

func (*AppendFile) ApplyAddress

func (a *AppendFile) ApplyAddress() (int64, error)

func (*AppendFile) Contains

func (a *AppendFile) Contains(data []byte, offset int64) (bool, int, error)

func (*AppendFile) Delete

func (a *AppendFile) Delete(data []byte, offset int64) (bool, error)

func (*AppendFile) Write

func (a *AppendFile) Write(data []byte, offset int64) error

type DataSet

type DataSet struct {
	// contains filtered or unexported fields
}

func NewDataSet

func NewDataSet(m *FixedSizeFileMap, a *AppendFile) *DataSet

func (*DataSet) Add

func (d *DataSet) Add(data []byte) error

func (*DataSet) Contains

func (d *DataSet) Contains(data []byte) (bool, error)

func (*DataSet) Remove

func (d *DataSet) Remove(data []byte) (bool, error)

Remove

type FixedSizeFileMap

type FixedSizeFileMap struct {
	// contains filtered or unexported fields
}

FixedSizeFileMap is a fixed size file map.

func NewFileMap

func NewFileMap(slotNum, slotSize int, binlogFile string) (*FixedSizeFileMap, error)

NewFileMap creates a new FixedSizeFileMap.

func (*FixedSizeFileMap) Delete

func (m *FixedSizeFileMap) Delete(slotIndex int) error

Delete deletes data of a slot.

slotIndex begin from 0,

func (*FixedSizeFileMap) Read

func (m *FixedSizeFileMap) Read(slotIndex int) ([]byte, error)

Read reads slot data from binlog file.

func (*FixedSizeFileMap) SlotNum

func (m *FixedSizeFileMap) SlotNum() int

func (*FixedSizeFileMap) SlotSize

func (m *FixedSizeFileMap) SlotSize() int

func (*FixedSizeFileMap) SlotSnapshot

func (m *FixedSizeFileMap) SlotSnapshot() []byte

func (*FixedSizeFileMap) Write

func (m *FixedSizeFileMap) Write(slotIndex int, data []byte) error

Write writes data in a slot.

slotIndex begin from 0,
data is slot data.

Directories

Path Synopsis
set

Jump to

Keyboard shortcuts

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