From be3bc105cdffe5b90d92ad6579cd6b0f7540caf2 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Tue, 25 Sep 2018 10:40:04 -0500 Subject: [PATCH] fixed upconvert;reverted to released interface --- enterprise/b/containers_btree.go | 4 ++-- roaring/containers.go | 6 +++--- roaring/roaring.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/enterprise/b/containers_btree.go b/enterprise/b/containers_btree.go index 789936a24..7487eea70 100644 --- a/enterprise/b/containers_btree.go +++ b/enterprise/b/containers_btree.go @@ -93,8 +93,8 @@ type updater struct { mapped bool } -func (btc *bTreeContainers) PutContainerValues(key uint64, containerType byte, n int32, mapped bool) { - a := updater{key, n, containerType, mapped} +func (btc *bTreeContainers) PutContainerValues(key uint64, containerType byte, n int, mapped bool) { + a := updater{key, int32(n), containerType, mapped} btc.tree.Put(key, a.update) } diff --git a/roaring/containers.go b/roaring/containers.go index bc458fba2..ed745a915 100644 --- a/roaring/containers.go +++ b/roaring/containers.go @@ -46,18 +46,18 @@ func (sc *sliceContainers) Put(key uint64, c *Container) { } -func (sc *sliceContainers) PutContainerValues(key uint64, containerType byte, n int32, mapped bool) { +func (sc *sliceContainers) PutContainerValues(key uint64, containerType byte, n int, mapped bool) { i := search64(sc.keys, key) if i < 0 { c := NewContainer() c.containerType = containerType - c.n = n + c.n = int32(n) c.mapped = mapped sc.insertAt(key, c, -i-1) } else { c := sc.containers[i] c.containerType = containerType - c.n = n + c.n = int32(n) c.mapped = mapped } diff --git a/roaring/roaring.go b/roaring/roaring.go index fd9f15d92..8ad4c783d 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -73,7 +73,7 @@ type Containers interface { // PutContainerValues updates an existing container at key. // If a container does not exist for key, a new one is allocated. - PutContainerValues(key uint64, containerType byte, n int32, mapped bool) + PutContainerValues(key uint64, containerType byte, n int, mapped bool) // Remove takes the container at key out. Remove(key uint64) @@ -644,7 +644,7 @@ func (b *Bitmap) unmarshalPilosaRoaring(data []byte) error { b.Containers.PutContainerValues( binary.LittleEndian.Uint64(buf[0:8]), byte(binary.LittleEndian.Uint16(buf[8:10])), - int32(binary.LittleEndian.Uint16(buf[10:12]))+1, + int(binary.LittleEndian.Uint16(buf[10:12]))+1, true) } opsOffset := headerSize + int(keyN)*12 @@ -1103,7 +1103,7 @@ func (c *Container) countRange(start, end int32) (n int32) { } func (c *Container) arrayCountRange(start, end int32) (n int32) { - i := int32(sort.Search(int(len(c.array)), func(i int) bool { return int32(c.array[i]) >= start })) + i := int32(sort.Search(len(c.array), func(i int) bool { return int32(c.array[i]) >= start })) for ; i < int32(len(c.array)); i++ { v := int32(c.array[i]) if v >= end { @@ -3481,7 +3481,7 @@ func (b *Bitmap) UnmarshalBinary(data []byte) error { b.Containers.PutContainerValues( uint64(binary.LittleEndian.Uint16(buf[0:2])), containerTyper(i, card), /// container type voodo with isRunBitmap - int32(card), + card, true) }