Documentation ¶
Index ¶
- Constants
- func CreateCacheObject(capacity int64, handle *Handle)
- func Delete(key HandleID)
- func GetHandles() *sync.Map
- type Buffers
- type Cache
- type Handle
- func (handle *Handle) Cached() bool
- func (handle *Handle) Cleanup()
- func (handle *Handle) Dirty() bool
- func (handle *Handle) FD() int
- func (handle *Handle) Fsynced() bool
- func (handle *Handle) GetFileObject() *os.File
- func (handle *Handle) GetValue(key string) (interface{}, bool)
- func (handle *Handle) RemoveValue(key string) (interface{}, bool)
- func (handle *Handle) SetFileObject(f *os.File)
- func (handle *Handle) SetValue(key string, value interface{})
- type HandleID
Constants ¶
View Source
const ( HandleFlagUnknown uint16 = iota HandleFlagDirty // File has been modified with write operation or is a new file HandleFlagFSynced // User has called fsync on the file explicitly HandleFlagCached // File is cached in the local system by cloudfuse HandleOpenedAppend // File is opened for Append )
Flags represented in BitMap for various flags in the handle
Variables ¶
This section is empty.
Functions ¶
func CreateCacheObject ¶
Types ¶
type Cache ¶
type Cache struct { sync.RWMutex *cache_policy.LRUCache *common.BlockOffsetList StreamOnly bool HandleCount int64 }
Structure to hold in memory cache for streaming layer
type Handle ¶
type Handle struct { sync.RWMutex FObj *os.File // File object being represented by this handle CacheObj *Cache // Streaming layer cache for this handle Buffers *Buffers ID HandleID // Cloudfuse assigned unique ID to this handle Size int64 // Size of the file being handled here Mtime time.Time UnixFD uint64 // Unix FD created by create/open syscall OptCnt uint64 // Number of operations done on this file Flags common.BitMap16 // Various states of the file Path string // Always holds path relative to mount dir, same as object name (uses common.JoinUnixFilepath) // contains filtered or unexported fields }
func LoadAndDelete ¶ added in v1.6.0
Delete : Remove handle object from map, and return the entry (if any)
func Store ¶
Store function must not be used in production application. This is a utility function present only for test scenarios.
func (*Handle) Cleanup ¶
func (handle *Handle) Cleanup()
Cleanup : Delete all user defined parameter from handle
func (*Handle) GetFileObject ¶
GetFileObject : Get the OS.File handle stored within
func (*Handle) RemoveValue ¶
GetValue : Retrieve user defined parameter from handle
func (*Handle) SetFileObject ¶
SetFileObject : Store the OS.File handle
Click to show internal directories.
Click to hide internal directories.