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
remove Size from Attr
Chris Lu75a2b05aa31c
diff --git a/weed/filer2/filechunks.go b/weed/filer2/filechunks.gonew file mode 100644index 0000000000..b2f05de3a9--- /dev/null+++ b/weed/filer2/filechunks.go@@ -0,0 +1,23 @@+package filer2++type Chunks []FileChunk++func (chunks Chunks) TotalSize() (size uint64) {+ for _, c := range chunks {+ t := uint64(c.Offset + int64(c.Size))+ if size < t {+ size = t+ }+ }+ return+}++func (chunks Chunks) Len() int {+ return len(chunks)+}+func (chunks Chunks) Swap(i, j int) {+ chunks[i], chunks[j] = chunks[j], chunks[i]+}+func (chunks Chunks) Less(i, j int) bool {+ return chunks[i].Offset < chunks[j].Offset+}diff --git a/weed/filer2/filer_structure.go b/weed/filer2/filer_structure.goindex c78704184d..c6a3f817d7 100644--- a/weed/filer2/filer_structure.go+++ b/weed/filer2/filer_structure.go@@ -27,7 +27,6 @@ type Attr struct {Mode os.FileMode // file modeUid uint32 // owner uidGid uint32 // group gid- Size uint64 // total size in bytes}type Entry struct {diff --git a/weed/filer2/memdb/memdb_store.go b/weed/filer2/memdb/memdb_store.goindex 5a72b7cf9c..47e9934aa1 100644--- a/weed/filer2/memdb/memdb_store.go+++ b/weed/filer2/memdb/memdb_store.go@@ -5,6 +5,7 @@ import ("github.com/google/btree""strings""fmt"+ "time")type MemDbStore struct {@@ -37,6 +38,7 @@ func (filer *MemDbStore) AppendFileChunk(fullpath filer2.FullPath, fileChunk filreturn fmt.Errorf("No such file: %s", fullpath)}entry.Chunks = append(entry.Chunks, fileChunk)+ entry.Mtime = time.Now()return nil}