client

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ShardStatusNotExist shard not exist code
	ShardStatusNotExist = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobNodeClient

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

BlobNodeClient blobnode client

func (*BlobNodeClient) GetShard

func (c *BlobNodeClient) GetShard(ctx context.Context, location proto.VunitLocation, bid proto.BlobID, ioType api.IOType) (body io.ReadCloser, crc32 uint32, err error)

GetShard returns shard data

func (*BlobNodeClient) ListShards

func (c *BlobNodeClient) ListShards(ctx context.Context, location proto.VunitLocation) (sis []*ShardInfo, err error)

ListShards return shards info

func (*BlobNodeClient) PutShard

func (c *BlobNodeClient) PutShard(ctx context.Context, location proto.VunitLocation, bid proto.BlobID, size int64, body io.Reader, ioType api.IOType) (err error)

PutShard put data to shard

func (*BlobNodeClient) StatChunk

func (c *BlobNodeClient) StatChunk(ctx context.Context, location proto.VunitLocation) (ci *ChunkInfo, err error)

StatChunk returns chunk stat

func (*BlobNodeClient) StatShard

func (c *BlobNodeClient) StatShard(ctx context.Context, location proto.VunitLocation, bid proto.BlobID) (si *ShardInfo, err error)

StatShard return shard stat

type ChunkInfo

type ChunkInfo struct {
	api.ChunkInfo
}

ChunkInfo chunk info

func (*ChunkInfo) Locked

func (c *ChunkInfo) Locked() bool

Locked return true if chunk is locked

type IBlobNode

type IBlobNode interface {
	StatChunk(ctx context.Context, location proto.VunitLocation) (ci *ChunkInfo, err error)
	StatShard(ctx context.Context, location proto.VunitLocation, bid proto.BlobID) (si *ShardInfo, err error)
	ListShards(ctx context.Context, location proto.VunitLocation) (shards []*ShardInfo, err error)
	GetShard(ctx context.Context, location proto.VunitLocation, bid proto.BlobID, ioType api.IOType) (body io.ReadCloser, crc32 uint32, err error)
	PutShard(ctx context.Context, location proto.VunitLocation, bid proto.BlobID, size int64, body io.Reader, ioType api.IOType) (err error)
}

IBlobNode define the interface of blobnode used for worker

func NewBlobNodeClient

func NewBlobNodeClient(conf *api.Config) IBlobNode

NewBlobNodeClient returns blobnode client

type ShardInfo

type ShardInfo struct {
	api.ShardInfo
}

ShardInfo shard info

func (*ShardInfo) MarkDeleted

func (si *ShardInfo) MarkDeleted() bool

MarkDeleted return true if shard is mark delete

func (*ShardInfo) Normal

func (si *ShardInfo) Normal() bool

Normal return true if shard is normal

func (*ShardInfo) NotExist

func (si *ShardInfo) NotExist() bool

NotExist returns true if shard is not exist

Jump to

Keyboard shortcuts

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