Documentation ¶
Index ¶
- Variables
- func CompactFileChunks(chunks []*filer_pb.FileChunk) (compacted, garbage []*filer_pb.FileChunk)
- func ETag(chunks []*filer_pb.FileChunk) (etag string)
- func EntryAttributeToPb(entry *Entry) *filer_pb.FuseAttributes
- func EqualEntry(a, b *Entry) bool
- func GetEntry(ctx context.Context, filerClient FilerClient, fullFilePath string) (entry *filer_pb.Entry, err error)
- func MinusChunks(as, bs []*filer_pb.FileChunk) (delta []*filer_pb.FileChunk)
- func ReadDirAllEntries(ctx context.Context, filerClient FilerClient, fullDirPath string, ...) (err error)
- func ReadIntoBuffer(ctx context.Context, filerClient FilerClient, fullFilePath string, buff []byte, ...) (totalRead int64, err error)
- func StreamContent(masterClient *wdclient.MasterClient, w io.Writer, chunks []*filer_pb.FileChunk, ...) error
- func TotalSize(chunks []*filer_pb.FileChunk) (size uint64)
- func VolumeId(fileId string) string
- type Attr
- type ChunkView
- type Entry
- func (entry *Entry) DecodeAttributesAndChunks(blob []byte) error
- func (entry *Entry) EncodeAttributesAndChunks() ([]byte, error)
- func (entry *Entry) Size() uint64
- func (entry *Entry) Timestamp() time.Time
- func (entry *Entry) ToProtoEntry() *filer_pb.Entry
- func (entry *Entry) ToProtoFullEntry() *filer_pb.FullEntry
- type Filer
- func (f *Filer) BeginTransaction(ctx context.Context) (context.Context, error)
- func (f *Filer) CommitTransaction(ctx context.Context) error
- func (f *Filer) CreateEntry(ctx context.Context, entry *Entry) error
- func (f *Filer) DeleteChunks(fullpath FullPath, chunks []*filer_pb.FileChunk)
- func (f *Filer) DeleteEntryMetaAndData(ctx context.Context, p FullPath, isRecursive bool, ...) (err error)
- func (f *Filer) DeleteFileByFileId(fileId string)
- func (f *Filer) DisableDirectoryCache()
- func (f *Filer) FindEntry(ctx context.Context, p FullPath) (entry *Entry, err error)
- func (fs *Filer) GetMaster() string
- func (fs *Filer) KeepConnectedToMaster()
- func (f *Filer) ListDirectoryEntries(ctx context.Context, p FullPath, startFileName string, inclusive bool, ...) ([]*Entry, error)
- func (f *Filer) LoadConfiguration(config *viper.Viper)
- func (f *Filer) NotifyUpdateEvent(oldEntry, newEntry *Entry, deleteChunks bool)
- func (f *Filer) RollbackTransaction(ctx context.Context) error
- func (f *Filer) SetStore(store FilerStore)
- func (f *Filer) UpdateEntry(ctx context.Context, oldEntry, entry *Entry) (err error)
- type FilerClient
- type FilerStore
- type FilerStoreWrapper
- func (fsw *FilerStoreWrapper) BeginTransaction(ctx context.Context) (context.Context, error)
- func (fsw *FilerStoreWrapper) CommitTransaction(ctx context.Context) error
- func (fsw *FilerStoreWrapper) DeleteEntry(ctx context.Context, fp FullPath) (err error)
- func (fsw *FilerStoreWrapper) FindEntry(ctx context.Context, fp FullPath) (entry *Entry, err error)
- func (fsw *FilerStoreWrapper) GetName() string
- func (fsw *FilerStoreWrapper) Initialize(configuration util.Configuration) error
- func (fsw *FilerStoreWrapper) InsertEntry(ctx context.Context, entry *Entry) error
- func (fsw *FilerStoreWrapper) ListDirectoryEntries(ctx context.Context, dirPath FullPath, startFileName string, ...) ([]*Entry, error)
- func (fsw *FilerStoreWrapper) RollbackTransaction(ctx context.Context) error
- func (fsw *FilerStoreWrapper) UpdateEntry(ctx context.Context, entry *Entry) error
- type FullPath
- type VisibleInterval
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("filer: no entry is found in filer store")
View Source
var (
Stores []FilerStore
)
Functions ¶
func CompactFileChunks ¶
func EntryAttributeToPb ¶
func EntryAttributeToPb(entry *Entry) *filer_pb.FuseAttributes
func EqualEntry ¶
func ReadDirAllEntries ¶
func ReadIntoBuffer ¶
func StreamContent ¶
Types ¶
type Attr ¶
type Attr struct { Mtime time.Time // time of last modification Crtime time.Time // time of creation (OS X only) Mode os.FileMode // file mode Uid uint32 // owner uid Gid uint32 // group gid Mime string // mime type Replication string // replication Collection string // collection name TtlSec int32 // ttl in seconds UserName string GroupNames []string SymlinkTarget string }
func PbToEntryAttribute ¶
func PbToEntryAttribute(attr *filer_pb.FuseAttributes) Attr
func (Attr) IsDirectory ¶
type ChunkView ¶
func ViewFromChunks ¶
func ViewFromVisibleIntervals ¶
func ViewFromVisibleIntervals(visibles []VisibleInterval, offset int64, size int) (views []*ChunkView)
type Entry ¶
type Entry struct { FullPath Attr // the following is for files Chunks []*filer_pb.FileChunk `json:"chunks,omitempty"` }
func (*Entry) DecodeAttributesAndChunks ¶
func (*Entry) EncodeAttributesAndChunks ¶
func (*Entry) ToProtoEntry ¶
func (*Entry) ToProtoFullEntry ¶
type Filer ¶
type Filer struct { MasterClient *wdclient.MasterClient GrpcDialOption grpc.DialOption // contains filtered or unexported fields }
func (*Filer) BeginTransaction ¶
func (*Filer) DeleteChunks ¶
func (*Filer) DeleteEntryMetaAndData ¶
func (*Filer) DeleteFileByFileId ¶
DeleteFileByFileId direct delete by file id. Only used when the fileId is not being managed by snapshots.
func (*Filer) DisableDirectoryCache ¶
func (f *Filer) DisableDirectoryCache()
func (*Filer) KeepConnectedToMaster ¶
func (fs *Filer) KeepConnectedToMaster()
func (*Filer) ListDirectoryEntries ¶
func (*Filer) LoadConfiguration ¶
func (*Filer) NotifyUpdateEvent ¶
func (*Filer) SetStore ¶
func (f *Filer) SetStore(store FilerStore)
type FilerClient ¶
type FilerStore ¶
type FilerStore interface { // GetName gets the name to locate the configuration in filer.toml file GetName() string // Initialize initializes the file store Initialize(configuration util.Configuration) error InsertEntry(context.Context, *Entry) error UpdateEntry(context.Context, *Entry) (err error) // err == filer2.ErrNotFound if not found FindEntry(context.Context, FullPath) (entry *Entry, err error) DeleteEntry(context.Context, FullPath) (err error) ListDirectoryEntries(ctx context.Context, dirPath FullPath, startFileName string, includeStartFile bool, limit int) ([]*Entry, error) BeginTransaction(ctx context.Context) (context.Context, error) CommitTransaction(ctx context.Context) error RollbackTransaction(ctx context.Context) error }
type FilerStoreWrapper ¶
type FilerStoreWrapper struct {
// contains filtered or unexported fields
}
func NewFilerStoreWrapper ¶
func NewFilerStoreWrapper(store FilerStore) *FilerStoreWrapper
func (*FilerStoreWrapper) BeginTransaction ¶
func (*FilerStoreWrapper) CommitTransaction ¶
func (fsw *FilerStoreWrapper) CommitTransaction(ctx context.Context) error
func (*FilerStoreWrapper) DeleteEntry ¶
func (fsw *FilerStoreWrapper) DeleteEntry(ctx context.Context, fp FullPath) (err error)
func (*FilerStoreWrapper) GetName ¶
func (fsw *FilerStoreWrapper) GetName() string
func (*FilerStoreWrapper) Initialize ¶
func (fsw *FilerStoreWrapper) Initialize(configuration util.Configuration) error
func (*FilerStoreWrapper) InsertEntry ¶
func (fsw *FilerStoreWrapper) InsertEntry(ctx context.Context, entry *Entry) error
func (*FilerStoreWrapper) ListDirectoryEntries ¶
func (*FilerStoreWrapper) RollbackTransaction ¶
func (fsw *FilerStoreWrapper) RollbackTransaction(ctx context.Context) error
func (*FilerStoreWrapper) UpdateEntry ¶
func (fsw *FilerStoreWrapper) UpdateEntry(ctx context.Context, entry *Entry) error
type VisibleInterval ¶
type VisibleInterval struct {
// contains filtered or unexported fields
}
func MergeIntoVisibles ¶
func MergeIntoVisibles(visibles, newVisibles []VisibleInterval, chunk *filer_pb.FileChunk) []VisibleInterval
func NonOverlappingVisibleIntervals ¶
func NonOverlappingVisibleIntervals(chunks []*filer_pb.FileChunk) (visibles []VisibleInterval)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.