mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-08 03:47:51 +00:00
corrected error for post to non-existant fragment
This commit is contained in:
parent
cf721020fb
commit
0106a20696
3 changed files with 18 additions and 11 deletions
|
|
@ -4,15 +4,14 @@ import (
|
|||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"pilosa/db"
|
||||
"pilosa/index"
|
||||
"strconv"
|
||||
"strings"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
func post(database, base_url, id, compressed_string, frame_type string, slice int) {
|
||||
|
|
@ -22,14 +21,17 @@ func post(database, base_url, id, compressed_string, frame_type string, slice in
|
|||
values.Set("frame", frame_type)
|
||||
values.Set("slice", fmt.Sprintf("%d", slice))
|
||||
values.Set("bitmap", compressed_string)
|
||||
r, err := http.PostForm(base_url, values)
|
||||
if err != nil {
|
||||
log.Printf("error posting stat to stathat: %s", err)
|
||||
return
|
||||
}
|
||||
//body, _ := ioutil.ReadAll(r.Body)
|
||||
ioutil.ReadAll(r.Body)
|
||||
r.Body.Close()
|
||||
spew.Dump(values)
|
||||
/*
|
||||
r, err := http.PostForm(base_url, values)
|
||||
if err != nil {
|
||||
log.Printf("error posting stat to stathat: %s", err)
|
||||
return
|
||||
}
|
||||
//body, _ := ioutil.ReadAll(r.Body)
|
||||
ioutil.ReadAll(r.Body)
|
||||
r.Body.Close()
|
||||
*/
|
||||
}
|
||||
|
||||
func Load(database, url, fullpath string, frame_type string) error {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ func (self *Service) Batch(database_name, frame, compressed_bitmap string, bitma
|
|||
dest_id := fragment.GetProcess().Id()
|
||||
self.Transport.Send(&batch, &dest_id)
|
||||
|
||||
_, err := self.Hold.Get(&id, 60)
|
||||
_, err = self.Hold.Get(&id, 60)
|
||||
}
|
||||
return err
|
||||
|
||||
|
|
|
|||
|
|
@ -313,9 +313,14 @@ func (d *Database) GetFragmentForBitmap(slice *Slice, bitmap *Bitmap) (*Fragment
|
|||
//defer d.mutex.Unlock()
|
||||
frame, _ := d.getFrame(bitmap.FrameType)
|
||||
fsi, err := d.GetFrameSliceIntersect(frame, slice)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return nil, err
|
||||
}
|
||||
frag_id_s, err := fsi.hashring.Get(fmt.Sprintf("%d", bitmap.Id))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
return nil, err
|
||||
}
|
||||
frag_id := util.Hex_to_SUUID(frag_id_s)
|
||||
return fsi.GetFragment(frag_id)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue