move volume vacuum to gRpc

This commit is contained in:
Chris Lu committed 2018-10-14 23:12:43 -07:00
1 parent 91ac2e0dd9
commit b1daede91b
14 files changed
+469 -207

No files matched your search

+9 -3
View File
@@ -37,9 +37,15 @@ func (ms *MasterServer) dirStatusHandler(w http.ResponseWriter, r *http.Request)
}
func (ms *MasterServer) volumeVacuumHandler(w http.ResponseWriter, r *http.Request) {
gcThreshold := r.FormValue("garbageThreshold")
if gcThreshold == "" {
gcThreshold = ms.garbageThreshold
gcString := r.FormValue("garbageThreshold")
gcThreshold := ms.garbageThreshold
if gcString != "" {
var err error
gcThreshold, err = strconv.ParseFloat(gcString, 32)
if err != nil {
glog.V(0).Infof("garbageThreshold %s is not a valid float number: %v", gcString, err)
return
}
}
glog.Infoln("garbageThreshold =", gcThreshold)
ms.Topo.Vacuum(gcThreshold, ms.preallocate)