mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
added support for both pilosa and standard roaring uploads
This commit is contained in:
parent
cc80e0b0e4
commit
1d99da1f28
2 changed files with 8 additions and 1 deletions
|
|
@ -557,6 +557,7 @@ func (c *InternalClient) ImportRoaringBytes(ctx context.Context, node *pilosa.No
|
|||
if resp.StatusCode != http.StatusOK {
|
||||
return fmt.Errorf("invalid status: %d", resp.StatusCode)
|
||||
}
|
||||
io.Copy(ioutil.Discard, resp.Body)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3409,8 +3409,14 @@ func readStandardHeader(buf []byte) (size uint32, containerTyper func(index uint
|
|||
}
|
||||
|
||||
func UnmarshalStandardRoaring(data []byte) (*Bitmap, error) {
|
||||
|
||||
b := NewBitmap()
|
||||
|
||||
fileMagic := uint32(binary.LittleEndian.Uint16(data[0:2]))
|
||||
if fileMagic == magicNumber { //if pilosa roaring
|
||||
err := b.UnmarshalBinary(data)
|
||||
return b, err
|
||||
}
|
||||
|
||||
keyN, containerTyper, header, pos, err, haveRuns := readStandardHeader(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue