2121#include " ep_engine.h"
2222#include " executorpool.h"
2323#include " kv_bucket.h"
24- #include " kvshard.h"
2524#include " tasks.h"
2625#include " vbucket_bgfetch_item.h"
2726#include < phosphor/phosphor.h>
2827#include < algorithm>
2928#include < climits>
3029#include < vector>
3130
32- BgFetcher::BgFetcher (KVBucket& s, KVShard& k)
33- : BgFetcher(s, k, s.getEPEngine().getEpStats()) {
31+ BgFetcher::BgFetcher (KVBucket& s) : BgFetcher(s, s.getEPEngine().getEpStats()) {
3432}
3533
3634BgFetcher::~BgFetcher () {
@@ -88,7 +86,7 @@ size_t BgFetcher::doFetch(Vbid vbId, vb_bgfetch_queue_t& itemsToFetch) {
8886 startTime.time_since_epoch ())
8987 .count ());
9088
91- shard .getROUnderlying ()->getMulti (vbId, itemsToFetch);
89+ store .getROUnderlying (vbId )->getMulti (vbId, itemsToFetch);
9290
9391 std::vector<bgfetched_item_t > fetchedItems;
9492 for (const auto & fetch : itemsToFetch) {
@@ -143,7 +141,7 @@ bool BgFetcher::run(GlobalTask *task) {
143141 size_t num_fetched_items = 0 ;
144142
145143 for (const auto vbId : bg_vbs) {
146- VBucketPtr vb = shard. getBucket (vbId);
144+ VBucketPtr vb = store. getVBucket (vbId);
147145 if (vb) {
148146 // Requeue the bg fetch task if vbucket DB file is not created yet.
149147 if (vb->isBucketCreation ()) {
@@ -166,13 +164,3 @@ bool BgFetcher::run(GlobalTask *task) {
166164
167165 return true ;
168166}
169-
170- bool BgFetcher::pendingJob () const {
171- for (const auto vbid : shard.getVBuckets ()) {
172- VBucketPtr vb = shard.getBucket (vbid);
173- if (vb && vb->hasPendingBGFetchItems ()) {
174- return true ;
175- }
176- }
177- return false ;
178- }
0 commit comments