mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-24 06:50:40 +02:00
add vacuum operation
This commit is contained in:
1 parent
0c1d4b2d08
commit
a5f48de7d6
7 files changed
+373
-115
No files matched your search
@@ -1389,3 +1389,15 @@ func (s *AdminServer) GetVolumeDetails(volumeID int, server string) (*VolumeDeta
|
||||
LastUpdated: time.Now(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// VacuumVolume performs a vacuum operation on a specific volume
|
||||
func (s *AdminServer) VacuumVolume(volumeID int, server string) error {
|
||||
return s.WithMasterClient(func(client master_pb.SeaweedClient) error {
|
||||
_, err := client.VacuumVolume(context.Background(), &master_pb.VacuumVolumeRequest{
|
||||
VolumeId: uint32(volumeID),
|
||||
GarbageThreshold: 0.0001, // A very low threshold to ensure all garbage is collected
|
||||
Collection: "", // Empty for all collections
|
||||
})
|
||||
return err
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user