Apache Mesos
Public Member Functions | Static Public Member Functions | List of all members
mesos::internal::slave::docker::MetadataManager Class Reference

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< Nothingrecover ()
 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)
 

Detailed Description

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.

Constructor & Destructor Documentation

mesos::internal::slave::docker::MetadataManager::~MetadataManager ( )

Member Function Documentation

static Try<process::Owned<MetadataManager> > mesos::internal::slave::docker::MetadataManager::create ( const Flags flags)
static
process::Future<Option<Image> > mesos::internal::slave::docker::MetadataManager::get ( const ::docker::spec::ImageReference &  reference,
bool  cached 
)

Retrieve Image based on image reference if it is among the Images stored in memory.

Parameters
referencethe reference of the Docker image to retrieve
cachedthe flag whether pull Docker image forcelly from remote registry or local repo.
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.

Parameters
excludedImagesall images to exclude from pruning.
Returns
a list of all layers still refered.
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.


The documentation for this class was generated from the following file: