Base attribute driver class
Bases: object
Dependent on the driver, clean up and destroy any invalid or incomplete cached images
Configure the driver to use the stored configuration options Any store that needs special configuration should implement this method. If the store was not able to successfully configure itself, it should raise exception.BadDriverConfiguration
Removes all cached image files and any attributes about the images and returns the number of cached image files that were deleted.
Removes all queued image files and any attributes about the images and returns the number of queued image files that were deleted.
Removes a specific cached image file and any attributes about the image
Parameters: | image_id – Image ID |
---|
Removes a specific queued image file and any attributes about the image
Parameters: | image_id – Image ID |
---|
Returns a list of records about cached images.
The list of records shall be ordered by image ID and shall look like:
[
{
'image_id': <IMAGE_ID>,
'hits': INTEGER,
'last_modified': ISO_TIMESTAMP,
'last_accessed': ISO_TIMESTAMP,
'size': INTEGER
}, ...
]
This crafts an absolute path to a specific entry
Parameters: |
|
---|
Return the size of the image file for an image with supplied identifier.
Parameters: | image_id – Image ID |
---|
Return a tuple containing the image_id and size of the least recently accessed cached file, or None if no cached files.
Returns a list of image IDs that are in the queue. The list should be sorted by the time the image ID was inserted into the queue.
Returns True if the image with the supplied ID can have its image file cached, False otherwise.
Parameters: | image_id – Image ID |
---|
Returns True if the image with the supplied ID has its image file cached.
Parameters: | image_id – Image ID |
---|
Returns True if the image identifier is in our cache queue.
Parameters: | image_id – Image ID |
---|
Open and yield file for reading the image file for an image with supplied identifier.
Parameters: | image_id – Image ID |
---|
Open a file for writing the image file for an image with supplied identifier.
Parameters: | image_id – Image ID |
---|
Cache driver that uses SQLite to store information about cached images
Bases: glance.image_cache.drivers.base.Driver
Cache driver that uses xattr file tags and requires a filesystem that has atimes set.
Delete any image files in the invalid directory and any files in the incomplete directory that are older than a configurable amount of time.
Configure the driver to use the stored configuration options Any store that needs special configuration should implement this method. If the store was not able to successfully configure itself, it should raise exception.BadDriverConfiguration
Removes all cached image files and any attributes about the images
Removes all queued image files and any attributes about the images
Removes a specific cached image file and any attributes about the image
Parameters: | image_id – Image ID |
---|
Removes a specific queued image file and any attributes about the image
Parameters: | image_id – Image ID |
---|
Removes any incomplete cache entries older than a supplied modified time.
Parameters: | older_than – Files written to on or before this timestamp will be deleted. |
---|
Returns cache files in the supplied directory
Parameters: | basepath – Directory to look in for cache files |
---|
Returns a context manager that produces a database connection that self-closes and calls rollback if an error occurs while using the database connection
Return the number of hits that an image has.
Parameters: | image_id – Opaque image identifier |
---|
Return a tuple containing the image_id and size of the least recently accessed cached file, or None if no cached files.
Returns a list of image IDs that are in the queue. The list should be sorted by the time the image ID was inserted into the queue.
Returns True if the image with supplied id is currently in the process of having its image file cached.
Parameters: | image_id – Image ID |
---|
Returns True if the image with the supplied ID can have its image file cached, False otherwise.
Parameters: | image_id – Image ID |
---|
Returns True if the image with the supplied ID has its image file cached.
Parameters: | image_id – Image ID |
---|
Returns True if the image identifier is in our cache queue.
Parameters: | image_id – Image ID |
---|
Open and yield file for reading the image file for an image with supplied identifier.
Parameters: | image_id – Image ID |
---|