libzypp 17.37.17
commitpackagepreloader_p.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
10#ifndef ZYPP_TARGET_PRIVATE_COMMITPACKAGEPRELOADER_H
11#define ZYPP_TARGET_PRIVATE_COMMITPACKAGEPRELOADER_H
12
13#include <zypp-core/Pathname.h>
18#include <zypp/ZYppCallbacks.h>
19
20#include <map>
21#include <deque>
22#include <chrono>
23
24namespace zyppng {
25ZYPP_FWD_DECL_TYPE_WITH_REFS(NetworkRequestDispatcher);
27}
28
29namespace zypp {
30
32{
33 using clock = std::chrono::steady_clock;
34public:
36
37 void preloadTransaction( const std::vector<sat::Transaction::Step> &steps );
38 void cleanupCaches();
39 bool missed() const;
40
41private:
42 class PreloadWorker;
43 struct RepoUrl {
46 int refs = 0; //< how many workers operate on the mirror
47 int miss = 0; //< how many times this mirror had files misses
48 };
49
51 std::vector<RepoUrl> _baseUrls;
52 };
53
54 void reportBytesDownloaded ( ByteCount newBytes );
55
56 std::map<Repository::IdType, RepoDownloadData> _dlRepoInfo;
57 std::deque<PoolItem> _requiredDls;
58 std::vector<zyppng::Ref<PreloadWorker>> _workers;
61 bool _missedDownloads = false;
62
65 std::optional<clock::time_point> _lastProgressUpdate;
66
67 zyppng::NetworkRequestDispatcherRef _dispatcher;
68};
69
70}
71
72#endif // ZYPP_TARGET_PRIVATE_COMMITPACKAGEPRELOADER_H
Store and operate with byte count.
Definition ByteCount.h:32
callback::SendReport< media::CommitPreloadReport > _report
std::optional< clock::time_point > _lastProgressUpdate
zyppng::Ref< internal::ProgressTracker > _pTracker
std::map< Repository::IdType, RepoDownloadData > _dlRepoInfo
std::vector< zyppng::Ref< PreloadWorker > > _workers
void reportBytesDownloaded(ByteCount newBytes)
void preloadTransaction(const std::vector< sat::Transaction::Step > &steps)
zyppng::NetworkRequestDispatcherRef _dispatcher
Url manipulation class.
Definition Url.h:93
std::multimap< std::string, std::string > HeaderList
Easy-to use interface to the ZYPP dependency resolver.
std::shared_ptr< T > Ref
Definition zyppglobal.h:110
media::UrlResolverPlugin::HeaderList headers
#define ZYPP_FWD_DECL_TYPE_WITH_REFS(T)
Definition zyppglobal.h:126