Apache Mesos
Classes | Public Member Functions | Static Public Member Functions | List of all members
mesos::internal::slave::appc::Cache Class Reference

Encapsulates Appc image cache. More...

#include <cache.hpp>

Public Member Functions

Try< Nothingrecover ()
 Recovers/rebuilds the cache from its image store directory. More...
 
Try< Nothingadd (const std::string &imageId)
 Adds an image to the cache by the image's id. More...
 
Option< std::string > find (const Image::Appc &image) const
 Finds image id of an image if it is present in the cache/store. More...
 

Static Public Member Functions

static Try< process::Owned< Cache > > create (const Path &storeDir)
 Factory method for creating cache. More...
 

Detailed Description

Encapsulates Appc image cache.

Note: We only keep 1 level image information and do not bother to keep dependency information. This is because dependency graph will be resolved at runtime (say when store->get is called).

Member Function Documentation

Try<Nothing> mesos::internal::slave::appc::Cache::add ( const std::string &  imageId)

Adds an image to the cache by the image's id.

Add is done in two steps:

  1. A cache entry is created using the path constructed from store directory and the imageId parameter.
  2. The cache entry is inserted into the cache.
Parameters
imageIdImage id for the image that has to be added to the cache.
Returns
Nothing on success. Error on failure to add.
static Try<process::Owned<Cache> > mesos::internal::slave::appc::Cache::create ( const Path storeDir)
static

Factory method for creating cache.

Parameters
storeDirPath to the image store.
Returns
Owned Cache pointer on success. Error on failure.
Option<std::string> mesos::internal::slave::appc::Cache::find ( const Image::Appc &  image) const

Finds image id of an image if it is present in the cache/store.

Parameters
appcAppc image data.
Returns
Image id of the image if its found in the cache. Error otherwise.
Try<Nothing> mesos::internal::slave::appc::Cache::recover ( )

Recovers/rebuilds the cache from its image store directory.


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