Apache Mesos
|
The MetadataManager tracks the Docker images cached by the provisioner that are stored on disk. More...
#include <metadata_manager.hpp>
Public Member Functions | |
~MetadataManager () | |
process::Future< Nothing > | recover () |
Recover all stored Image and its layer references. More... | |
process::Future< Image > | put (const Image &image) |
Put the image in metadata manager and persist the reference store state to disk. More... | |
process::Future< Option< Image > > | get (const ::docker::spec::ImageReference &reference, bool cached) |
Retrieve Image based on image reference if it is among the Images stored in memory. More... | |
process::Future< hashset< std::string > > | prune (const std::vector<::docker::spec::ImageReference > &excludedImages) |
Prune images from the metadata manager by comparing existing images with active images in use. More... | |
Static Public Member Functions | |
static Try< process::Owned< MetadataManager > > | create (const Flags &flags) |
The MetadataManager tracks the Docker images cached by the provisioner that are stored on disk.
It keeps track of the layers that Docker images are composed of and recovers Image objects upon initialization by checking for dependent layers stored on disk. Currently, image layers are stored indefinitely, with no garbage collection of unreferenced image layers.
mesos::internal::slave::docker::MetadataManager::~MetadataManager | ( | ) |
|
static |
process::Future<Option<Image> > mesos::internal::slave::docker::MetadataManager::get | ( | const ::docker::spec::ImageReference & | reference, |
bool | cached | ||
) |
process::Future<hashset<std::string> > mesos::internal::slave::docker::MetadataManager::prune | ( | const std::vector<::docker::spec::ImageReference > & | excludedImages | ) |
Prune images from the metadata manager by comparing existing images with active images in use.
This function will remove all images not used anymore, and return the list of layers which are still referenced. The caller should ensure such layers are kept in best effort.
excludedImages | all images to exclude from pruning. |
process::Future<Image> mesos::internal::slave::docker::MetadataManager::put | ( | const Image & | image | ) |
Put the image in metadata manager and persist the reference store state to disk.
process::Future<Nothing> mesos::internal::slave::docker::MetadataManager::recover | ( | ) |
Recover all stored Image and its layer references.