diff --git a/bitmap.go b/bitmap.go index c9b93bfb7..41bd98e6c 100644 --- a/bitmap.go +++ b/bitmap.go @@ -34,7 +34,7 @@ type Bitmap struct { func NewBitmap(bits ...uint64) *Bitmap { bm := &Bitmap{tree: rbtree.NewTree(rbtreeItemCompare)} for _, i := range bits { - bm.setBit(i) + bm.SetBit(i) } return bm } @@ -364,7 +364,7 @@ func (b *Bitmap) Bits() []uint64 { } // setBit sets the i-th bit of the bitmap. -func (b *Bitmap) setBit(i uint64) (changed bool) { +func (b *Bitmap) SetBit(i uint64) (changed bool) { address := deref(i) chunk := b.Chunk(&Chunk{address.ChunkKey, make(Blocks, 32)}) @@ -382,7 +382,7 @@ func (b *Bitmap) setBit(i uint64) (changed bool) { } // clearBit clears the i-th bit of the bitmap. -func (b *Bitmap) clearBit(i uint64) (changed bool) { +func (b *Bitmap) ClearBit(i uint64) (changed bool) { address := deref(i) chunk := b.Chunk(&Chunk{address.ChunkKey, make(Blocks, 32)}) diff --git a/fragment.go b/fragment.go index 83095d021..545f7aa8d 100644 --- a/fragment.go +++ b/fragment.go @@ -332,7 +332,7 @@ func (f *Fragment) bitmap(bitmapID uint64) *Bitmap { bm := NewBitmap() f.storage.ForEachRange(bitmapID*SliceWidth, (bitmapID+1)*SliceWidth, func(i uint64) { profileID := (f.slice * SliceWidth) + (i % SliceWidth) - bm.setBit(profileID) + bm.SetBit(profileID) }) // Add to the cache. @@ -377,7 +377,7 @@ func (f *Fragment) setBit(bitmapID, profileID uint64) (changed bool, bool error) } // Update the cache. - if f.bitmap(bitmapID).setBit(profileID) { + if f.bitmap(bitmapID).SetBit(profileID) { changed = true } @@ -422,7 +422,7 @@ func (f *Fragment) ClearBit(bitmapID, profileID uint64) (bool, error) { } // Update the cache. - if f.bitmap(bitmapID).clearBit(profileID) { + if f.bitmap(bitmapID).ClearBit(profileID) { return true, nil } diff --git a/handler.go b/handler.go index fff3cf6f1..cb4a99f04 100644 --- a/handler.go +++ b/handler.go @@ -408,7 +408,7 @@ func (h *Handler) handlePostImport(w http.ResponseWriter, r *http.Request) { // Import into fragment. err = f.Import(req.GetBitmapIDs(), req.GetProfileIDs()) if err != nil { - h.logger().Printf("import error: db=%s, frame=%s, slice=%s, bits=%d, err=%s", db, frame, slice, len(req.GetProfileIDs()), err) + h.logger().Printf("import error: db=%s, frame=%s, slice=%d, bits=%d, err=%s", db, frame, slice, len(req.GetProfileIDs()), err) } // Marshal response object.