Documentation
¶
Index ¶
- Variables
- func GenerateDirectoryID(parentID, name string, version int) string
- type BackPointer
- type Config
- type DirEntry
- type DirectoryAccessMetadata
- type DirectoryContentMetadata
- type FileHandle
- type FileInfo
- type FileMetadata
- type Filesystem
- func (f *Filesystem) Chmod(path string, mode uint32) error
- func (f *Filesystem) Chown(path string, uid, gid uint32) error
- func (f *Filesystem) Create(path string, flags int, mode uint32) (FileHandle, error)
- func (f *Filesystem) Destroy()
- func (f *Filesystem) Flush(path string, fh FileHandle) error
- func (f *Filesystem) Fsync(path string, datasync bool, fh FileHandle) error
- func (f *Filesystem) Getattr(path string) (*FileInfo, error)
- func (f *Filesystem) Getxattr(path, name string) ([]byte, error)
- func (f *Filesystem) Init() error
- func (f *Filesystem) IsDestroyed() bool
- func (f *Filesystem) IsMounted() bool
- func (f *Filesystem) Link(oldpath, newpath string) error
- func (f *Filesystem) Listxattr(path string) ([]string, error)
- func (f *Filesystem) Mkdir(path string, mode uint32) error
- func (f *Filesystem) Mount() error
- func (f *Filesystem) Open(path string, flags int) (FileHandle, error)
- func (f *Filesystem) Opendir(path string) (FileHandle, error)
- func (f *Filesystem) Read(path string, buf []byte, off int64, fh FileHandle) (int, error)
- func (f *Filesystem) Readdir(path string) ([]DirEntry, error)
- func (f *Filesystem) Readlink(path string) (string, error)
- func (f *Filesystem) RegisterVNode(node vnode.VirtualNode)
- func (f *Filesystem) Release(path string, fh FileHandle) error
- func (f *Filesystem) Releasedir(path string, fh FileHandle) error
- func (f *Filesystem) Removexattr(path, name string) error
- func (f *Filesystem) Rename(oldpath, newpath string) error
- func (f *Filesystem) Rmdir(path string) error
- func (f *Filesystem) SetStorageFallback(node vnode.VirtualNode)
- func (f *Filesystem) Setxattr(path, name string, value []byte, flags int) error
- func (f *Filesystem) Statfs() (*StatInfo, error)
- func (f *Filesystem) Symlink(target, newpath string) error
- func (f *Filesystem) Truncate(path string, size int64, fh FileHandle) error
- func (f *Filesystem) Unlink(path string) error
- func (f *Filesystem) Unmount() error
- func (f *Filesystem) Utimens(path string, atime, mtime *int64) error
- func (f *Filesystem) Write(path string, buf []byte, off int64, fh FileHandle) (int, error)
- type FuseTrace
- type GRPCConfig
- type GRPCMetadataEngine
- func (m *GRPCMetadataEngine) Close() error
- func (m *GRPCMetadataEngine) Conn() *grpc.ClientConn
- func (m *GRPCMetadataEngine) DeleteDirectory(parentID, name string, version int) error
- func (m *GRPCMetadataEngine) GetDirectoryAccessMetadata(pid, name string) (*DirectoryAccessMetadata, error)
- func (m *GRPCMetadataEngine) GetDirectoryContentMetadata(id string) (*DirectoryContentMetadata, error)
- func (m *GRPCMetadataEngine) GetFileMetadata(pid, name string) (*FileMetadata, error)
- func (m *GRPCMetadataEngine) ListDirectory(path string) []DirEntry
- func (m *GRPCMetadataEngine) RenameDirectory(oldPID, oldName, newPID, newName string, version int) error
- func (m *GRPCMetadataEngine) SaveDirectoryAccessMetadata(meta *DirectoryAccessMetadata) error
- func (m *GRPCMetadataEngine) SaveDirectoryContentMetadata(meta *DirectoryContentMetadata) error
- func (m *GRPCMetadataEngine) SaveFileMetadata(meta *FileMetadata) error
- type LegacyMetadataEngine
- type NodeInfo
- type StatInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = fs.ErrNotExist ErrPermission = fs.ErrPermission ErrExist = fs.ErrExist ErrNotDir = syscall.ENOTDIR ErrIsDir = syscall.EISDIR ErrNotEmpty = syscall.ENOTEMPTY ErrReadOnly = syscall.EROFS ErrInvalid = fs.ErrInvalid ErrIO = syscall.EIO ErrNoSpace = syscall.ENOSPC ErrNotSupported = syscall.ENOTSUP ErrNoAttr = syscall.ENODATA // ENOATTR on macOS maps to ENODATA )
Functions ¶
func GenerateDirectoryID ¶
Types ¶
type BackPointer ¶
type Config ¶
type Config struct {
MountPoint string
GatewayAddr string
Token string
Verbose bool
Uid *uint32 // File owner uid (nil = use current user, 0 = root)
Gid *uint32 // File owner gid (nil = use current user, 0 = root)
}
Config configures the filesystem mount
type DirectoryAccessMetadata ¶
type FileHandle ¶
type FileHandle uint64
type FileInfo ¶
type FileMetadata ¶
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
Filesystem is a FUSE filesystem that connects to the gateway via gRPC.
func NewFilesystem ¶
func NewFilesystem(cfg Config) (*Filesystem, error)
NewFilesystem creates a new Filesystem that connects to the gateway via gRPC. All filesystem operations go through the gateway which handles Redis/S3.
func (*Filesystem) Create ¶
func (f *Filesystem) Create(path string, flags int, mode uint32) (FileHandle, error)
Write operations - delegate to vnodes or fallback storage
func (*Filesystem) Destroy ¶
func (f *Filesystem) Destroy()
func (*Filesystem) Flush ¶
func (f *Filesystem) Flush(path string, fh FileHandle) error
Flush and Fsync
Flush is called on every close() of a file descriptor. We intentionally do NOT force-sync to S3 here — that would block every close() for ~300ms. Data safety is ensured by:
- Release (last fd close): ForceFlush to S3
- Fsync (explicit sync): ForceFlush to S3
- AsyncWriter debounce timer: uploads within 500ms
- Read path: serves dirty data from asyncWriter memory
func (*Filesystem) Fsync ¶
func (f *Filesystem) Fsync(path string, datasync bool, fh FileHandle) error
func (*Filesystem) Getxattr ¶
func (f *Filesystem) Getxattr(path, name string) ([]byte, error)
Getxattr returns empty data for all xattrs (we do not store them).
func (*Filesystem) Init ¶
func (f *Filesystem) Init() error
func (*Filesystem) IsDestroyed ¶
func (f *Filesystem) IsDestroyed() bool
func (*Filesystem) IsMounted ¶
func (f *Filesystem) IsMounted() bool
func (*Filesystem) Link ¶
func (f *Filesystem) Link(oldpath, newpath string) error
func (*Filesystem) Mount ¶
func (f *Filesystem) Mount() error
func (*Filesystem) Open ¶
func (f *Filesystem) Open(path string, flags int) (FileHandle, error)
func (*Filesystem) Opendir ¶
func (f *Filesystem) Opendir(path string) (FileHandle, error)
func (*Filesystem) Read ¶
func (f *Filesystem) Read(path string, buf []byte, off int64, fh FileHandle) (int, error)
func (*Filesystem) Readlink ¶
func (f *Filesystem) Readlink(path string) (string, error)
Symlink operations
func (*Filesystem) RegisterVNode ¶
func (f *Filesystem) RegisterVNode(node vnode.VirtualNode)
RegisterVNode registers a virtual node handler for a path prefix
func (*Filesystem) Release ¶
func (f *Filesystem) Release(path string, fh FileHandle) error
func (*Filesystem) Releasedir ¶
func (f *Filesystem) Releasedir(path string, fh FileHandle) error
func (*Filesystem) Removexattr ¶
func (f *Filesystem) Removexattr(path, name string) error
Removexattr silently succeeds since we don't store xattrs.
func (*Filesystem) Rename ¶
func (f *Filesystem) Rename(oldpath, newpath string) error
func (*Filesystem) Rmdir ¶
func (f *Filesystem) Rmdir(path string) error
func (*Filesystem) SetStorageFallback ¶
func (f *Filesystem) SetStorageFallback(node vnode.VirtualNode)
SetStorageFallback sets the fallback vnode for unmatched storage paths
func (*Filesystem) Setxattr ¶
func (f *Filesystem) Setxattr(path, name string, value []byte, flags int) error
Setxattr silently accepts and discards extended attributes.
func (*Filesystem) Statfs ¶
func (f *Filesystem) Statfs() (*StatInfo, error)
func (*Filesystem) Symlink ¶
func (f *Filesystem) Symlink(target, newpath string) error
func (*Filesystem) Truncate ¶
func (f *Filesystem) Truncate(path string, size int64, fh FileHandle) error
func (*Filesystem) Unlink ¶
func (f *Filesystem) Unlink(path string) error
func (*Filesystem) Unmount ¶
func (f *Filesystem) Unmount() error
func (*Filesystem) Write ¶
func (f *Filesystem) Write(path string, buf []byte, off int64, fh FileHandle) (int, error)
type FuseTrace ¶
type FuseTrace struct {
// contains filtered or unexported fields
}
FuseTrace is an opt-in, low-overhead tracer for the FUSE layer.
Enable with:
AIRSTORE_FUSE_TRACE=1
Optional:
AIRSTORE_FUSE_TRACE_INTERVAL=2s (default: 2s) AIRSTORE_FUSE_TRACE_SLOW_MS=50 (default: 50ms; 0 disables slow-op logging)
type GRPCConfig ¶
GRPCConfig holds configuration for connecting to the gateway.
type GRPCMetadataEngine ¶
type GRPCMetadataEngine struct {
// contains filtered or unexported fields
}
GRPCMetadataEngine implements MetadataEngine and LegacyMetadataEngine via gRPC.
func NewGRPCMetadataEngine ¶
func NewGRPCMetadataEngine(cfg GRPCConfig) (*GRPCMetadataEngine, error)
NewGRPCMetadataEngine creates a new gRPC-based metadata engine.
func (*GRPCMetadataEngine) Close ¶
func (m *GRPCMetadataEngine) Close() error
Close closes the gRPC connection.
func (*GRPCMetadataEngine) Conn ¶
func (m *GRPCMetadataEngine) Conn() *grpc.ClientConn
Conn returns the underlying gRPC connection for sharing with other services.
func (*GRPCMetadataEngine) DeleteDirectory ¶
func (m *GRPCMetadataEngine) DeleteDirectory(parentID, name string, version int) error
func (*GRPCMetadataEngine) GetDirectoryAccessMetadata ¶
func (m *GRPCMetadataEngine) GetDirectoryAccessMetadata(pid, name string) (*DirectoryAccessMetadata, error)
func (*GRPCMetadataEngine) GetDirectoryContentMetadata ¶
func (m *GRPCMetadataEngine) GetDirectoryContentMetadata(id string) (*DirectoryContentMetadata, error)
func (*GRPCMetadataEngine) GetFileMetadata ¶
func (m *GRPCMetadataEngine) GetFileMetadata(pid, name string) (*FileMetadata, error)
func (*GRPCMetadataEngine) ListDirectory ¶
func (m *GRPCMetadataEngine) ListDirectory(path string) []DirEntry
func (*GRPCMetadataEngine) RenameDirectory ¶
func (m *GRPCMetadataEngine) RenameDirectory(oldPID, oldName, newPID, newName string, version int) error
func (*GRPCMetadataEngine) SaveDirectoryAccessMetadata ¶
func (m *GRPCMetadataEngine) SaveDirectoryAccessMetadata(meta *DirectoryAccessMetadata) error
func (*GRPCMetadataEngine) SaveDirectoryContentMetadata ¶
func (m *GRPCMetadataEngine) SaveDirectoryContentMetadata(meta *DirectoryContentMetadata) error
func (*GRPCMetadataEngine) SaveFileMetadata ¶
func (m *GRPCMetadataEngine) SaveFileMetadata(meta *FileMetadata) error
type LegacyMetadataEngine ¶
type LegacyMetadataEngine interface {
GetDirectoryContentMetadata(id string) (*DirectoryContentMetadata, error)
GetDirectoryAccessMetadata(pid, name string) (*DirectoryAccessMetadata, error)
GetFileMetadata(pid, name string) (*FileMetadata, error)
SaveDirectoryContentMetadata(meta *DirectoryContentMetadata) error
SaveDirectoryAccessMetadata(meta *DirectoryAccessMetadata) error
SaveFileMetadata(meta *FileMetadata) error
ListDirectory(path string) []DirEntry
RenameDirectory(oldPID, oldName, newPID, newName string, version int) error
DeleteDirectory(parentID, name string, version int) error
}
LegacyMetadataEngine provides filesystem metadata operations via gRPC. This interface is for backward compatibility with the old FUSE implementation. New code should use the path-based MetadataEngine interface.