nodestorage

package
v0.4.11-testci.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

Variables

View Source
var (
	ErrUnknownSpaceId = errors.New("unknown space id")
	ErrNoLastRecordId = errors.New("no last record id")
)
View Source
var (
	ErrLocked         = errors.New("space storage locked")
	ErrSpaceIdIsEmpty = errors.New("space id is empty")
)

Functions

This section is empty.

Types

type ChangeSizeStats added in v0.4.2

type ChangeSizeStats struct {
	MaxLen int     `json:"maxLen"`
	P95    float64 `json:"p95"`
	Avg    float64 `json:"avg"`
	Median float64 `json:"median"`
	Total  int     `json:"total"`
}

type Config

type Config struct {
	Path string `yaml:"path"`
}

type DeletionStorage added in v0.3.1

type DeletionStorage interface {
	SpaceStatus(spaceId string) (status SpaceStatus, err error)
	SetSpaceStatus(spaceId string, status SpaceStatus) (err error)
	LastRecordId() (id string, err error)
	SetLastRecordId(id string) (err error)
	Close() (err error)
}

func OpenDeletionStorage added in v0.3.1

func OpenDeletionStorage(rootPath string) (ds DeletionStorage, err error)

type NodeStorage

type NodeStorage interface {
	spacestorage.SpaceStorageProvider
	DeletionStorage() DeletionStorage
	SpaceStorage(spaceId string) (spacestorage.SpaceStorage, error)
	TryLockAndDo(spaceId string, do func() error) (err error)
	AllSpaceIds() (ids []string, err error)
	OnDeleteStorage(onDelete func(ctx context.Context, spaceId string))
	OnWriteHash(onWrite func(ctx context.Context, spaceId, hash string))
	StoreDir(spaceId string) (path string)
	DeleteSpaceStorage(ctx context.Context, spaceId string) error
}

func New

func New() NodeStorage

type NodeStorageStats added in v0.4.2

type NodeStorageStats interface {
	GetSpaceStats(treeTop int) (SpaceStats, error)
}

type SpaceStats added in v0.4.2

type SpaceStats struct {
	ObjectsCount        int             `json:"objectsCount,omitempty"`
	DeletedObjectsCount int             `json:"deletedObjectsCount"`
	ChangesCount        int             `json:"changesCount"`
	ChangeSize          ChangeSizeStats `json:"changeSizeStats,omitempty"`
	TreeStats           []TreeStat      `json:"treeStats,omitempty"`
	// contains filtered or unexported fields
}

type SpaceStatus added in v0.3.1

type SpaceStatus int
const (
	SpaceStatusOk SpaceStatus = iota
	SpaceStatusRemove
)

type TreeStat added in v0.4.8

type TreeStat struct {
	Id             string `json:"id"`
	ChangesCount   int    `json:"changesCount"`
	SnapshotsCount int    `json:"snapshotsCount"`
	ChangesSumSize int    `json:"payloadSize"`
}

Directories

Path Synopsis
Package mock_nodestorage is a generated GoMock package.
Package mock_nodestorage is a generated GoMock package.

Jump to

Keyboard shortcuts

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