caching

package
v0.0.0-...-5fe3b72 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XattrKey      = "user.vdisc-cache-key"
	XattrChecksum = "user.vdisc-cache-checksum"
)

Variables

View Source
var NopCache = nopCache{}

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// WithCaching applies a read-through caching layer to obj
	WithCaching(obj storage.Object) storage.Object
}

func NewCache

func NewCache(slicer Slicer, window int, readAheadTokens int64) Cache

type DiskSlicer

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

func NewDiskSlicer

func NewDiskSlicer(root string, bsize int64) *DiskSlicer

func (*DiskSlicer) Bsize

func (ds *DiskSlicer) Bsize() int64

func (*DiskSlicer) CheckIntegrity

func (ds *DiskSlicer) CheckIntegrity() error

func (*DiskSlicer) Gc

func (ds *DiskSlicer) Gc(threshold GcThreshold)

func (*DiskSlicer) Slice

func (ds *DiskSlicer) Slice(obj storage.Object, offset int64) Slice

func (*DiskSlicer) Wait

func (ds *DiskSlicer) Wait()

type GcThreshold

type GcThreshold interface {
	GcNeeded(st *syscall.Statfs_t) bool
}

type ReadAheadController

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

func NewReadAheadController

func NewReadAheadController(window int, readAheadTokens *semaphore.Weighted, slicer Slicer, obj storage.Object) *ReadAheadController

func (*ReadAheadController) Update

func (rac *ReadAheadController) Update(off int64, n int)

type Slice

type Slice interface {
	storage.AnonymousObject
	ReadAhead()
}

type Slicer

type Slicer interface {
	// Bsize returns the maximum slice size
	Bsize() int64

	// Slice returns a read-through cached slice of an object
	Slice(obj storage.Object, offset int64) Slice
}

func NewMemorySlicer

func NewMemorySlicer(bsize int64, bcount int64) (Slicer, error)

Jump to

Keyboard shortcuts

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