cinder_data.cache module¶
-
class
cinder_data.cache.Cache¶ Bases:
objectCache interface.
-
get_record(name, record_id)¶ Should retrieve a record with a given type name and record id.
Parameters: - name (string) – The name which the record is stored under.
- record_id (int) – The id of the record requested.
Raises: NotImplementedErrorReturns: Should return the cached model.
Return type:
-
get_records(name)¶ Should get all the records in the cache under a given name.
Parameters: name (string) – The name which the records are stored under. Raises: NotImplementedErrorReturns: Should return a list of cinder_data.model.CinderModelmodels.Return type: list
-
set_record(name, record_id, record)¶ Should save the record to the cache.
Parameters: - name (string) – The name which to store the record under.
- record_id (int) – The id of the record.
- record (
cinder_data.model.CinderModel) – The model
Raises: NotImplementedError– Description
-
-
class
cinder_data.cache.MemoryCache¶ Bases:
cinder_data.cache.CacheA cache which uses in-process memmory.
Initialise the cache.
-
get_record(name, record_id)¶ Retrieve a record with a given type name and record id.
Parameters: - name (string) – The name which the record is stored under.
- record_id (int) – The id of the record requested.
Returns: The cached model.
Return type:
-
get_records(name)¶ Return all the records for the given name in the cache.
Parameters: name (string) – The name which the required models are stored under. Returns: A list of cinder_data.model.CinderModelmodels.Return type: list
-
set_record(name, record_id, record)¶ Save a record into the cache.
Parameters: - name (string) – The name to save the model under.
- record_id (int) – The record id.
- record (
cinder_data.model.CinderModel) – The model
-