4 rbm "github.com/RoaringBitmap/roaring"
5 roaring "github.com/RoaringBitmap/roaring/BitSliceIndexing"
8 type pendingRequests struct {
12 func (p *pendingRequests) Dec(r RequestIndex) {
14 prev, _ := p.m.GetValue(_r)
18 p.m.SetValue(_r, prev-1)
21 func (p *pendingRequests) Inc(r RequestIndex) {
23 prev, _ := p.m.GetValue(_r)
24 p.m.SetValue(_r, prev+1)
27 func (p *pendingRequests) Init(maxIndex RequestIndex) {
28 p.m = roaring.NewDefaultBSI()
31 var allBits rbm.Bitmap
34 allBits.AddRange(0, rbm.MaxRange)
37 func (p *pendingRequests) AssertEmpty() {
41 sum, _ := p.m.Sum(&allBits)
47 func (p *pendingRequests) Get(r RequestIndex) int {
48 count, _ := p.m.GetValue(uint64(r))