attr_cache

package
v2.0.0-...-796fd71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrFlagUnknown uint16 = iota
	AttrFlagExists
	AttrFlagValid
)

Flags represented in BitMap for various flags in the attr cache item

Variables

This section is empty.

Functions

func NewAttrCacheComponent

func NewAttrCacheComponent() internal.Component

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

func (ac *AttrCache) CommitData(options internal.CommitDataOptions) error

func (*AttrCache) Configure

func (ac *AttrCache) Configure(_ bool) error

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 : Mark the file invalid

func (*AttrCache) CreateDir

func (ac *AttrCache) CreateDir(options internal.CreateDirOptions) error

------------------------- Methods implemented by this component ------------------------------------------- CreateDir: Mark the directory invalid

func (*AttrCache) CreateFile

func (ac *AttrCache) CreateFile(options internal.CreateFileOptions) (*handlemap.Handle, error)

CreateFile: Mark the file invalid

func (ac *AttrCache) CreateLink(options internal.CreateLinkOptions) error

CreateLink : Mark the link and target invalid

func (*AttrCache) DeleteDir

func (ac *AttrCache) DeleteDir(options internal.DeleteDirOptions) error

DeleteDir: Mark the directory deleted and recursively 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

func (ac *AttrCache) GetAttr(options internal.GetAttrOptions) (*internal.ObjAttr, error)

GetAttr : Try to serve the request from the attribute cache, otherwise cache attributes of the path returned by next component

func (*AttrCache) Name

func (ac *AttrCache) Name() string

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) ReadDir

func (ac *AttrCache) ReadDir(options internal.ReadDirOptions) (pathList []*internal.ObjAttr, err error)

ReadDir : Optionally cache attributes of paths returned by next component

func (*AttrCache) RenameDir

func (ac *AttrCache) RenameDir(options internal.RenameDirOptions) error

RenameDir : Mark the source directory deleted and recursively mark all it's children deleted. Invalidate the destination since we may have overwritten it.

func (*AttrCache) RenameFile

func (ac *AttrCache) RenameFile(options internal.RenameFileOptions) error

RenameFile : Mark the source file deleted. Invalidate the destination file.

func (*AttrCache) SetName

func (ac *AttrCache) SetName(name string)

func (*AttrCache) SetNextComponent

func (ac *AttrCache) SetNextComponent(nc internal.Component)

func (*AttrCache) Start

func (ac *AttrCache) Start(ctx context.Context) error

Start : Pipeline calls this method to start the component functionality

this shall not block the call otherwise pipeline will not start

func (*AttrCache) Stop

func (ac *AttrCache) Stop() error

Stop : Stop the component functionality and kill all threads started

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

func (*AttrCache) SyncFile

func (ac *AttrCache) SyncFile(options internal.SyncFileOptions) error

func (*AttrCache) TruncateFile

func (ac *AttrCache) TruncateFile(options internal.TruncateFileOptions) error

TruncateFile : Update the file with its truncated size

func (*AttrCache) WriteFile

func (ac *AttrCache) WriteFile(options internal.WriteFileOptions) (int, error)

WriteFile : Mark the file invalid

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"`
	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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL