mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 21:07:53 +00:00
added auto allocate to the load routine
This commit is contained in:
parent
93e4a1fc92
commit
4880303e5c
1 changed files with 16 additions and 0 deletions
16
core/http.go
16
core/http.go
|
|
@ -218,6 +218,22 @@ func (self *WebService) HandleLoad(w http.ResponseWriter, r *http.Request) {
|
|||
http.Error(w, "Provide a database (db)", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
db := database_name.(string)
|
||||
|
||||
ms_, ok := obj["max_slice"]
|
||||
if ok {
|
||||
ms := int(ms_.(float64))
|
||||
database := self.service.Cluster.GetOrCreateDatabase(db)
|
||||
ns, _ := database.NumSlices()
|
||||
if ns <= ms {
|
||||
for i := ns; i <= ms; i++ {
|
||||
self.service.TopologyMapper.MakeFragments(db, i)
|
||||
}
|
||||
http.Error(w, "Needed Slices", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_, ok = obj["id"]
|
||||
if !ok {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue