meta_cache

package
v0.0.0-...-5c6c1e7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureVisited

func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.FullPath) error

func IsHiddenSystemEntry

func IsHiddenSystemEntry(dir, name string) bool

func SubscribeMetaEvents

func SubscribeMetaEvents(mc *MetaCache, selfSignature int32, client filer_pb.FilerClient, dir string, lastTsNs int64) error

Types

type IdMapper

type IdMapper struct {
	// contains filtered or unexported fields
}

func (*IdMapper) FilerToLocal

func (m *IdMapper) FilerToLocal(id uint32) uint32

func (*IdMapper) LocalToFiler

func (m *IdMapper) LocalToFiler(id uint32) uint32

type MetaCache

type MetaCache struct {
	// contains filtered or unexported fields
}

func NewMetaCache

func NewMetaCache(dbFolder string, uidGidMapper *UidGidMapper, root util.FullPath,
	markCachedFn func(path util.FullPath), isCachedFn func(path util.FullPath) bool, invalidateFunc func(util.FullPath, *filer_pb.Entry)) *MetaCache

func (*MetaCache) AtomicUpdateEntryFromFiler

func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath util.FullPath, newEntry *filer.Entry, shouldDeleteChunks bool) error

func (*MetaCache) Debug

func (mc *MetaCache) Debug()

func (*MetaCache) DeleteEntry

func (mc *MetaCache) DeleteEntry(ctx context.Context, fp util.FullPath) (err error)
func (mc *MetaCache) DeleteEntrySkipHardlink(ctx context.Context, fp util.FullPath) (err error)

func (*MetaCache) DeleteFolderChildren

func (mc *MetaCache) DeleteFolderChildren(ctx context.Context, fp util.FullPath) (err error)

func (*MetaCache) FindEntry

func (mc *MetaCache) FindEntry(ctx context.Context, fp util.FullPath) (entry *filer.Entry, err error)

func (*MetaCache) InsertEntry

func (mc *MetaCache) InsertEntry(ctx context.Context, entry *filer.Entry) error

func (*MetaCache) ListDirectoryEntries

func (mc *MetaCache) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int64, eachEntryFunc filer.ListEachEntryFunc) error

func (*MetaCache) Shutdown

func (mc *MetaCache) Shutdown()

func (*MetaCache) UpdateEntry

func (mc *MetaCache) UpdateEntry(ctx context.Context, entry *filer.Entry) error

type UidGidMapper

type UidGidMapper struct {
	// contains filtered or unexported fields
}

func NewUidGidMapper

func NewUidGidMapper(uidPairsStr, gidPairStr string) (*UidGidMapper, error)

UidGidMapper translates local uid/gid to filer uid/gid The local storage always persists the same as the filer. The local->filer translation happens when updating the filer first and later saving to meta_cache. And filer->local happens when reading from the meta_cache.

func (*UidGidMapper) FilerToLocal

func (m *UidGidMapper) FilerToLocal(uid, gid uint32) (uint32, uint32)

func (*UidGidMapper) LocalToFiler

func (m *UidGidMapper) LocalToFiler(uid, gid uint32) (uint32, uint32)

Jump to

Keyboard shortcuts

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