CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swissknife::CommandMigrate Class Reference

#include <swissknife_migrate.h>

Inheritance diagram for swissknife::CommandMigrate:
Collaboration diagram for swissknife::CommandMigrate:

Classes

class  AbstractMigrationWorker
 
class  BulkhashRemovalMigrationWorker
 
struct  CatalogStatistics
 
class  CatalogStatisticsList
 
class  ChownMigrationWorker
 
class  HardlinkRemovalMigrationWorker
 
class  MigrationWorker_20x
 
class  MigrationWorker_217
 
struct  PendingCatalog
 
class  PendingCatalogMap
 
class  StatsMigrationWorker
 

Public Types

typedef std::vector
< PendingCatalog * > 
PendingCatalogList
 

Public Member Functions

 CommandMigrate ()
 
 ~CommandMigrate ()
 
virtual std::string GetName () const
 
virtual std::string GetDescription () const
 
virtual ParameterList GetParams () const
 
int Main (const ArgumentList &args)
 
- Public Member Functions inherited from swissknife::Command
 Command ()
 
virtual ~Command ()
 
- Public Member Functions inherited from ServerTool
 ServerTool ()
 
virtual ~ServerTool ()
 
bool InitDownloadManager (const bool follow_redirects, const std::string &proxy="", const unsigned max_pool_handles=1)
 
bool InitVerifyingSignatureManager (const std::string &pubkey_path, const std::string &trusted_certs="")
 
bool InitSigningSignatureManager (const std::string &certificate_path, const std::string &private_key_path, const std::string &private_key_password)
 
manifest::ManifestOpenLocalManifest (const std::string path) const
 
manifest::Failures FetchRemoteManifestEnsemble (const std::string &repository_url, const std::string &repository_name, manifest::ManifestEnsemble *ensemble) const
 
manifest::ManifestFetchRemoteManifest (const std::string &repository_url, const std::string &repository_name, const shash::Any &base_hash=shash::Any()) const
 
template<class ObjectFetcherT >
manifest::ReflogFetchReflog (ObjectFetcherT *object_fetcher, const std::string &repo_name, const shash::Any &reflog_hash)
 
manifest::ReflogCreateEmptyReflog (const std::string &temp_directory, const std::string &repo_name)
 
download::DownloadManagerdownload_manager () const
 
signature::SignatureManagersignature_manager () const
 
perf::Statisticsstatistics ()
 
const perf::Statisticsstatistics () const
 

Static Public Member Functions

static void FixNestedCatalogTransitionPoint (const catalog::DirectoryEntry &nested_root, catalog::DirectoryEntry *mountpoint)
 
static const
catalog::DirectoryEntry
GetNestedCatalogMarkerDirent ()
 

Protected Member Functions

template<class ObjectFetcherT >
bool LoadCatalogs (const shash::Any &manual_root_hash, ObjectFetcherT *object_fetcher)
 
void CatalogCallback (const CatalogTraversalData< catalog::WritableCatalog > &data)
 
void MigrationCallback (PendingCatalog *const &data)
 
void UploadCallback (const upload::SpoolerResult &result)
 
void PrintStatusMessage (const PendingCatalog *catalog, const shash::Any &content_hash, const std::string &message)
 
template<class MigratorT >
bool DoMigrationAndCommit (const std::string &manifest_path, typename MigratorT::worker_context *context)
 
template<class MigratorT >
void ConvertCatalogsRecursively (PendingCatalog *catalog, MigratorT *migrator)
 
bool RaiseFileDescriptorLimit () const
 
bool ConfigureSQLite () const
 
void AnalyzeCatalogStatistics () const
 
bool ReadPersona (const std::string &uid, const std::string &gid)
 
bool ReadPersonaMaps (const std::string &uid_map_path, const std::string &gid_map_path, UidMap *uid_map, GidMap *gid_map) const
 
bool GenerateNestedCatalogMarkerChunk ()
 
void CreateNestedCatalogMarkerDirent (const shash::Any &content_hash)
 
void UploadHistoryClosure (const upload::SpoolerResult &result, Future< shash::Any > *hash)
 
bool UpdateUndoTags (PendingCatalog *root_catalog, unsigned revision, time_t timestamp, shash::Any *history_hash)
 

Private Attributes

unsigned int file_descriptor_limit_
 
CatalogStatisticsList catalog_statistics_list_
 
unsigned int catalog_count_
 
atomic_int32 catalogs_processed_
 
bool has_committed_new_revision_
 
uid_t uid_
 
gid_t gid_
 
std::string temporary_directory_
 
std::string nested_catalog_marker_tmp_path_
 
UniquePtr< manifest::Manifestmanifest_upstream_
 
UniquePtr< history::SqliteHistoryhistory_upstream_
 
catalog::Catalog const * root_catalog_
 
UniquePtr< upload::Spooler > spooler_
 
PendingCatalogMap pending_catalogs_
 
StopWatch catalog_loading_stopwatch_
 
StopWatch migration_stopwatch_
 

Static Private Attributes

static catalog::DirectoryEntry nested_catalog_marker_
 

Additional Inherited Members

- Static Public Attributes inherited from swissknife::Command
static const char kGenericParam = '+'
 
static const char kGenericParamSeparator = ','
 
- Protected Attributes inherited from ServerTool
UniquePtr
< download::DownloadManager
download_manager_
 
UniquePtr
< signature::SignatureManager
signature_manager_
 
perf::Statistics statistics_
 

Detailed Description

Definition at line 33 of file swissknife_migrate.h.

Member Typedef Documentation

Definition at line 65 of file swissknife_migrate.h.

Constructor & Destructor Documentation

swissknife::CommandMigrate::CommandMigrate ( )

Definition at line 28 of file swissknife_migrate.cc.

swissknife::CommandMigrate::~CommandMigrate ( )
inline

Definition at line 315 of file swissknife_migrate.h.

Member Function Documentation

void swissknife::CommandMigrate::AnalyzeCatalogStatistics ( ) const
protected

Definition at line 636 of file swissknife_migrate.cc.

Referenced by Main().

Here is the call graph for this function:

Here is the caller graph for this function:

void swissknife::CommandMigrate::CatalogCallback ( const CatalogTraversalData< catalog::WritableCatalog > &  data)
protected

Definition at line 468 of file swissknife_migrate.cc.

Referenced by LoadCatalogs().

Here is the call graph for this function:

Here is the caller graph for this function:

bool swissknife::CommandMigrate::ConfigureSQLite ( ) const
protected

Definition at line 630 of file swissknife_migrate.cc.

Referenced by Main().

Here is the caller graph for this function:

template<class MigratorT >
void swissknife::CommandMigrate::ConvertCatalogsRecursively ( PendingCatalog catalog,
MigratorT *  migrator 
)
protected

Definition at line 594 of file swissknife_migrate.cc.

Referenced by DoMigrationAndCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

void swissknife::CommandMigrate::CreateNestedCatalogMarkerDirent ( const shash::Any content_hash)
protected

Definition at line 1536 of file swissknife_migrate.cc.

Referenced by UploadCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class MigratorT >
bool swissknife::CommandMigrate::DoMigrationAndCommit ( const std::string &  manifest_path,
typename MigratorT::worker_context *  context 
)
protected

Definition at line 385 of file swissknife_migrate.cc.

Here is the call graph for this function:

void swissknife::CommandMigrate::FixNestedCatalogTransitionPoint ( const catalog::DirectoryEntry nested_root,
catalog::DirectoryEntry mountpoint 
)
static

Definition at line 1422 of file swissknife_migrate.cc.

Referenced by swissknife::CommandMigrate::MigrationWorker_20x::FixNestedCatalogTransitionPoints().

Here is the caller graph for this function:

bool swissknife::CommandMigrate::GenerateNestedCatalogMarkerChunk ( )
protected

Definition at line 1520 of file swissknife_migrate.cc.

Referenced by Main().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual std::string swissknife::CommandMigrate::GetDescription ( ) const
inlinevirtual

Implements swissknife::Command.

Definition at line 317 of file swissknife_migrate.h.

virtual std::string swissknife::CommandMigrate::GetName ( ) const
inlinevirtual

Implements swissknife::Command.

Definition at line 316 of file swissknife_migrate.h.

const catalog::DirectoryEntry & swissknife::CommandMigrate::GetNestedCatalogMarkerDirent ( )
static

Definition at line 1514 of file swissknife_migrate.cc.

Referenced by swissknife::CommandMigrate::MigrationWorker_20x::MigrateFileMetadata().

Here is the call graph for this function:

Here is the caller graph for this function:

ParameterList swissknife::CommandMigrate::GetParams ( ) const
virtual

Implements swissknife::Command.

Definition at line 40 of file swissknife_migrate.cc.

Here is the call graph for this function:

template<class ObjectFetcherT >
bool swissknife::CommandMigrate::LoadCatalogs ( const shash::Any manual_root_hash,
ObjectFetcherT *  object_fetcher 
)
inlineprotected

Definition at line 332 of file swissknife_migrate.h.

Referenced by Main().

Here is the call graph for this function:

Here is the caller graph for this function:

int swissknife::CommandMigrate::Main ( const ArgumentList args)
virtual

Implements swissknife::Command.

Definition at line 92 of file swissknife_migrate.cc.

Here is the call graph for this function:

void swissknife::CommandMigrate::MigrationCallback ( PendingCatalog *const &  data)
protected

Definition at line 499 of file swissknife_migrate.cc.

Referenced by DoMigrationAndCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

void swissknife::CommandMigrate::PrintStatusMessage ( const PendingCatalog catalog,
const shash::Any content_hash,
const std::string &  message 
)
protected

Definition at line 579 of file swissknife_migrate.cc.

Referenced by MigrationCallback(), and UploadCallback().

Here is the call graph for this function:

Here is the caller graph for this function:

bool swissknife::CommandMigrate::RaiseFileDescriptorLimit ( ) const
protected

Definition at line 613 of file swissknife_migrate.cc.

Referenced by Main().

Here is the caller graph for this function:

bool swissknife::CommandMigrate::ReadPersona ( const std::string &  uid,
const std::string &  gid 
)
protected

Definition at line 265 of file swissknife_migrate.cc.

Referenced by Main().

Here is the call graph for this function:

Here is the caller graph for this function:

bool swissknife::CommandMigrate::ReadPersonaMaps ( const std::string &  uid_map_path,
const std::string &  gid_map_path,
UidMap *  uid_map,
GidMap *  gid_map 
) const
protected

Definition at line 283 of file swissknife_migrate.cc.

Referenced by Main().

Here is the call graph for this function:

Here is the caller graph for this function:

bool swissknife::CommandMigrate::UpdateUndoTags ( PendingCatalog root_catalog,
unsigned  revision,
time_t  timestamp,
shash::Any history_hash 
)
protected

Definition at line 326 of file swissknife_migrate.cc.

Referenced by DoMigrationAndCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

void swissknife::CommandMigrate::UploadCallback ( const upload::SpoolerResult result)
protected

Definition at line 538 of file swissknife_migrate.cc.

Referenced by Main().

Here is the call graph for this function:

Here is the caller graph for this function:

void swissknife::CommandMigrate::UploadHistoryClosure ( const upload::SpoolerResult result,
Future< shash::Any > *  hash 
)
protected

Definition at line 311 of file swissknife_migrate.cc.

Referenced by UpdateUndoTags().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

unsigned int swissknife::CommandMigrate::catalog_count_
private

Definition at line 400 of file swissknife_migrate.h.

Referenced by CatalogCallback(), Main(), and PrintStatusMessage().

StopWatch swissknife::CommandMigrate::catalog_loading_stopwatch_
private

Definition at line 417 of file swissknife_migrate.h.

Referenced by AnalyzeCatalogStatistics(), and Main().

CatalogStatisticsList swissknife::CommandMigrate::catalog_statistics_list_
private

Definition at line 399 of file swissknife_migrate.h.

Referenced by AnalyzeCatalogStatistics(), and MigrationCallback().

atomic_int32 swissknife::CommandMigrate::catalogs_processed_
private

Definition at line 401 of file swissknife_migrate.h.

Referenced by CommandMigrate(), and PrintStatusMessage().

unsigned int swissknife::CommandMigrate::file_descriptor_limit_
private

Definition at line 398 of file swissknife_migrate.h.

Referenced by RaiseFileDescriptorLimit().

gid_t swissknife::CommandMigrate::gid_
private
bool swissknife::CommandMigrate::has_committed_new_revision_
private

Definition at line 402 of file swissknife_migrate.h.

Referenced by DoMigrationAndCommit(), and Main().

UniquePtr<history::SqliteHistory> swissknife::CommandMigrate::history_upstream_
private

Definition at line 412 of file swissknife_migrate.h.

Referenced by DoMigrationAndCommit(), LoadCatalogs(), and UpdateUndoTags().

UniquePtr<manifest::Manifest> swissknife::CommandMigrate::manifest_upstream_
private

Definition at line 411 of file swissknife_migrate.h.

Referenced by DoMigrationAndCommit(), LoadCatalogs(), and UpdateUndoTags().

StopWatch swissknife::CommandMigrate::migration_stopwatch_
private
catalog::DirectoryEntry swissknife::CommandMigrate::nested_catalog_marker_
staticprivate
std::string swissknife::CommandMigrate::nested_catalog_marker_tmp_path_
private

Definition at line 408 of file swissknife_migrate.h.

Referenced by GenerateNestedCatalogMarkerChunk(), and UploadCallback().

PendingCatalogMap swissknife::CommandMigrate::pending_catalogs_
private

Definition at line 415 of file swissknife_migrate.h.

Referenced by MigrationCallback(), and UploadCallback().

catalog::Catalog const* swissknife::CommandMigrate::root_catalog_
private

Definition at line 413 of file swissknife_migrate.h.

Referenced by CatalogCallback(), DoMigrationAndCommit(), and Main().

UniquePtr<upload::Spooler> swissknife::CommandMigrate::spooler_
private
std::string swissknife::CommandMigrate::temporary_directory_
private
uid_t swissknife::CommandMigrate::uid_
private

The documentation for this class was generated from the following files: