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
shortcut for appending operations
Chris Luf5ee19e0dbf7
diff --git a/weed/filesys/dirty_page_interval.go b/weed/filesys/dirty_page_interval.goindex 56590126f9..f644bea0b2 100644--- a/weed/filesys/dirty_page_interval.go+++ b/weed/filesys/dirty_page_interval.go@@ -129,6 +129,15 @@ func (c *ContinuousIntervals) AddInterval(data []byte, offset int64) {interval := &IntervalNode{Data: data, Offset: offset, Size: int64(len(data))}+ // append to the tail and return+ if len(c.lists) == 1 {+ lastSpan := c.lists[0]+ if lastSpan.Tail.Offset + lastSpan.Tail.Size == offset {+ lastSpan.addNodeToTail(interval)+ return+ }+ }+var newLists []*IntervalLinkedListfor _, list := range c.lists {// if list is to the left of new interval, add to the new list