CernVM-FS
2.12.0
|
#include <history_sqlite.h>
Public Member Functions | |
virtual | ~SqliteHistory () |
bool | IsWritable () const |
unsigned | GetNumberOfTags () const |
bool | BeginTransaction () const |
bool | CommitTransaction () const |
virtual bool | Vacuum () |
bool | SetPreviousRevision (const shash::Any &history_hash) |
shash::Any | previous_revision () const |
bool | Insert (const Tag &tag) |
bool | Remove (const std::string &name) |
bool | Exists (const std::string &name) const |
bool | GetByName (const std::string &name, Tag *tag) const |
bool | GetByDate (const time_t timestamp, Tag *tag) const |
bool | List (std::vector< Tag > *tags) const |
virtual bool | GetBranchHead (const std::string &branch_name, Tag *tag) const |
virtual bool | ExistsBranch (const std::string &branch_name) const |
virtual bool | InsertBranch (const Branch &branch) |
virtual bool | PruneBranches () |
virtual bool | ListBranches (std::vector< Branch > *branches) const |
bool | ListRecycleBin (std::vector< shash::Any > *hashes) const |
bool | EmptyRecycleBin () |
bool | Rollback (const Tag &updated_target_tag) |
bool | ListTagsAffectedByRollback (const std::string &target_tag_name, std::vector< Tag > *tags) const |
bool | GetHashes (std::vector< shash::Any > *hashes) const |
void | TakeDatabaseFileOwnership () |
void | DropDatabaseFileOwnership () |
bool | OwnsDatabaseFile () const |
std::string | filename () const |
Public Member Functions inherited from history::History | |
virtual | ~History () |
const std::string & | fqrn () const |
Static Public Member Functions | |
static SqliteHistory * | Open (const std::string &file_name) |
static SqliteHistory * | OpenWritable (const std::string &file_name) |
static SqliteHistory * | Create (const std::string &file_name, const std::string &fqrn) |
Protected Member Functions | |
bool | OpenDatabase (const std::string &file_name, const bool read_write) |
bool | CreateDatabase (const std::string &file_name, const std::string &fqrn) |
void | PrepareQueries () |
Protected Member Functions inherited from history::History | |
void | set_fqrn (const std::string &fqrn) |
Static Protected Member Functions | |
static SqliteHistory * | Open (const std::string &file_name, const bool read_write) |
Static Protected Attributes | |
static const std::string | kPreviousRevisionKey = "previous_revision" |
Private Member Functions | |
template<class SqlListingT > | |
bool | RunListing (std::vector< Tag > *list, SqlListingT *sql) const |
This class wraps the history of a repository, i.e. it contains a database of named snapshots or tags. Internally it uses the HistoryDatabase class to store those tags in an SQLite file.
Definition at line 25 of file history_sqlite.h.
|
inlinevirtual |
Definition at line 30 of file history_sqlite.h.
|
virtual |
Opens a new database transaction in the underlying SQLite database This can greatly improve performance when used before inserting or removing multiple tags.
Implements history::History.
Definition at line 128 of file history_sqlite.cc.
|
virtual |
Closes a transaction (see BeginTransaction())
Implements history::History.
Definition at line 133 of file history_sqlite.cc.
|
static |
Creates an empty History database. Since a History object is always associated to a specific repository, one needs to specify the fully qualified repository name (FQRN) on creation of the History database. Note: pointer ownership is assumed to be retained by the caller.
file_name | the path of the new history file. |
fqrn | the FQRN of the repository containing this History |
Definition at line 43 of file history_sqlite.cc.
Referenced by publish::CreateRootObjects(), publish::DownloadRootObjects(), swissknife::Assistant::GetHistory(), and swissknife::CommandTag::GetHistory().
|
protected |
Definition at line 84 of file history_sqlite.cc.
Referenced by Create().
|
virtual |
Implements history::History.
Definition at line 469 of file history_sqlite.cc.
Referenced by publish::PushHistory().
|
virtual |
Implements history::History.
Definition at line 366 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 195 of file history_sqlite.cc.
Referenced by publish::EditTags().
|
virtual |
Implements history::History.
Definition at line 269 of file history_sqlite.cc.
|
inline |
Definition at line 148 of file history_sqlite.h.
Referenced by publish::PushHistory().
|
virtual |
Implements history::History.
Definition at line 252 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 216 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 201 of file history_sqlite.cc.
|
virtual |
Provides a list of all referenced catalog hashes in this History. The hashes will be ordered by their associated revision number in ascending order.
hashes | pointer to the result vector to be filled |
Implements history::History.
Definition at line 451 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 158 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 170 of file history_sqlite.cc.
Referenced by publish::EditTags().
|
virtual |
Implements history::History.
Definition at line 281 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 153 of file history_sqlite.cc.
Referenced by Open().
|
virtual |
Implements history::History.
Definition at line 233 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 340 of file history_sqlite.cc.
|
virtual |
The recycle bin operations are deprecated, only emptying and listing are preserved for migration and testing.
Implements history::History.
Definition at line 349 of file history_sqlite.cc.
|
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 |
Implements history::History.
Definition at line 428 of file history_sqlite.cc.
|
static |
Opens an available history database file in read-only mode and returns a pointer to a History object wrapping this database. Note: The caller is assumed to retain ownership of the pointer and the history database is closed on deletion of the History object.
file_name | the path to the history SQLite file to be opened |
Definition at line 14 of file history_sqlite.cc.
Referenced by MountPoint::DetermineRootHash(), swissknife::Assistant::GetHistory(), swissknife::CommandTag::GetHistory(), swissknife::CommandPull::Main(), and swissknife::CommandCheck::Main().
|
staticprotected |
|
protected |
Definition at line 58 of file history_sqlite.cc.
Referenced by Open().
|
static |
Same as SqliteHistory::Open(), but opens the history database file in read/write mode. This allows to use the modifying methods of the History object.
file_name | the path to the history SQLite file to be opened |
Definition at line 20 of file history_sqlite.cc.
Referenced by publish::DownloadRootObjects(), swissknife::Assistant::GetHistory(), swissknife::CommandTag::GetHistory(), publish::PushHistory(), and swissknife::CommandMigrate::UpdateUndoTags().
|
inlinevirtual |
Implements history::History.
Definition at line 145 of file history_sqlite.h.
|
protected |
|
virtual |
Implements history::History.
Definition at line 145 of file history_sqlite.cc.
|
virtual |
When removing tags, branches can become abandoned. Remove abandoned branches and redirect the parent pointer of their child branches.
Implements history::History.
Definition at line 291 of file history_sqlite.cc.
|
virtual |
Implements history::History.
Definition at line 180 of file history_sqlite.cc.
Referenced by publish::EditTags().
|
virtual |
Rolls back the history to the provided target tag and deletes all tags of the containing channel in between.
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) |
Implements history::History.
Definition at line 375 of file history_sqlite.cc.
|
private |
|
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 |
Implements history::History.
Definition at line 138 of file history_sqlite.cc.
Referenced by publish::PushHistory().
|
virtual |
Implements history::History.
Definition at line 463 of file history_sqlite.cc.
Referenced by publish::DownloadRootObjects(), and publish::PushHistory().
|
inlinevirtual |
Implements history::History.
Definition at line 81 of file history_sqlite.h.
|
private |
Definition at line 168 of file history_sqlite.h.
|
private |
Definition at line 162 of file history_sqlite.h.
Referenced by filename(), OwnsDatabaseFile(), and Vacuum().
|
private |
Definition at line 175 of file history_sqlite.h.
|
private |
Definition at line 166 of file history_sqlite.h.
|
private |
Definition at line 167 of file history_sqlite.h.
|
private |
Definition at line 170 of file history_sqlite.h.
|
private |
Definition at line 174 of file history_sqlite.h.
|
private |
Definition at line 164 of file history_sqlite.h.
|
staticprotected |
Definition at line 27 of file history_sqlite.h.
|
private |
Definition at line 173 of file history_sqlite.h.
|
private |
Definition at line 172 of file history_sqlite.h.
|
private |
Definition at line 169 of file history_sqlite.h.
|
private |
Definition at line 177 of file history_sqlite.h.
|
private |
Definition at line 176 of file history_sqlite.h.
|
private |
Definition at line 165 of file history_sqlite.h.
|
private |
Definition at line 171 of file history_sqlite.h.