meta_cache

package
v0.0.0-...-935c85c Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 14 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 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 {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewMetaCache

func NewMetaCache(dbFolder string, baseDir util.FullPath, uidGidMapper *UidGidMapper) *MetaCache

func (*MetaCache) AtomicUpdateEntryFromFiler

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

func (*MetaCache) DeleteEntry

func (mc *MetaCache) DeleteEntry(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 int) ([]*filer.Entry, 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