SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
rename
Chris Lu0adbb56cc13b
diff --git a/weed/filesys/meta_cache/meta_cache.go b/weed/filesys/meta_cache/meta_cache.goindex ac193a4938..06f634c72c 100644--- a/weed/filesys/meta_cache/meta_cache.go+++ b/weed/filesys/meta_cache/meta_cache.go@@ -17,7 +17,7 @@ import (// e.g. fill fileId field for chunkstype MetaCache struct {- actualStore filer.FilerStore+ localStore filer.FilerStoresync.RWMutexvisitedBoundary *bounded_tree.BoundedTreeuidGidMapper *UidGidMapper@@ -25,7 +25,7 @@ type MetaCache struct {func NewMetaCache(dbFolder string, uidGidMapper *UidGidMapper) *MetaCache {return &MetaCache{- actualStore: openMetaStore(dbFolder),+ localStore: openMetaStore(dbFolder),visitedBoundary: bounded_tree.NewBoundedTree(),uidGidMapper: uidGidMapper,}@@ -57,7 +57,7 @@ func (mc *MetaCache) InsertEntry(ctx context.Context, entry *filer.Entry) errorfunc (mc *MetaCache) doInsertEntry(ctx context.Context, entry *filer.Entry) error {filer_pb.BeforeEntrySerialization(entry.Chunks)- return mc.actualStore.InsertEntry(ctx, entry)+ return mc.localStore.InsertEntry(ctx, entry)}func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath util.FullPath, newEntry *filer.Entry) error {@@ -71,7 +71,7 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti// skip the unnecessary deletion// leave the update to the following InsertEntry operation} else {- if err := mc.actualStore.DeleteEntry(ctx, oldPath); err != nil {+ if err := mc.localStore.DeleteEntry(ctx, oldPath); err != nil {return err}}@@ -83,7 +83,7 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath utiif newEntry != nil {newDir, _ := newEntry.DirAndName()if mc.visitedBoundary.HasVisited(util.FullPath(newDir)) {- if err := mc.actualStore.InsertEntry(ctx, newEntry); err != nil {+ if err := mc.localStore.InsertEntry(ctx, newEntry); err != nil {return err}}@@ -95,13 +95,13 @@ func (mc *MetaCache) UpdateEntry(ctx context.Context, entry *filer.Entry) errormc.Lock()defer mc.Unlock()filer_pb.BeforeEntrySerialization(entry.Chunks)- return mc.actualStore.UpdateEntry(ctx, entry)+ return mc.localStore.UpdateEntry(ctx, entry)}func (mc *MetaCache) FindEntry(ctx context.Context, fp util.FullPath) (entry *filer.Entry, err error) {mc.RLock()defer mc.RUnlock()- entry, err = mc.actualStore.FindEntry(ctx, fp)+ entry, err = mc.localStore.FindEntry(ctx, fp)if err != nil {return nil, err}@@ -113,14 +113,14 @@ func (mc *MetaCache) FindEntry(ctx context.Context, fp util.FullPath) (entry *fifunc (mc *MetaCache) DeleteEntry(ctx context.Context, fp util.FullPath) (err error) {mc.Lock()defer mc.Unlock()- return mc.actualStore.DeleteEntry(ctx, fp)+ return mc.localStore.DeleteEntry(ctx, fp)}func (mc *MetaCache) ListDirectoryEntries(ctx context.Context, dirPath util.FullPath, startFileName string, includeStartFile bool, limit int) ([]*filer.Entry, error) {mc.RLock()defer mc.RUnlock()- entries, err := mc.actualStore.ListDirectoryEntries(ctx, dirPath, startFileName, includeStartFile, limit)+ entries, err := mc.localStore.ListDirectoryEntries(ctx, dirPath, startFileName, includeStartFile, limit)if err != nil {return nil, err}@@ -134,7 +134,7 @@ func (mc *MetaCache) ListDirectoryEntries(ctx context.Context, dirPath util.Fullfunc (mc *MetaCache) Shutdown() {mc.Lock()defer mc.Unlock()- mc.actualStore.Shutdown()+ mc.localStore.Shutdown()}func (mc *MetaCache) mapIdFromFilerToLocal(entry *filer.Entry) {