metadata

package
v0.0.0-...-b177cec Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEntryNotFound = errors.New("metadata: entry not found")
)

Functions

func LoadFromReader

func LoadFromReader(r io.Reader) (*pb.Metadata, error)

func StoreToWriter

func StoreToWriter(w io.Writer, m *pb.Metadata) error

Types

type DataFile

type DataFile interface {
	Name() string
	Type() DataFileType
}

type DataFileType

type DataFileType int
const (
	DataFile_UNSPECIFIED DataFileType = iota
	DataFile_WRITE_LOG
	DataFile_SPARSE_TABLE
)

type Metadata

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

func LoadMetadata

func LoadMetadata(store MetadataStore) (*Metadata, error)

func NewMetadata

func NewMetadata(store MetadataStore, size int64) *Metadata

func NewMetadata_BlockStore

func NewMetadata_BlockStore(store MetadataStore, blockSize int, numBlocks uint64) *Metadata

func (*Metadata) BlockSize

func (m *Metadata) BlockSize() int

func (*Metadata) CompactWriteLog

func (m *Metadata) CompactWriteLog(writeLogName string, sparseFileName string)

func (*Metadata) ListDataFiles

func (m *Metadata) ListDataFiles() []DataFile

func (*Metadata) NumBlocks

func (m *Metadata) NumBlocks() uint64

func (*Metadata) PrependReaderFiles

func (m *Metadata) PrependReaderFiles(fs []string)

func (*Metadata) PushSparseDataFile

func (m *Metadata) PushSparseDataFile(name string)

func (*Metadata) PushWriteLog

func (m *Metadata) PushWriteLog(name string)

func (*Metadata) RemoveSparseDataFile

func (m *Metadata) RemoveSparseDataFile(name string)

func (*Metadata) RemoveWriteLog

func (m *Metadata) RemoveWriteLog(name string)

func (*Metadata) Save

func (m *Metadata) Save() error

func (*Metadata) SaveNoError

func (m *Metadata) SaveNoError()

func (*Metadata) Size

func (m *Metadata) Size() int64

func (*Metadata) String

func (m *Metadata) String() string

type MetadataStore

type MetadataStore interface {
	Load() (*pb.Metadata, error)
	Store(*pb.Metadata) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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