Manager
source: bluebase/pf/manager.py
- class PfManager(*, page_size: int = 4096, cache_capacity: int = 40, replacer: PfReplacer | None = None)[source]
Bases:
objectA manager for the
PFcomponent.The manager manages files and pages in the database. Note that the page cache covers multiple files.
- Variables:
page_size (int) – the size of a page
cache_capacity (int) – the capacity of the page cache
replacer (PfReplacer) – the replacement policy of the page cache
cache (PfPageCache) – the page cache object
fid_counter (dict[PfFileId, int]) – the container for managing file IDs
- Raises:
PfInvalidPageSizeError – if the page size is invalid
PfInvalidCacheCapacityError – if the cache capacity is invalid
- create_file(path: Path) None[source]
Create a new file.
- Raises:
PfManagedFileCreateError – if the file is already managed
- destroy_file(path: Path) None[source]
Destroy a file.
- Raises:
PfManagedFileDestroyError – if the file is still being managed
- close_file(file: PfFile) None[source]
Close a file.
- Raises:
PfUnmanagedFileCloseError – if the file is not managed