Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorOutOfBounds = errors.New("attempt to read out of bounds")
Functions ¶
This section is empty.
Types ¶
type ChunkCache ¶
type ChunkCacheInMemory ¶
type ChunkCacheInMemory struct {
// contains filtered or unexported fields
}
a global cache for recently accessed file chunks
func NewChunkCacheInMemory ¶
func NewChunkCacheInMemory(maxEntries int64) *ChunkCacheInMemory
func (*ChunkCacheInMemory) GetChunk ¶
func (c *ChunkCacheInMemory) GetChunk(fileId string) []byte
func (*ChunkCacheInMemory) SetChunk ¶
func (c *ChunkCacheInMemory) SetChunk(fileId string, data []byte)
type ChunkCacheVolume ¶
type ChunkCacheVolume struct { DataBackend backend.BackendStorageFile // contains filtered or unexported fields }
func LoadOrCreateChunkCacheVolume ¶
func LoadOrCreateChunkCacheVolume(fileName string, preallocate int64) (*ChunkCacheVolume, error)
func (*ChunkCacheVolume) GetNeedle ¶
func (v *ChunkCacheVolume) GetNeedle(key types.NeedleId) ([]byte, error)
func (*ChunkCacheVolume) Reset ¶
func (v *ChunkCacheVolume) Reset() (*ChunkCacheVolume, error)
func (*ChunkCacheVolume) Shutdown ¶
func (v *ChunkCacheVolume) Shutdown()
func (*ChunkCacheVolume) WriteNeedle ¶
func (v *ChunkCacheVolume) WriteNeedle(key types.NeedleId, data []byte) error
type OnDiskCacheLayer ¶
type OnDiskCacheLayer struct {
// contains filtered or unexported fields
}
func NewOnDiskCacheLayer ¶
func NewOnDiskCacheLayer(dir, namePrefix string, diskSize int64, segmentCount int) *OnDiskCacheLayer
type TieredChunkCache ¶
a global cache for recently accessed file chunks
func NewTieredChunkCache ¶
func NewTieredChunkCache(maxEntries int64, dir string, diskSizeInUnit int64, unitSize int64) *TieredChunkCache
func (*TieredChunkCache) ReadChunkAt ¶
func (*TieredChunkCache) SetChunk ¶
func (c *TieredChunkCache) SetChunk(fileId string, data []byte)
func (*TieredChunkCache) Shutdown ¶
func (c *TieredChunkCache) Shutdown()
Click to show internal directories.
Click to hide internal directories.