diff options
author | Arne H Juul <arnej@yahoo-inc.com> | 2017-04-11 11:44:16 +0200 |
---|---|---|
committer | Arne H Juul <arnej@yahoo-inc.com> | 2017-04-11 11:44:16 +0200 |
commit | 79c686fc4b64defd69bab91262890697813395f3 (patch) | |
tree | 130a8f507cab8e3666186ff575cf12b416d7dc20 /filedistribution/src | |
parent | 3bb762da8b684c28ea804b37257443a68927141d (diff) |
add override in filedistribution module
Diffstat (limited to 'filedistribution/src')
11 files changed, 43 insertions, 44 deletions
diff --git a/filedistribution/src/apps/filedistributor/filedistributor.cpp b/filedistribution/src/apps/filedistributor/filedistributor.cpp index 1d51c032e9c..452b951bf6b 100644 --- a/filedistribution/src/apps/filedistributor/filedistributor.cpp +++ b/filedistribution/src/apps/filedistributor/filedistributor.cpp @@ -140,20 +140,20 @@ public: FileDistributor(); ~FileDistributor(); - void notifyGenerationChange(int64_t generation) { + void notifyGenerationChange(int64_t generation) override { if (_components && ! completeReconfigurationNeeded()) { _components->updatedConfig(generation); } } //configure overrides - void configure(std::unique_ptr<ZookeepersConfig> config) { + void configure(std::unique_ptr<ZookeepersConfig> config) override { LockGuard guard(_configMutex); _zooKeepersConfig = std::move(config); _completeReconfigurationNeeded = true; } - void configure(std::unique_ptr<FiledistributorConfig> config) { + void configure(std::unique_ptr<FiledistributorConfig> config) override { LockGuard guard(_configMutex); if (_fileDistributorConfig.get() != NULL && (config->torrentport != _fileDistributorConfig->torrentport || @@ -169,7 +169,7 @@ public: } - void configure(std::unique_ptr<FiledistributorrpcConfig> config) { + void configure(std::unique_ptr<FiledistributorrpcConfig> config) override { LockGuard guard(_configMutex); _rpcConfig = std::move(config); _completeReconfigurationNeeded = true; @@ -241,8 +241,7 @@ class FileDistributorApplication : public FastOS_Application { public: FileDistributorApplication(const config::ConfigUri & configUri); - //overrides - int Main(); + int Main() override; }; namespace { diff --git a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp index c9d93ffc218..56a664ea7e1 100644 --- a/filedistribution/src/tests/filedownloader/testfiledownloader.cpp +++ b/filedistribution/src/tests/filedownloader/testfiledownloader.cpp @@ -47,15 +47,15 @@ createDownloader(ComponentsDeleter& deleter, } //anonymous namespace class MockFileDistributionModel : public FileDistributionModel { - virtual FileDBModel& getFileDBModel() { + virtual FileDBModel& getFileDBModel() override { abort(); } - virtual std::set<std::string> getFilesToDownload() { + virtual std::set<std::string> getFilesToDownload() override { return std::set<std::string>(); } - virtual PeerEntries getPeers(const std::string& , size_t) { + virtual PeerEntries getPeers(const std::string&, size_t) override { PeerEntries peers(2); peers[0].ip = localHost; peers[0].port = uploaderPort; @@ -66,9 +66,9 @@ class MockFileDistributionModel : public FileDistributionModel { return peers; } - virtual void addPeer(const std::string&) {} - virtual void removePeer(const std::string&) {} - virtual void peerFinished(const std::string&) {} + virtual void addPeer(const std::string&) override {} + virtual void removePeer(const std::string&) override {} + virtual void peerFinished(const std::string&) override {} }; diff --git a/filedistribution/src/tests/rpc/mockfileprovider.h b/filedistribution/src/tests/rpc/mockfileprovider.h index 230cd0d0382..33177d939c1 100644 --- a/filedistribution/src/tests/rpc/mockfileprovider.h +++ b/filedistribution/src/tests/rpc/mockfileprovider.h @@ -14,7 +14,7 @@ public: boost::barrier _queueForeverBarrier; - boost::optional<Path> getPath(const std::string& fileReference) { + boost::optional<Path> getPath(const std::string& fileReference) override { if (fileReference == "dd") { return Path("direct/result/path"); } else { @@ -22,7 +22,7 @@ public: } } - void downloadFile(const std::string& fileReference) { + void downloadFile(const std::string& fileReference) override { if (fileReference == _queueForeverFileReference) { _queueForeverBarrier.wait(); return; @@ -33,11 +33,11 @@ public: } //Overrides - DownloadCompletedSignal& downloadCompleted() { + DownloadCompletedSignal& downloadCompleted() override { return _downloadCompleted; } - DownloadFailedSignal& downloadFailed() { + DownloadFailedSignal& downloadFailed() override { return _downloadFailed; } diff --git a/filedistribution/src/tests/scheduler/test-scheduler.cpp b/filedistribution/src/tests/scheduler/test-scheduler.cpp index a9249bbdcae..5be60569449 100644 --- a/filedistribution/src/tests/scheduler/test-scheduler.cpp +++ b/filedistribution/src/tests/scheduler/test-scheduler.cpp @@ -50,7 +50,7 @@ BOOST_FIXTURE_TEST_SUITE(SchedulerTest, Fixture) struct RepeatedTask : Scheduler::Task { - void doHandle() { + void doHandle() override { std::cout <<"RepeatedTask::doHandle " <<std::endl; schedule(boost::posix_time::seconds(1)); } @@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE(require_tasks_does_not_keep_scheduler_alive) { struct EnsureInvokedTask : Scheduler::Task { boost::barrier& _barrier; - void doHandle() { + void doHandle() override { _barrier.wait(); } @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(require_task_invoked) { } struct ThrowExceptionTask : Scheduler::Task { - void doHandle() { + void doHandle() override { throw TestException(); } diff --git a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp index c20e7058933..46db660d452 100644 --- a/filedistribution/src/tests/zkfacade/test-zkfacade.cpp +++ b/filedistribution/src/tests/zkfacade/test-zkfacade.cpp @@ -28,7 +28,7 @@ struct Watcher : public ZKFacade::NodeChangedWatcher { Watcher() : _barrier(2) {} - void operator()() { + void operator()() override { _barrier.wait(); } }; @@ -206,7 +206,7 @@ BOOST_AUTO_TEST_CASE(require_that_zkfacade_can_be_deleted_from_callback) :_zk(zk) {} - void operator()() { + void operator()() override { BOOST_CHECK(_zk.use_count() == 2); _zk.reset(); Watcher::operator()(); diff --git a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp index 2412b00ecd6..1db2f7c6e49 100644 --- a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp +++ b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.cpp @@ -68,7 +68,7 @@ struct TrackingTask : public Scheduler::Task { ~TrackingTask(); //TODO: refactor - void doHandle(); + void doHandle() override; PeerEntries getPeers(const std::shared_ptr<FileDownloader>& downloader); void reschedule(); }; diff --git a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.h b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.h index abb7367974a..e22fdab1e30 100644 --- a/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.h +++ b/filedistribution/src/vespa/filedistribution/distributor/filedistributortrackerimpl.h @@ -30,7 +30,7 @@ public: virtual ~FileDistributorTrackerImpl(); //overrides - void trackingRequest(libtorrent::tracker_request& request, const TorrentSP & torrent); + void trackingRequest(libtorrent::tracker_request& request, const TorrentSP & torrent) override; void setDownloader(const std::shared_ptr<FileDownloader>& downloader); }; diff --git a/filedistribution/src/vespa/filedistribution/distributor/filedownloadermanager.h b/filedistribution/src/vespa/filedistribution/distributor/filedownloadermanager.h index 64a2a8a744e..21bc8f5200f 100644 --- a/filedistribution/src/vespa/filedistribution/distributor/filedownloadermanager.h +++ b/filedistribution/src/vespa/filedistribution/distributor/filedownloadermanager.h @@ -49,15 +49,15 @@ public: ~FileDownloaderManager(); void start(); - boost::optional<Path> getPath(const std::string& fileReference); - void downloadFile(const std::string& fileReference); + boost::optional<Path> getPath(const std::string& fileReference) override; + void downloadFile(const std::string& fileReference) override; //FileProvider overrides - DownloadCompletedSignal& downloadCompleted() { + DownloadCompletedSignal& downloadCompleted() override { return _fileDownloader->_downloadCompleted; } - DownloadFailedSignal& downloadFailed() { + DownloadFailedSignal& downloadFailed() override { return _fileDownloader->_downloadFailed; } }; diff --git a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp index 01b08e1f377..0288f3082f8 100644 --- a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp +++ b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.cpp @@ -86,7 +86,7 @@ struct FileDistributionModelImpl::DeployedFilesChangedCallback : {} //override - void operator()() { + void operator()() override { if (std::shared_ptr<FileDistributionModelImpl> model = _parent.lock()) { model->_filesToDownloadChanged(); } diff --git a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h index 0c89e8b12ae..e132ec8b230 100644 --- a/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h +++ b/filedistribution/src/vespa/filedistribution/model/filedistributionmodelimpl.h @@ -48,20 +48,20 @@ public: ~FileDistributionModelImpl(); //overrides FileDistributionModel - FileDBModel& getFileDBModel() { + FileDBModel& getFileDBModel() override { return _fileDBModel; } - std::set<std::string> getFilesToDownload(); + std::set<std::string> getFilesToDownload() override; - PeerEntries getPeers(const std::string& fileReference, size_t maxPeers); - void addPeer(const std::string& fileReference); - void removePeer(const std::string& fileReference); - void peerFinished(const std::string& fileReference); + PeerEntries getPeers(const std::string& fileReference, size_t maxPeers) override; + void addPeer(const std::string& fileReference) override; + void removePeer(const std::string& fileReference) override; + void peerFinished(const std::string& fileReference) override; void addConfigServersAsPeers(std::vector<std::string>& peers, char const* envConfigServer, int port); //Overrides Subscriber - void configure(std::unique_ptr<FilereferencesConfig> config); + void configure(std::unique_ptr<FilereferencesConfig> config) override; }; } //namespace filedistribution diff --git a/filedistribution/src/vespa/filedistribution/model/zkfiledbmodel.h b/filedistribution/src/vespa/filedistribution/model/zkfiledbmodel.h index 7be2a383e7b..126d9da3424 100644 --- a/filedistribution/src/vespa/filedistribution/model/zkfiledbmodel.h +++ b/filedistribution/src/vespa/filedistribution/model/zkfiledbmodel.h @@ -25,30 +25,30 @@ public: } //overrides - bool hasFile(const std::string& fileReference); - void addFile(const std::string& fileReference, const Buffer& buffer); + bool hasFile(const std::string& fileReference) override; + void addFile(const std::string& fileReference, const Buffer& buffer) override; Buffer getFile(const std::string& fileReference) override; - void cleanFiles(const std::vector<std::string>& filesToPreserve); + void cleanFiles(const std::vector<std::string>& filesToPreserve) override; void setDeployedFilesToDownload(const std::string& hostName, const std::string & appId, - const std::vector<std::string> & files); + const std::vector<std::string> & files) override; void cleanDeployedFilesToDownload( const std::vector<std::string> & hostsToPreserve, - const std::string& appId); + const std::string& appId) override; void removeDeploymentsThatHaveDifferentApplicationId( const std::vector<std::string> & hostsToPreserve, - const std::string& appId); + const std::string& appId) override; void removeNonApplicationFiles( const Path & hostPath, const std::string& appId); - std::vector<std::string> getHosts(); - HostStatus getHostStatus(const std::string& hostName); + std::vector<std::string> getHosts() override; + HostStatus getHostStatus(const std::string& hostName) override; ZKFileDBModel(const std::shared_ptr<ZKFacade>& zk); Progress getProgress(const std::string& fileReference, - const std::vector<std::string>& hostsSortedAscending); + const std::vector<std::string>& hostsSortedAscending) override; }; } //namespace filedistribution |