Documentation ¶
Index ¶
- Variables
- func DiskBlockCacheProtocol(i DiskBlockCacheInterface) rpc.Protocol
- type DeleteBlocksArg
- type DeleteBlocksRes
- type DiskBlockCacheClient
- func (c DiskBlockCacheClient) DeleteBlocks(ctx context.Context, blockIDs [][]byte) (res DeleteBlocksRes, err error)
- func (c DiskBlockCacheClient) GetBlock(ctx context.Context, __arg GetBlockArg) (res GetBlockRes, err error)
- func (c DiskBlockCacheClient) GetPrefetchStatus(ctx context.Context, __arg GetPrefetchStatusArg) (res PrefetchStatus, err error)
- func (c DiskBlockCacheClient) PutBlock(ctx context.Context, __arg PutBlockArg) (err error)
- func (c DiskBlockCacheClient) UpdateBlockMetadata(ctx context.Context, __arg UpdateBlockMetadataArg) (err error)
- type DiskBlockCacheInterface
- type GetBlockArg
- type GetBlockRes
- type GetPrefetchStatusArg
- type PrefetchStatus
- type PutBlockArg
- type UpdateBlockMetadataArg
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 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 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 UpdateBlockMetadataArg ¶
type UpdateBlockMetadataArg struct { TlfID []byte `codec:"tlfID" json:"tlfID"` BlockID []byte `codec:"blockID" json:"blockID"` PrefetchStatus PrefetchStatus `codec:"prefetchStatus" json:"prefetchStatus"` }
Click to show internal directories.
Click to hide internal directories.