Documentation ¶
Index ¶
- Constants
- type Addressable
- type Block
- func (b *Block) Delete(store KVStore)
- func (b Block) GetId() int64
- func (b Block) IsDirty() bool
- func (b *Block) MarkClean()
- func (b *Block) MarkDirty()
- func (b *Block) ReadBlock(m Marshalable, store KVStore) error
- func (b *Block) SetId(id int64)
- func (b *Block) WriteBlock(m Marshalable, store KVStore) error
- type BlockGenerator
- type BuddyFS
- type Cacheable
- type DataBlock
- type Dir
- func (dir Dir) Attr(ctx context.Context, attr *fuse.Attr) error
- func (dir *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (fs.Node, fs.Handle, error)
- func (dir *Dir) Forget()
- func (dir *Dir) Lookup(ctx context.Context, name string) (fs.Node, error)
- func (dir *Dir) LookupUnlocked(ctx context.Context, name string) (bool, int, fs.Node, error)
- func (dir *Dir) Marshal() ([]byte, error)
- func (dir *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, error)
- func (dir *Dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)
- func (dir *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) error
- func (dir *Dir) Unmarshal(data []byte) error
- type FSMeta
- type File
- func (file File) Attr(ctx context.Context, attr *fuse.Attr) error
- func (file *File) Flush(ctx context.Context, req *fuse.FlushRequest) error
- func (file *File) Forget()
- func (file *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error
- func (file *File) Marshal() ([]byte, error)
- func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, res *fuse.OpenResponse) (fs.Handle, error)
- func (file *File) Read(ctx context.Context, req *fuse.ReadRequest, res *fuse.ReadResponse) error
- func (file *File) Release(ctx context.Context, req *fuse.ReleaseRequest) error
- func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, res *fuse.SetattrResponse) error
- func (file *File) Unmarshal(data []byte) error
- func (file *File) Write(ctx context.Context, req *fuse.WriteRequest, res *fuse.WriteResponse) error
- type GKVStore
- type KVStore
- type Marshalable
- type MemStore
- type RandomizedBlockGenerator
- type Storable
- type StorageUnit
Constants ¶
View Source
const BLOCK_SIZE = 4096
View Source
const ROOT_BLOCK_KEY = "ROOT"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addressable ¶
type Block ¶
func (*Block) WriteBlock ¶
func (b *Block) WriteBlock(m Marshalable, store KVStore) error
type BlockGenerator ¶
type BlockGenerator interface { NewBlock() StorageUnit NewNamedBlock(name string) Block }
type BuddyFS ¶
type BuddyFS struct { Lock sync.Mutex Store KVStore FSM *FSMeta fs.FS // contains filtered or unexported fields }
BuddyFS implements the Buddy file system.
func NewBuddyFS ¶
func (BuddyFS) CreateNewFSMetadata ¶
type DataBlock ¶
type DataBlock struct { StorageUnit Data []byte }
type Dir ¶
type Dir struct { Dirs []Block Files []Block Lock sync.RWMutex `json:"-"` BFS *BuddyFS `json:"-"` KVS KVStore `json:"-"` Block fs.Node // contains filtered or unexported fields }
Dir implements both Node and Handle for the root directory.
func (*Dir) LookupUnlocked ¶
type File ¶
type File struct { Block Blocks []StorageUnit Size uint64 BlockSize uint64 KVS KVStore `json:"-"` BlockCache map[int64]*DataBlock `json:"-"` BFS *BuddyFS `json:"-"` // contains filtered or unexported fields }
TODO: Determine a mechanism to spill over metadata chunks into more block(s). For files which are very large, encoded form of "Blocks" may not fit within a data block.
Currently, we do not consider this case at all. With a 4KB block size, and block list entries being approx 10 bytes long (Block contains a name field which is not always relevant), a File metadata block can contain ~408 block entries, totalling ~1.62MB. With 32K blocks, we can get 102MB. So, this
func (*File) Open ¶
func (file *File) Open(ctx context.Context, req *fuse.OpenRequest, res *fuse.OpenResponse) (fs.Handle, error)
func (*File) Read ¶
func (file *File) Read(ctx context.Context, req *fuse.ReadRequest, res *fuse.ReadResponse) error
func (*File) Setattr ¶
func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, res *fuse.SetattrResponse) error
func (*File) Write ¶
func (file *File) Write(ctx context.Context, req *fuse.WriteRequest, res *fuse.WriteResponse) error
type GKVStore ¶
type GKVStore struct {
// contains filtered or unexported fields
}
func NewGKVStore ¶
func NewGKVStore(collection *gkvlite.Collection, store *gkvlite.Store) *GKVStore
type MemStore ¶
type MemStore struct { KVStore // contains filtered or unexported fields }
func NewMemStore ¶
func NewMemStore() *MemStore
type RandomizedBlockGenerator ¶
type RandomizedBlockGenerator struct { }
func (RandomizedBlockGenerator) NewBlock ¶
func (r RandomizedBlockGenerator) NewBlock() StorageUnit
func (RandomizedBlockGenerator) NewNamedBlock ¶
func (r RandomizedBlockGenerator) NewNamedBlock(name string) Block
type Storable ¶
type Storable interface { WriteBlock(m Marshalable, store KVStore) error ReadBlock(m Marshalable, store KVStore) error Delete(store KVStore) }
type StorageUnit ¶
type StorageUnit interface { Addressable Cacheable Storable }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.