CernVM-FS
2.12.0
|
#include <history.h>
Classes | |
struct | Branch |
struct | Tag |
Public Member Functions | |
virtual | ~History () |
virtual bool | IsWritable () const =0 |
virtual unsigned | GetNumberOfTags () const =0 |
virtual bool | BeginTransaction () const =0 |
virtual bool | CommitTransaction () const =0 |
virtual bool | SetPreviousRevision (const shash::Any &history_hash)=0 |
virtual shash::Any | previous_revision () const =0 |
virtual bool | Insert (const Tag &tag)=0 |
virtual bool | Remove (const std::string &name)=0 |
virtual bool | Exists (const std::string &name) const =0 |
virtual bool | GetByName (const std::string &name, Tag *tag) const =0 |
virtual bool | GetByDate (const time_t timestamp, Tag *tag) const =0 |
virtual bool | List (std::vector< Tag > *tags) const =0 |
virtual bool | GetBranchHead (const std::string &branch_name, Tag *tag) const =0 |
virtual bool | ExistsBranch (const std::string &branch_name) const =0 |
virtual bool | InsertBranch (const Branch &branch)=0 |
virtual bool | PruneBranches ()=0 |
virtual bool | ListBranches (std::vector< Branch > *branches) const =0 |
virtual bool | ListRecycleBin (std::vector< shash::Any > *hashes) const =0 |
virtual bool | EmptyRecycleBin ()=0 |
virtual bool | Rollback (const Tag &updated_target_tag)=0 |
virtual bool | ListTagsAffectedByRollback (const std::string &target_tag_name, std::vector< Tag > *tags) const =0 |
virtual bool | GetHashes (std::vector< shash::Any > *hashes) const =0 |
virtual void | TakeDatabaseFileOwnership ()=0 |
virtual void | DropDatabaseFileOwnership ()=0 |
virtual bool | OwnsDatabaseFile () const =0 |
virtual bool | Vacuum ()=0 |
const std::string & | fqrn () const |
Protected Member Functions | |
void | set_fqrn (const std::string &fqrn) |
Private Attributes | |
std::string | fqrn_ |
This is the abstract base class for repository history. It maintains a list of named snapshots in a Tag structure.
Each tag contains meta information (i.e. description, date) and points to one specific catalog revision (revision, root catalog hash). Furthermore tags are associated with one branch. This can be used in clients to selectively apply file system snapshots of a specific branch.
Note: The public interface of the History class is virtual, in order to over- write it in a testing environment. As we are dealing with an SQLite database anyway, the overhead of this should not matter. It could be implemented using CRTP if necessary, but would require com- plex code to do so.
|
pure virtual |
Opens a new database transaction in the underlying SQLite database This can greatly improve performance when used before inserting or removing multiple tags.
Implemented in history::SqliteHistory.
|
pure virtual |
Closes a transaction (see BeginTransaction())
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
inline |
Definition at line 193 of file history.h.
Referenced by swissknife::Assistant::GetHistory(), swissknife::CommandTag::GetHistory(), history::SqliteHistory::Open(), and set_fqrn().
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
Referenced by anonymous_namespace{repository_diff.cc}::GetTag().
|
pure virtual |
Provides a list of all referenced catalog hashes in this History. The hashes will be ordered by their timestamp in ascending order.
hashes | pointer to the result vector to be filled |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
Referenced by catalog::VirtualCatalog::GetSortedTagsFromHistory(), swissknife::CommandCheck::InspectHistory(), and swissknife::CommandPull::Main().
|
pure virtual |
Implemented in history::SqliteHistory.
Referenced by swissknife::CommandCheck::InspectHistory().
|
pure virtual |
The recycle bin operations are deprecated, only emptying and listing are preserved for migration and testing.
Implemented in history::SqliteHistory.
|
pure virtual |
Lists the tags that would be deleted by a rollback to the tag specified.
Note: This doesn't change the database but is mainly used for sanity checks and user output.
target_tag_name | the tag name for the planned rollback |
tags | pointer to the result tag list to be filled |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
When removing tags, branches can become abandoned. Remove abandoned branches and redirect the parent pointer of their child branches.
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
|
pure virtual |
Rolls back the history to the provided target tag and deletes all tags in between. Works on the default branch only.
Note: this assumes that the provided target tag was already updated with the republished root catalog information.
updated_target_tag | the tag to be rolled back to (updated: see Note) |
Implemented in history::SqliteHistory.
|
inlineprotected |
|
pure virtual |
Sets the internal pointer to the previous revision of this History file. Note: This must be handled by the user code.
history_hash | the content hash of the previous revision |
Implemented in history::SqliteHistory.
|
pure virtual |
Implemented in history::SqliteHistory.
Referenced by swissknife::Assistant::GetHistory().
|
pure virtual |
Implemented in history::SqliteHistory.
|
private |
Definition at line 199 of file history.h.
Referenced by fqrn(), and set_fqrn().