blobstore

package
v3.0.0-beta-rc.1+incom... Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxRetryTimes      = 3
	RetrySleepInterval = 100 * time.Millisecond
)
View Source
const (
	MaxBufferSize = 512 * util.MB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStoreClient

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

func NewEbsClient

func NewEbsClient(cfg access.Config) (*BlobStoreClient, error)

func (*BlobStoreClient) Delete

func (ebs *BlobStoreClient) Delete(oeks []proto.ObjExtentKey) (err error)

func (*BlobStoreClient) Read

func (ebs *BlobStoreClient) Read(ctx context.Context, volName string, buf []byte, offset uint64, size uint64, oek proto.ObjExtentKey) (readN int, err error)

func (*BlobStoreClient) Write

func (ebs *BlobStoreClient) Write(ctx context.Context, volName string, data []byte) (location access.Location, err error)

type ClientConfig

type ClientConfig struct {
	VolName         string
	VolType         int
	BlockSize       int
	Ino             uint64
	Bc              *bcache.BcacheClient
	Mw              *meta.MetaWrapper
	Ec              *stream.ExtentClient
	Ebsc            *BlobStoreClient
	EnableBcache    bool
	WConcurrency    int
	ReadConcurrency int
	CacheAction     int
	FileCache       bool
	FileSize        uint64
	CacheThreshold  int
}

type Instance

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

func New

func New(worker int, size int) Instance

func (Instance) Close

func (r Instance) Close()

func (Instance) Execute

func (r Instance) Execute(op *rwSlice, fn func(op *rwSlice))

type Reader

type Reader struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewReader

func NewReader(config ClientConfig) (reader *Reader)

func (*Reader) Close

func (reader *Reader) Close(ctx context.Context)

func (*Reader) Read

func (reader *Reader) Read(ctx context.Context, buf []byte, offset int, size int) (int, error)

func (*Reader) String

func (reader *Reader) String() string

type Writer

type Writer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(config ClientConfig) (writer *Writer)

func (*Writer) CacheFileSize

func (writer *Writer) CacheFileSize() int

func (*Writer) Flush

func (writer *Writer) Flush(ino uint64, ctx context.Context) (err error)

func (*Writer) String

func (writer *Writer) String() string

func (*Writer) Write

func (writer *Writer) Write(ctx context.Context, offset int, data []byte, flags int) (size int, err error)

Jump to

Keyboard shortcuts

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