Skip to content

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.

chore(weed/topology): prune unused functions (#9249)

Lars Lehtonen1add6cbbca80
diff --git a/weed/topology/configuration.go b/weed/topology/configuration.go
index d9fde4a047..27aba76cae 100644
--- a/weed/topology/configuration.go
+++ b/weed/topology/configuration.go
@@ -4,10 +4,6 @@ import (
"encoding/xml"
)
-type loc struct {
- dcName string
- rackName string
-}
type rack struct {
Name string `xml:"name,attr"`
Ips []string `xml:"Ip"`
diff --git a/weed/topology/volume_growth_reservation_test.go b/weed/topology/volume_growth_reservation_test.go
index a29d924bd6..f3711b2fa5 100644
--- a/weed/topology/volume_growth_reservation_test.go
+++ b/weed/topology/volume_growth_reservation_test.go
@@ -7,7 +7,6 @@ import (
"time"
"github.com/seaweedfs/seaweedfs/weed/sequence"
- "github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
)
@@ -15,13 +14,6 @@ import (
// MockGrpcDialOption simulates grpc connection for testing
type MockGrpcDialOption struct{}
-// simulateVolumeAllocation mocks the volume allocation process
-func simulateVolumeAllocation(server *DataNode, vid needle.VolumeId, option *VolumeGrowOption) error {
- // Simulate some processing time
- time.Sleep(time.Millisecond * 10)
- return nil
-}
-
func TestVolumeGrowth_ReservationBasedAllocation(t *testing.T) {
// Create test topology with single server for predictable behavior
topo := NewTopology("weedfs", sequence.NewMemorySequencer(), 32*1024, 5, false)
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go
index 48e75ec828..b25097e71a 100644
--- a/weed/topology/volume_layout.go
+++ b/weed/topology/volume_layout.go
@@ -156,7 +156,7 @@ func NewVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType
vacuumedVolumes: make(map[needle.VolumeId]time.Time),
volumeSizeLimit: volumeSizeLimit,
replicationAsMin: replicationAsMin,
- sizeTracking: make(map[needle.VolumeId]*volumeSizeTracking),
+ sizeTracking: make(map[needle.VolumeId]*volumeSizeTracking),
}
}
@@ -362,10 +362,6 @@ func (vl *VolumeLayout) isOversized(v *storage.VolumeInfo) bool {
return uint64(v.Size) >= vl.volumeSizeLimit
}
-func (vl *VolumeLayout) isCrowdedVolume(v *storage.VolumeInfo) bool {
- return float64(v.Size) > float64(vl.volumeSizeLimit)*VolumeGrowStrategy.Threshold
-}
-
// RecordAssign adds the estimated byte size to the volume's tracked effective
// size and updates the volume's writable state:
//
@@ -489,7 +485,6 @@ func (vl *VolumeLayout) DrainAndRemoveFromWritable(vid needle.VolumeId) {
vl.waitForPendingDrain(context.Background(), vid)
}
-
func (vl *VolumeLayout) isEmpty() bool {
vl.accessLock.RLock()
defer vl.accessLock.RUnlock()