kbgitkbfs1

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: BSD-3-Clause, BSD-3-Clause Imports: 2 Imported by: 0

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.

func (DeleteBlocksRes) DeepCopy

func (o DeleteBlocksRes) DeepCopy() DeleteBlocksRes

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) GetPrefetchStatus

func (c DiskBlockCacheClient) GetPrefetchStatus(ctx context.Context, __arg GetPrefetchStatusArg) (res PrefetchStatus, err error)

GetPrefetchStatus gets the prefetch status 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)
	// GetPrefetchStatus gets the prefetch status from the disk cache.
	GetPrefetchStatus(context.Context, GetPrefetchStatusArg) (PrefetchStatus, 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.

func (GetBlockRes) DeepCopy

func (o GetBlockRes) DeepCopy() GetBlockRes

type GetPrefetchStatusArg

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

type PrefetchStatus

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

func (PrefetchStatus) DeepCopy

func (o PrefetchStatus) DeepCopy() PrefetchStatus

func (PrefetchStatus) String

func (e PrefetchStatus) String() string

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 {
	TlfID          []byte         `codec:"tlfID" json:"tlfID"`
	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