Documentation ¶
Index ¶
- Constants
- func NewAttrCacheComponent() internal.Component
- type AttrCache
- func (ac *AttrCache) Chmod(options internal.ChmodOptions) error
- func (ac *AttrCache) Chown(options internal.ChownOptions) error
- func (ac *AttrCache) CommitData(options internal.CommitDataOptions) error
- func (ac *AttrCache) Configure(_ bool) error
- func (ac *AttrCache) CopyFromFile(options internal.CopyFromFileOptions) error
- func (ac *AttrCache) CopyToFile(options internal.CopyToFileOptions) error
- func (ac *AttrCache) CreateDir(options internal.CreateDirOptions) error
- func (ac *AttrCache) CreateFile(options internal.CreateFileOptions) (*handlemap.Handle, error)
- func (ac *AttrCache) CreateLink(options internal.CreateLinkOptions) error
- func (ac *AttrCache) DeleteDir(options internal.DeleteDirOptions) error
- func (ac *AttrCache) DeleteFile(options internal.DeleteFileOptions) error
- func (ac *AttrCache) FlushFile(options internal.FlushFileOptions) error
- func (ac *AttrCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr, error)
- func (ac *AttrCache) IsDirEmpty(options internal.IsDirEmptyOptions) bool
- func (ac *AttrCache) Name() string
- func (ac *AttrCache) OnConfigChange()
- func (ac *AttrCache) OpenFile(options internal.OpenFileOptions) (*handlemap.Handle, error)
- func (ac *AttrCache) Priority() internal.ComponentPriority
- func (ac *AttrCache) RenameDir(options internal.RenameDirOptions) error
- func (ac *AttrCache) RenameFile(options internal.RenameFileOptions) error
- func (ac *AttrCache) SetName(name string)
- func (ac *AttrCache) SetNextComponent(nc internal.Component)
- func (ac *AttrCache) Start(ctx context.Context) error
- func (ac *AttrCache) Stop() error
- func (ac *AttrCache) StreamDir(options internal.StreamDirOptions) ([]*internal.ObjAttr, string, error)
- func (ac *AttrCache) SyncDir(options internal.SyncDirOptions) error
- func (ac *AttrCache) SyncFile(options internal.SyncFileOptions) error
- func (ac *AttrCache) TruncateFile(options internal.TruncateFileOptions) error
- func (ac *AttrCache) WriteFile(options internal.WriteFileOptions) (int, error)
- type AttrCacheOptions
Constants ¶
const ( AttrFlagUnknown uint16 = iota AttrFlagExists AttrFlagValid // when using S3, directories with no objects are not represented in cloud storage AttrFlagNotInCloud )
Flags represented in BitMap for various flags in the attr cache item
Variables ¶
This section is empty.
Functions ¶
func NewAttrCacheComponent ¶
Pipeline will call this method to create your object, initialize your variables here << DO NOT DELETE ANY AUTO GENERATED CODE HERE >>
Types ¶
type AttrCache ¶
type AttrCache struct { internal.BaseComponent // contains filtered or unexported fields }
Common structure for AttrCache Component
func (*AttrCache) Chmod ¶
func (ac *AttrCache) Chmod(options internal.ChmodOptions) error
Chmod : Update the file with its new permissions
func (*AttrCache) Chown ¶
func (ac *AttrCache) Chown(options internal.ChownOptions) error
Chown : Update the file with its new owner and group (when datalake chown is implemented)
func (*AttrCache) CommitData ¶ added in v1.1.0
func (ac *AttrCache) CommitData(options internal.CommitDataOptions) error
func (*AttrCache) Configure ¶
Configure : Pipeline will call this method after constructor so that you can read config and initialize yourself
Return failure if any config is not valid to exit the process
func (*AttrCache) CopyFromFile ¶
func (ac *AttrCache) CopyFromFile(options internal.CopyFromFileOptions) error
CopyFromFile : Upload file and update cache entry
func (*AttrCache) CopyToFile ¶ added in v1.2.0
func (ac *AttrCache) CopyToFile(options internal.CopyToFileOptions) error
Update attribute cache when CopyToFile returns that a file doesn't exist
func (*AttrCache) CreateDir ¶
func (ac *AttrCache) CreateDir(options internal.CreateDirOptions) error
------------------------- Methods implemented by this component ------------------------------------------- CreateDir: Mark the directory invalid, or insert the dir item into cache when cacheDirs is true.
func (*AttrCache) CreateFile ¶
CreateFile: Cache a new entry for the file
func (*AttrCache) CreateLink ¶
func (ac *AttrCache) CreateLink(options internal.CreateLinkOptions) error
CreateLink : Mark the new link invalid
func (*AttrCache) DeleteDir ¶
func (ac *AttrCache) DeleteDir(options internal.DeleteDirOptions) error
DeleteDir: Mark the directory deleted and mark all it's children deleted
func (*AttrCache) DeleteFile ¶
func (ac *AttrCache) DeleteFile(options internal.DeleteFileOptions) error
DeleteFile : Mark the file deleted
func (*AttrCache) FlushFile ¶
func (ac *AttrCache) FlushFile(options internal.FlushFileOptions) error
FlushFile : flush file
func (*AttrCache) GetAttr ¶
GetAttr : Try to serve the request from the attribute cache, otherwise cache attributes of the path returned by next component
func (*AttrCache) IsDirEmpty ¶
func (ac *AttrCache) IsDirEmpty(options internal.IsDirEmptyOptions) bool
IsDirEmpty: Whether or not the directory is empty
func (*AttrCache) OnConfigChange ¶
func (ac *AttrCache) OnConfigChange()
OnConfigChange : If component has registered, on config file change this method is called
func (*AttrCache) Priority ¶
func (ac *AttrCache) Priority() internal.ComponentPriority
func (*AttrCache) RenameDir ¶
func (ac *AttrCache) RenameDir(options internal.RenameDirOptions) error
RenameDir : Mark the source directory and all its contents deleted. Invalidate the destination since we may have overwritten it.
func (*AttrCache) RenameFile ¶
func (ac *AttrCache) RenameFile(options internal.RenameFileOptions) error
RenameFile : Move item in cache
func (*AttrCache) SetNextComponent ¶
func (*AttrCache) Start ¶
Start : Pipeline calls this method to start the component functionality
this shall not block the call otherwise pipeline will not start
func (*AttrCache) StreamDir ¶
func (ac *AttrCache) StreamDir(options internal.StreamDirOptions) ([]*internal.ObjAttr, string, error)
StreamDir : Optionally cache attributes of paths returned by next component
func (*AttrCache) SyncDir ¶
func (ac *AttrCache) SyncDir(options internal.SyncDirOptions) error
SyncDir : Refresh attributes from storage
func (*AttrCache) SyncFile ¶
func (ac *AttrCache) SyncFile(options internal.SyncFileOptions) error
SyncFile : Refresh attributes from storage
func (*AttrCache) TruncateFile ¶
func (ac *AttrCache) TruncateFile(options internal.TruncateFileOptions) error
TruncateFile : Update the file with its truncated size
type AttrCacheOptions ¶
type AttrCacheOptions struct { Timeout uint32 `config:"timeout-sec" yaml:"timeout-sec,omitempty"` NoCacheOnList bool `config:"no-cache-on-list" yaml:"no-cache-on-list,omitempty"` EnableSymlinks bool `config:"enable-symlinks" yaml:"enable-symlinks,omitempty"` NoCacheDirs bool `config:"no-cache-dirs" yaml:"no-cache-dirs,omitempty"` // hidden option for backward compatibility NoSymlinks bool `config:"no-symlinks" yaml:"no-symlinks,omitempty"` //maximum file attributes overall to be cached MaxFiles int `config:"max-files" yaml:"max-files,omitempty"` // support v1 CacheOnList bool `config:"cache-on-list"` }
Structure defining your config parameters