summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/initial_syncer.h
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2020-02-11 23:24:56 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-19 03:22:12 +0000
commit06a03bc6ec3235c4ab79f7bd4e55083e3165a48b (patch)
tree9b3c92a82dfdb4f51d7656a2437a5cea08d7c6fb /src/mongo/db/repl/initial_syncer.h
parent89d41b39c093918ba9dc27841f0841b237d3f438 (diff)
downloadmongo-06a03bc6ec3235c4ab79f7bd4e55083e3165a48b.tar.gz
SERVER-45574: Use NewOplogFetcher in steady state replication and initial sync
Diffstat (limited to 'src/mongo/db/repl/initial_syncer.h')
-rw-r--r--src/mongo/db/repl/initial_syncer.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/mongo/db/repl/initial_syncer.h b/src/mongo/db/repl/initial_syncer.h
index cc907f9b72e..43d21bdafc3 100644
--- a/src/mongo/db/repl/initial_syncer.h
+++ b/src/mongo/db/repl/initial_syncer.h
@@ -155,20 +155,19 @@ public:
/**
* Type of function to create an OplogFetcher.
*/
- using CreateOplogFetcherFn = std::function<std::unique_ptr<OplogFetcher>(
+ using CreateOplogFetcherFn = std::function<std::unique_ptr<NewOplogFetcher>(
executor::TaskExecutor* executor,
OpTime lastFetched,
HostAndPort source,
- NamespaceString nss,
ReplSetConfig config,
- std::unique_ptr<OplogFetcher::OplogFetcherRestartDecision> oplogFetcherRestartDecision,
+ std::unique_ptr<NewOplogFetcher::OplogFetcherRestartDecision> oplogFetcherRestartDecision,
int requiredRBID,
bool requireFresherSyncSource,
DataReplicatorExternalState* dataReplicatorExternalState,
- OplogFetcher::EnqueueDocumentsFn enqueueDocumentsFn,
- OplogFetcher::OnShutdownCallbackFn onShutdownCallbackFn,
+ NewOplogFetcher::EnqueueDocumentsFn enqueueDocumentsFn,
+ NewOplogFetcher::OnShutdownCallbackFn onShutdownCallbackFn,
const int batchSize,
- OplogFetcher::StartingPoint startingPoint)>;
+ NewOplogFetcher::StartingPoint startingPoint)>;
struct InitialSyncAttemptInfo {
int durationMillis;
@@ -184,22 +183,22 @@ public:
};
class OplogFetcherRestartDecisionInitialSyncer
- : public AbstractOplogFetcher::OplogFetcherRestartDecision {
+ : public NewOplogFetcher::OplogFetcherRestartDecision {
public:
OplogFetcherRestartDecisionInitialSyncer(InitialSyncSharedData* sharedData,
std::size_t maxFetcherRestarts)
: _sharedData(sharedData), _defaultDecision(maxFetcherRestarts){};
- bool shouldContinue(AbstractOplogFetcher* fetcher, Status status) final;
+ bool shouldContinue(NewOplogFetcher* fetcher, Status status) final;
- void fetchSuccessful(AbstractOplogFetcher* fetcher) final;
+ void fetchSuccessful(NewOplogFetcher* fetcher) final;
private:
InitialSyncSharedData* _sharedData;
// We delegate to the default strategy when it's a non-network error.
- AbstractOplogFetcher::OplogFetcherRestartDecisionDefault _defaultDecision;
+ NewOplogFetcher::OplogFetcherRestartDecisionDefault _defaultDecision;
// The operation, if any, currently being retried because of a network error.
InitialSyncSharedData::RetryableOperation _retryingOperation;
@@ -281,7 +280,7 @@ public:
*
* For testing only.
*/
- OplogFetcher* getOplogFetcher_forTest() const;
+ NewOplogFetcher* getOplogFetcher_forTest() const;
/**
*
@@ -592,9 +591,9 @@ private:
* Returns a status even though it always returns OK, to conform the interface OplogFetcher
* expects for the EnqueueDocumentsFn.
*/
- Status _enqueueDocuments(Fetcher::Documents::const_iterator begin,
- Fetcher::Documents::const_iterator end,
- const OplogFetcher::DocumentsInfo& info);
+ Status _enqueueDocuments(NewOplogFetcher::Documents::const_iterator begin,
+ NewOplogFetcher::Documents::const_iterator end,
+ const NewOplogFetcher::DocumentsInfo& info);
void _appendInitialSyncProgressMinimal_inlock(BSONObjBuilder* bob) const;
BSONObj _getInitialSyncProgress_inlock() const;
@@ -744,7 +743,7 @@ private:
InitialSyncSharedData::RetryableOperation _retryingOperation; // (M)
std::unique_ptr<InitialSyncState> _initialSyncState; // (M)
- std::unique_ptr<OplogFetcher> _oplogFetcher; // (S)
+ std::unique_ptr<NewOplogFetcher> _oplogFetcher; // (S)
std::unique_ptr<Fetcher> _beginFetchingOpTimeFetcher; // (S)
std::unique_ptr<Fetcher> _lastOplogEntryFetcher; // (S)
std::unique_ptr<Fetcher> _fCVFetcher; // (S)