( start, end []byte, bucketName core.BucketName, )
| 120 | } |
| 121 | |
| 122 | func (pending *pendingEntryList) getDataByRange( |
| 123 | start, end []byte, bucketName core.BucketName, |
| 124 | ) (keys, values [][]byte) { |
| 125 | |
| 126 | mp, ok := pending.entriesInBTree[bucketName] |
| 127 | if !ok { |
| 128 | return nil, nil |
| 129 | } |
| 130 | keys = make([][]byte, 0) |
| 131 | values = make([][]byte, 0) |
| 132 | for _, v := range mp { |
| 133 | if bytes.Compare(start, v.Key) <= 0 && bytes.Compare(v.Key, end) <= 0 { |
| 134 | keys = append(keys, v.Key) |
| 135 | values = append(values, v.Value) |
| 136 | } |
| 137 | } |
| 138 | sort.Sort(&sortkv{ |
| 139 | k: keys, |
| 140 | v: values, |
| 141 | }) |
| 142 | return |
| 143 | } |
| 144 | |
| 145 | // rangeBucket input a range handler function f and call it with every bucket in pendingBucketList |
| 146 | func (p pendingBucketList) rangeBucket(f func(bucket *core.Bucket) error) error { |
no test coverage detected