kbgitkbfs1

package
v1.0.48 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: BSD-3-Clause Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrefetchStatusMap = map[string]PrefetchStatus{
	"NO_PREFETCH":        0,
	"TRIGGERED_PREFETCH": 1,
	"FINISHED_PREFETCH":  2,
}
View Source
var PrefetchStatusRevMap = map[PrefetchStatus]string{
	0: "NO_PREFETCH",
	1: "TRIGGERED_PREFETCH",
	2: "FINISHED_PREFETCH",
}

Functions

func DiskBlockCacheProtocol

func DiskBlockCacheProtocol(i DiskBlockCacheInterface) rpc.Protocol

Types

type DeleteBlocksArg

type DeleteBlocksArg struct {
	BlockIDs [][]byte `codec:"blockIDs" json:"blockIDs"`
}

type DeleteBlocksRes

type DeleteBlocksRes struct {
	NumRemoved  int   `codec:"numRemoved" json:"numRemoved"`
	SizeRemoved int64 `codec:"sizeRemoved" json:"sizeRemoved"`
}

DeleteBlocksRes is the response from DeleteBlocks.

type DiskBlockCacheClient

type DiskBlockCacheClient struct {
	Cli rpc.GenericClient
}

func (DiskBlockCacheClient) DeleteBlocks

func (c DiskBlockCacheClient) DeleteBlocks(ctx context.Context, blockIDs [][]byte) (res DeleteBlocksRes, err error)

DeleteBlocks deletes a set of blocks from the disk cache.

func (DiskBlockCacheClient) GetBlock

func (c DiskBlockCacheClient) GetBlock(ctx context.Context, __arg GetBlockArg) (res GetBlockRes, err error)

GetBlock gets a block from the disk cache.

func (DiskBlockCacheClient) PutBlock

func (c DiskBlockCacheClient) PutBlock(ctx context.Context, __arg PutBlockArg) (err error)

PutBlock puts a block into the disk cache.

func (DiskBlockCacheClient) UpdateBlockMetadata

func (c DiskBlockCacheClient) UpdateBlockMetadata(ctx context.Context, __arg UpdateBlockMetadataArg) (err error)

UpdateBlockMetadata updates the metadata for a block in the disk cache.

type DiskBlockCacheInterface

type DiskBlockCacheInterface interface {
	// GetBlock gets a block from the disk cache.
	GetBlock(context.Context, GetBlockArg) (GetBlockRes, error)
	// PutBlock puts a block into the disk cache.
	PutBlock(context.Context, PutBlockArg) error
	// DeleteBlocks deletes a set of blocks from the disk cache.
	DeleteBlocks(context.Context, [][]byte) (DeleteBlocksRes, error)
	// UpdateBlockMetadata updates the metadata for a block in the disk cache.
	UpdateBlockMetadata(context.Context, UpdateBlockMetadataArg) error
}

DiskBlockCacheInterface specifies how to access a disk cache remotely.

type GetBlockArg

type GetBlockArg struct {
	TlfID   []byte `codec:"tlfID" json:"tlfID"`
	BlockID []byte `codec:"blockID" json:"blockID"`
}

type GetBlockRes

type GetBlockRes struct {
	Buf            []byte         `codec:"buf" json:"buf"`
	ServerHalf     []byte         `codec:"serverHalf" json:"serverHalf"`
	PrefetchStatus PrefetchStatus `codec:"prefetchStatus" json:"prefetchStatus"`
}

GetCachedBlockRes is the response from GetBlock.

type PrefetchStatus

type PrefetchStatus int
const (
	PrefetchStatus_NO_PREFETCH        PrefetchStatus = 0
	PrefetchStatus_TRIGGERED_PREFETCH PrefetchStatus = 1
	PrefetchStatus_FINISHED_PREFETCH  PrefetchStatus = 2
)

type PutBlockArg

type PutBlockArg struct {
	TlfID      []byte `codec:"tlfID" json:"tlfID"`
	BlockID    []byte `codec:"blockID" json:"blockID"`
	Buf        []byte `codec:"buf" json:"buf"`
	ServerHalf []byte `codec:"serverHalf" json:"serverHalf"`
}

type UpdateBlockMetadataArg

type UpdateBlockMetadataArg struct {
	BlockID        []byte         `codec:"blockID" json:"blockID"`
	PrefetchStatus PrefetchStatus `codec:"prefetchStatus" json:"prefetchStatus"`
}

Jump to

Keyboard shortcuts

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