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

This commit is contained in:
Lars Lehtonen
2026-04-27 15:54:52 -07:00
committed by GitHub
parent 4d8ddd8ded
commit 1add6cbbca
3 changed files with 1 additions and 18 deletions
-4
View File
@@ -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"`
@@ -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)
+1 -6
View File
@@ -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()