storage

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShardOffNotAlignment = errors.New("chunkdata: shard offset not alignment")
	ErrShardHeaderNotMatch  = errors.New("chunkdata: shard header not match")
	ErrChunkDataMagic       = errors.New("chunkdata: magic not match")
	ErrChunkHeaderBufSize   = errors.New("chunkdata: buf size not match")
)
View Source
var (
	ErrShardBufferSize = errors.New("shard buffer size not match")
	ErrShardKeyPrefix  = errors.New("shard key error prefix")
)

Functions

func GenChunkCommonKey

func GenChunkCommonKey(id bnapi.ChunkId) []byte

func GenShardKey

func GenShardKey(id *core.ShardKey) []byte

func NewChunkData

func NewChunkData(ctx context.Context, vm core.VuidMeta, file string, conf *core.Config, createIfMiss bool, ioQos qos.Qos) (
	cd *datafile, err error)

func NewChunkMeta

func NewChunkMeta(ctx context.Context, config *core.Config, meta core.VuidMeta, db db.MetaHandler) (cm *metafile, err error)

func NewReplicateStg

func NewReplicateStg(master core.Storage, slave core.Storage, notify notifyFunc) (replStg core.Storage)

func NewStorage

func NewStorage(meta core.MetaHandler, data core.DataHandler) core.Storage

func NewTinyFileStg

func NewTinyFileStg(underlying core.Storage, size int) core.Storage

Types

type ChunkHeader

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

func (*ChunkHeader) Marshal

func (hdr *ChunkHeader) Marshal() ([]byte, error)

func (*ChunkHeader) String

func (hdr *ChunkHeader) String() string

func (*ChunkHeader) Unmarshal

func (hdr *ChunkHeader) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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