Mini Shell

Direktori : /lib/python3.6/site-packages/blivet/devices/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/blivet/devices/__pycache__/cache.cpython-36.pyc

3

{)c��@sjdZddlmZddlZeej�Gdd�de��Zeej�Gdd�de��Zeej�Gdd	�d	e��ZdS)
z�Module providing common helper classes, functions and other things related to
cached devices (like bcache, LVM cache and whatever appears in the future).

�)�
add_metaclassNc@sxeZdZdZeejdd���Zeejdd���Zeejdd���Z	eejdd	���Z
eejd
d���Zejdd
��ZdS)�CacheayAbstract base class for cache objects providing the cache-related
    functionality on cached devices. Instances of this class are not expected to
    be devices (both in what they represent as well as not instances of the
    :class:`~.devices.Device` class) since they just provide the cache-related
    functionality of cached devices and are not devices on their own.

    cCsdS)zSize of the cacheN�)�selfrr�/usr/lib/python3.6/cache.py�size*sz
Cache.sizecCsdS)z(Whether the cache (device) exists or notNr)rrrr�exists/szCache.existscCsdS)zEStatistics for the cache
        :rtype: :class:`CacheStats`
        Nr)rrrr�stats4szCache.statscCsdS)z;Name of the backing (big/slow) device of the cache (if any)Nr)rrrr�backing_device_name;szCache.backing_device_namecCsdS)z;Name of the cache (small/fast) device of the cache (if any)Nr)rrrr�cache_device_name@szCache.cache_device_namecCsdS)zzDetach the cache
        :returns: identifier of the detached cache that can be later used for attaching it back

        Nr)rrrr�detachEszCache.detachN)
�__name__�
__module__�__qualname__�__doc__�property�abc�abstractmethodrrr	r
rrrrrrrs	rc@sjeZdZdZeejdd���Zeejdd���Zeejdd���Z	eejdd	���Z
eejd
d���ZdS)
�
CacheStatsz�Abstract base class for common statistics of caches (cached
    devices). Inheriting classes are expected to add (cache-)type-specific
    attributes on top of the common set.

    cCsdS)zblock size of the cacheNr)rrrr�
block_sizeVszCacheStats.block_sizecCsdS)zsize of the cacheNr)rrrrr[szCacheStats.sizecCsdS)zhow much of the cache is usedNr)rrrr�used`szCacheStats.usedcCsdS)znumber of hitsNr)rrrr�hitseszCacheStats.hitscCsdS)znumber of missesNr)rrrr�missesjszCacheStats.missesN)r
rrrrrrrrrrrrrrrrMsrc@sFeZdZdZeejdd���Zeejdd���Zeejdd���Z	dS)	�CacheRequestz`Abstract base class for cache requests specifying cache parameters for a
    cached device

    cCsdS)zRequested sizeNr)rrrrrwszCacheRequest.sizecCsdS)z7Devices (type-specific) to allocate/create the cache onNr)rrrr�	fast_devs|szCacheRequest.fast_devscCsdS)zMode the cache should useNr)rrrr�mode�szCacheRequest.modeN)
r
rrrrrrrrrrrrrrpsr)	rZsixrr�ABCMeta�objectrrrrrrr�<module>s-"