diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/repl/reporter.h | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/repl/reporter.h')
-rw-r--r-- | src/mongo/db/repl/reporter.h | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/src/mongo/db/repl/reporter.h b/src/mongo/db/repl/reporter.h index 44145373326..c7c502e8f5f 100644 --- a/src/mongo/db/repl/reporter.h +++ b/src/mongo/db/repl/reporter.h @@ -35,90 +35,90 @@ namespace mongo { namespace repl { - class ReplicationProgressManager { - public: - virtual bool prepareReplSetUpdatePositionCommand(BSONObjBuilder* cmdBuilder) = 0; - virtual ~ReplicationProgressManager(); - }; - - class Reporter { - MONGO_DISALLOW_COPYING(Reporter); - - public: - Reporter(ReplicationExecutor* executor, - ReplicationProgressManager* replicationProgressManager, - const HostAndPort& target); - virtual ~Reporter(); - - /** - * Returns true if a remote command has been scheduled (but not completed) - * with the executor. - */ - bool isActive() const; - - /** - * Returns true if a remote command should be scheduled once the current one returns - * from the executor. - */ - bool willRunAgain() const; - - /** - * Cancels remote command request. - * Returns immediately if the Reporter is not active. - */ - void cancel(); - - /** - * Waits for last/current executor handle to finish. - * Returns immediately if the handle is invalid. - */ - void wait(); - - /** - * Signals to the Reporter that there is new information to be sent to the "_target" server. - * Returns the _status, indicating any error the Reporter has encountered. - */ - Status trigger(); - - /** - * Returns the previous return status so that the owner can decide whether the Reporter - * needs a new target to whom it can report. - */ - Status getStatus() const; - - private: - /** - * Schedules remote command to be run by the executor - */ - Status _schedule_inlock(); - - /** - * Callback for remote command. - */ - void _callback(const ReplicationExecutor::RemoteCommandCallbackArgs& rcbd); - - // Not owned by us. - ReplicationExecutor* _executor; - ReplicationProgressManager* _updatePositionSource; - - // Host to whom the Reporter sends updates. - HostAndPort _target; - - // Protects member data of this Reporter. - mutable stdx::mutex _mutex; - - // Stores the most recent Status returned from the ReplicationExecutor. - Status _status; - - // _willRunAgain is true when Reporter is scheduled to be run by the executor and subsequent - // updates have come in. - bool _willRunAgain; - // _active is true when Reporter is scheduled to be run by the executor. - bool _active; - - // Callback handle to the scheduled remote command. - ReplicationExecutor::CallbackHandle _remoteCommandCallbackHandle; - }; - -} // namespace repl -} // namespace mongo +class ReplicationProgressManager { +public: + virtual bool prepareReplSetUpdatePositionCommand(BSONObjBuilder* cmdBuilder) = 0; + virtual ~ReplicationProgressManager(); +}; + +class Reporter { + MONGO_DISALLOW_COPYING(Reporter); + +public: + Reporter(ReplicationExecutor* executor, + ReplicationProgressManager* replicationProgressManager, + const HostAndPort& target); + virtual ~Reporter(); + + /** + * Returns true if a remote command has been scheduled (but not completed) + * with the executor. + */ + bool isActive() const; + + /** + * Returns true if a remote command should be scheduled once the current one returns + * from the executor. + */ + bool willRunAgain() const; + + /** + * Cancels remote command request. + * Returns immediately if the Reporter is not active. + */ + void cancel(); + + /** + * Waits for last/current executor handle to finish. + * Returns immediately if the handle is invalid. + */ + void wait(); + + /** + * Signals to the Reporter that there is new information to be sent to the "_target" server. + * Returns the _status, indicating any error the Reporter has encountered. + */ + Status trigger(); + + /** + * Returns the previous return status so that the owner can decide whether the Reporter + * needs a new target to whom it can report. + */ + Status getStatus() const; + +private: + /** + * Schedules remote command to be run by the executor + */ + Status _schedule_inlock(); + + /** + * Callback for remote command. + */ + void _callback(const ReplicationExecutor::RemoteCommandCallbackArgs& rcbd); + + // Not owned by us. + ReplicationExecutor* _executor; + ReplicationProgressManager* _updatePositionSource; + + // Host to whom the Reporter sends updates. + HostAndPort _target; + + // Protects member data of this Reporter. + mutable stdx::mutex _mutex; + + // Stores the most recent Status returned from the ReplicationExecutor. + Status _status; + + // _willRunAgain is true when Reporter is scheduled to be run by the executor and subsequent + // updates have come in. + bool _willRunAgain; + // _active is true when Reporter is scheduled to be run by the executor. + bool _active; + + // Callback handle to the scheduled remote command. + ReplicationExecutor::CallbackHandle _remoteCommandCallbackHandle; +}; + +} // namespace repl +} // namespace mongo |