Documentation ¶
Index ¶
- Constants
- Variables
- func CreateListener(socketName string, fs *FileService) error
- func DispatchReq(client *FileClient, j []byte) interface{}
- func InstallCleanup(socketName string)
- func Transfer(ctx context.Context, inode INode, blockSize int64, blockIndex int, ...) error
- func TransferService(queue chan interface{}, INodes *INodes)
- type BlockCompletion
- type BlockError
- type BlockID
- type BlockRequest
- type BlockState
- type Blocks
- type BlocksDiagnostics
- type BoundedReader
- type CloseReq
- type CloseResp
- type Command
- type DiagReq
- type DiagnosticRequest
- type DirEntries
- type DirEntry
- type DirRemoteProvider
- type DirRemoteProviderDiagnostics
- type ErrorResp
- type ExtendedDirEntry
- type FileClient
- func (fc *FileClient) Close(req *CloseReq) (*CloseResp, error)
- func (fc *FileClient) Forget(req *ForgetReq) (*CloseResp, error)
- func (f *FileClient) GetDiagnostics() *FileClientDiagnostics
- func (fc *FileClient) GetINodeForPath(path string) (INode, error)
- func (fc *FileClient) ListDir(req *ListDirReq) (*ListDirResp, error)
- func (fc *FileClient) Open(req *OpenReq) (*OpenResp, error)
- func (fc *FileClient) Read(req *ReadReq) (*ReadResp, error)
- type FileClientDiagnostics
- type FileClientDirEntry
- type FileHandle
- type FileService
- type FileServiceDiagnostics
- type ForgetReq
- type GCSRemoteProvider
- type GetDirCompletion
- type GetDirRequest
- type INode
- type INodeBlock
- type INodeStat
- type INodeState
- type INodes
- func (i *INodes) CloneINodeDir(inode INode) (INode, error)
- func (i *INodes) CreateLazyDir(parentINode INode, callback *LazyDirectoryCallback) INode
- func (i *INodes) CreateLazyFile(length int64, requestCallback RequestCallback) INode
- func (in *INodes) GetBlockIDs(inode INode, startIndex int64, count int64) ([]BlockID, error)
- func (inodes *INodes) GetDiagnostics() interface{}
- func (inodes *INodes) IsBlockPopulated(inode INode, blockIndex int) bool
- func (inodes *INodes) IsDirPopulated(inode INode) bool
- func (inodes *INodes) LookupInDir(dirINode INode, name string) INode
- func (inodes *INodes) LookupInDirWithErr(dirINode INode, name string) (INode, error)
- func (in *INodes) MarkUnreadable(inode INode, failure error)
- func (inodes *INodes) ReadDir(inode INode) []ExtendedDirEntry
- func (inodes *INodes) ReadDirWithErr(inode INode) ([]ExtendedDirEntry, error)
- func (inodes *INodes) ReadFile(inode INode, offset int64, buffer []byte) (int, error)
- func (inodes *INodes) RequestMissingBlocks(inode INode, blockIndices []int)
- func (in *INodes) SetBlock(inode INode, index int, blockID BlockID)
- func (in *INodes) SetDirEntries(inode INode, dirEntries []DirEntry)
- func (in *INodes) SetDirEntry(inode INode, name string, _inode INode)
- func (i *INodes) Stat(inode INode) (*INodeStat, error)
- func (i *INodes) UpdateRefCount(inode INode, delta int) int
- type INodesDiagnostics
- type LazyDirectoryCallback
- type ListDirReq
- type ListDirResp
- type OpenReq
- type OpenResp
- type ReadReq
- type ReadResp
- type RemoteFile
- type RemoteProvider
- type ReqEnvelope
- type RequestCallback
- type RespEnvelope
- type Response
- type SeekReq
- type SeekResp
- type TransferServiceStatus
- type WaitingThreads
Constants ¶
View Source
const INVALID_FD = -1
View Source
const ReadChunkSize = 1024 * 1024
View Source
const UNALLOCATED_BLOCK_ID = 0
Variables ¶
View Source
var FILE_CHANGED = errors.New("File changed")
View Source
var GCSPathRegEx = regexp.MustCompile("gs://([^/]+)/(.*)$")
View Source
var INVALID_HANDLE = errors.New("Invalid handle")
View Source
var INVALID_INODE = errors.New("Invalid INode")
View Source
var INVALID_NAME = errors.New("Invalid Name")
View Source
var IS_DIR = errors.New("Is directory")
View Source
var IS_NOT_DIR = errors.New("INode is not a directory")
Functions ¶
func CreateListener ¶
func CreateListener(socketName string, fs *FileService) error
func DispatchReq ¶
func DispatchReq(client *FileClient, j []byte) interface{}
func InstallCleanup ¶
func InstallCleanup(socketName string)
func TransferService ¶
func TransferService(queue chan interface{}, INodes *INodes)
Types ¶
type BlockCompletion ¶
type BlockCompletion struct { Block INodeBlock Filename string }
type BlockError ¶
type BlockError struct { Block INodeBlock Error error }
type BlockRequest ¶
type BlockState ¶
type BlockState struct {
// contains filtered or unexported fields
}
type Blocks ¶
type Blocks struct {
// contains filtered or unexported fields
}
func (*Blocks) GetDiagnostics ¶
func (b *Blocks) GetDiagnostics() *BlocksDiagnostics
type BlocksDiagnostics ¶
type BoundedReader ¶
type BoundedReader struct {
// contains filtered or unexported fields
}
func (*BoundedReader) Close ¶
func (b *BoundedReader) Close() error
type DiagnosticRequest ¶
type DiagnosticRequest struct {
Response chan *TransferServiceStatus
}
type DirEntries ¶
type DirEntries struct {
// contains filtered or unexported fields
}
func NewDirEntries ¶
func NewDirEntries(inode INode, parentINode INode) *DirEntries
func (*DirEntries) Get ¶
func (d *DirEntries) Get() []ExtendedDirEntry
func (*DirEntries) IsPopulated ¶
func (d *DirEntries) IsPopulated(name string) bool
func (*DirEntries) Set ¶
func (d *DirEntries) Set(entries []DirEntry)
func (*DirEntries) SetEntry ¶
func (d *DirEntries) SetEntry(name string, inode INode)
type DirRemoteProvider ¶
func (*DirRemoteProvider) GetDiagnostics ¶
func (d *DirRemoteProvider) GetDiagnostics() interface{}
func (*DirRemoteProvider) GetDirListing ¶
func (d *DirRemoteProvider) GetDirListing(ctx context.Context, path string) ([]RemoteFile, error)
type DirRemoteProviderDiagnostics ¶
type DirRemoteProviderDiagnostics struct {
Root string
}
type ExtendedDirEntry ¶
type FileClient ¶
type FileClient struct { FileService *FileService FileHandles map[int]*FileHandle // contains filtered or unexported fields }
Intended to be used by a single thread
func NewFileClient ¶
func NewFileClient(fs *FileService) *FileClient
func (*FileClient) GetDiagnostics ¶
func (f *FileClient) GetDiagnostics() *FileClientDiagnostics
func (*FileClient) GetINodeForPath ¶
func (fc *FileClient) GetINodeForPath(path string) (INode, error)
func (*FileClient) ListDir ¶
func (fc *FileClient) ListDir(req *ListDirReq) (*ListDirResp, error)
type FileClientDiagnostics ¶
type FileClientDiagnostics struct { FileService *FileServiceDiagnostics OpenFiles int FreeFileHandles int }
type FileClientDirEntry ¶
type FileHandle ¶
type FileService ¶
type FileService struct { Remote RemoteProvider INodes *INodes Root INode TransferServiceQueue chan interface{} }
func NewFileService ¶
func NewFileService(Remote RemoteProvider, WorkDir string, BlockSize int) (*FileService, error)
func (*FileService) Forget ¶
func (f *FileService) Forget(path string) error
func (*FileService) GetDiagnostics ¶
func (f *FileService) GetDiagnostics() *FileServiceDiagnostics
func (*FileService) GetINodeForPath ¶
func (f *FileService) GetINodeForPath(path string) (INode, error)
type FileServiceDiagnostics ¶
type FileServiceDiagnostics struct { Remote interface{} INodes interface{} TransferServiceStatus interface{} }
type GCSRemoteProvider ¶
type GCSRemoteProvider struct {
// contains filtered or unexported fields
}
func NewGCSRemoteProvider ¶
func NewGCSRemoteProvider(ctx context.Context, root string) *GCSRemoteProvider
func (*GCSRemoteProvider) GetDiagnostics ¶
func (g *GCSRemoteProvider) GetDiagnostics() interface{}
func (*GCSRemoteProvider) GetDirListing ¶
func (g *GCSRemoteProvider) GetDirListing(ctx context.Context, path string) ([]RemoteFile, error)
type GetDirCompletion ¶
type GetDirRequest ¶
type INodeBlock ¶
type INodeState ¶
type INodeState struct {
// contains filtered or unexported fields
}
type INodes ¶
type INodes struct {
// contains filtered or unexported fields
}
func (*INodes) CreateLazyDir ¶
func (i *INodes) CreateLazyDir(parentINode INode, callback *LazyDirectoryCallback) INode
func (*INodes) CreateLazyFile ¶
func (i *INodes) CreateLazyFile(length int64, requestCallback RequestCallback) INode
func (*INodes) GetBlockIDs ¶
func (*INodes) GetDiagnostics ¶
func (inodes *INodes) GetDiagnostics() interface{}
func (*INodes) IsBlockPopulated ¶
func (*INodes) IsDirPopulated ¶
func (*INodes) LookupInDirWithErr ¶
func (*INodes) MarkUnreadable ¶
func (*INodes) ReadDir ¶
func (inodes *INodes) ReadDir(inode INode) []ExtendedDirEntry
func (*INodes) ReadDirWithErr ¶
func (inodes *INodes) ReadDirWithErr(inode INode) ([]ExtendedDirEntry, error)
func (*INodes) RequestMissingBlocks ¶
func (*INodes) SetDirEntries ¶
type INodesDiagnostics ¶
type LazyDirectoryCallback ¶
type ListDirReq ¶
type ListDirReq struct {
Path string
}
type ListDirResp ¶
type ListDirResp struct {
Entries []FileClientDirEntry
}
type RemoteProvider ¶
type ReqEnvelope ¶
type ReqEnvelope struct { Type string Payload json.RawMessage }
type RequestCallback ¶
type RespEnvelope ¶
type RespEnvelope struct { Type string Payload interface{} }
type TransferServiceStatus ¶
type WaitingThreads ¶
type WaitingThreads struct {
Waiting []chan error
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.