17 #ifndef __SLAVE_CONTAINERIZER_FETCHER_PROCESS_HPP__ 18 #define __SLAVE_CONTAINERIZER_FETCHER_PROCESS_HPP__ 48 const ContainerID& containerId,
49 const CommandInfo& commandInfo,
50 const std::string& sandboxDirectory,
56 const ContainerID& containerId,
57 const std::string& sandboxDirectory,
59 const mesos::fetcher::FetcherInfo& info);
63 void kill(
const ContainerID& containerId);
76 const std::string&
key,
130 unsigned long referenceCount;
136 explicit Cache(
Bytes _space) : space(_space), tally(0), filenameSerial(0) {}
152 std::shared_ptr<Entry>
create(
153 const std::string& cacheDirectory,
155 const CommandInfo::URI& uri);
161 const std::string& uri);
168 bool contains(
const std::shared_ptr<Cache::Entry>& entry)
const;
172 virtual Try<Nothing> remove(
const std::shared_ptr<Entry>& entry);
194 Try<Nothing> validate(
const std::shared_ptr<Cache::Entry>& entry);
203 unsigned long filenameSerial;
210 std::list<std::shared_ptr<Entry>> lruSortedEntries;
219 const ContainerID& containerId,
220 const std::string& sandboxDirectory,
221 const std::string& cacheDirectory,
238 const hashmap<CommandInfo::URI,
239 Option<std::shared_ptr<Cache::Entry>>>& entries,
240 const ContainerID& containerId,
241 const std::string& sandboxDirectory,
242 const std::string& cacheDirectory,
250 const std::shared_ptr<Cache::Entry>& entry);
280 #endif // __SLAVE_CONTAINERIZER_FETCHER_PROCESS_HPP__ FetcherProcess(const Flags &_flags)
bool contains(const Option< std::string > &user, const std::string &uri) const
Try< Nothing > adjust(const std::shared_ptr< Cache::Entry > &entry)
Try< Nothing > reserve(const Bytes &requestedSpace)
bool isReferenced() const
Cache(Bytes _space)
Definition: fetcher_process.hpp:136
Result< std::string > user(Option< uid_t > uid=None())
Definition: su.hpp:284
Definition: fetcher_process.hpp:41
Try< std::list< Path > > cacheFiles() const
process::Future< Nothing > fetch(const ContainerID &containerId, const CommandInfo &commandInfo, const std::string &sandboxDirectory, const Option< std::string > &user)
const std::string key
Definition: fetcher_process.hpp:111
virtual process::Future< Nothing > _fetch(const hashmap< CommandInfo::URI, Option< process::Future< std::shared_ptr< Cache::Entry >>>> &entries, const ContainerID &containerId, const std::string &sandboxDirectory, const std::string &cacheDirectory, const Option< std::string > &user)
std::string join(const std::string &path1, const std::string &path2, const char _separator=os::PATH_SEPARATOR)
Definition: path.hpp:116
Definition: fetcher_process.hpp:72
std::string nextFilename(const CommandInfo::URI &uri)
Definition: counter.hpp:26
Definition: fetcher_process.hpp:69
const std::string filename
Definition: fetcher_process.hpp:120
Definition: hashmap.hpp:38
Definition: pull_gauge.hpp:46
~Entry()
Definition: fetcher_process.hpp:85
Represents a POSIX or Windows file system path and offers common path manipulations.
Definition: path.hpp:212
virtual process::Future< Nothing > run(const ContainerID &containerId, const std::string &sandboxDirectory, const Option< std::string > &user, const mesos::fetcher::FetcherInfo &info)
void releaseSpace(const Bytes &bytes)
const std::string directory
Definition: fetcher_process.hpp:116
virtual ~Cache()
Definition: fetcher_process.hpp:137
Path path() const
Definition: fetcher_process.hpp:108
~FetcherProcess() override
Definition: attributes.hpp:24
void claimSpace(const Bytes &bytes)
Bytes size
Definition: fetcher_process.hpp:125
Entry(const std::string &key, const std::string &directory, const std::string &filename)
Definition: fetcher_process.hpp:75
Bytes availableSpace() const
process::Future< Nothing > completion()
Definition: process.hpp:505
Try< std::list< std::shared_ptr< Cache::Entry > > > selectVictims(const Bytes &requiredSpace)
void kill(const ContainerID &containerId)
std::shared_ptr< Entry > create(const std::string &cacheDirectory, const Option< std::string > &user, const CommandInfo::URI &uri)
Bytes availableCacheSpace() const