class SnapshotPersistence
Defined at line 19 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.h
Stores the contents of snapshots on disk. Does not perform any automatic garbage collection if
the snapshot storage limits have been reached.
Public Methods
void SnapshotPersistence (const std::optional<Root> & temp_root, const std::optional<Root> & persistent_root)
Defined at line 74 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
std::optional<ItemLocation> Add (const std::string & uuid, const ManagedSnapshot::Archive & archive, StorageSize archive_size, bool only_consider_tmp)
Adds a snapshot to persistence. If |only_consider_tmp| is true, only /tmp will be
considered as a possible storage location. Returns the location of the stored snapshot, if it
was stored.
Defined at line 99 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
bool Contains (const std::string & uuid)
Returns true if a snapshot for |uuid| exists on disk.
Defined at line 190 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
void MoveToTmp (const std::string & uuid)
Attempts to move the snapshot from /cache to /tmp. Will attempt to delete the snapshot from
/cache regardless of whether the addition to /tmp succeeds. Check-fails that the snapshot was
previously in /cache.
Defined at line 166 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
std::optional<ItemLocation> SnapshotLocation (const std::string & uuid)
Returns location for where |uuid| is currently stored in persistence, if anywhere.
Defined at line 199 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
std::optional<ManagedSnapshot::Archive> Get (const std::string & uuid)
Gets an archive from disk. Returns std::nullopt if the snapshot isn't in persistence or if the
read fails.
Defined at line 216 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
std::vector<std::string> GetSnapshotUuids ()
Defined at line 234 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
bool Delete (const std::string & uuid)
Deletes the snapshot for |uuid| from persistence. Returns true if successful.
Defined at line 248 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc
void DeleteAll ()
Deletes all snapshots from persistence.
Defined at line 263 of file ../../src/developer/forensics/crash_reports/snapshot_persistence.cc