39 params.
stratum0 = *args.find(
'w')->second;
44 params.
repo_name = *args.find(
'N')->second;
46 if (args.find(
'T') != args.end()) {
47 params.
tar_file = *args.find(
'T')->second;
49 if (args.find(
'B') != args.end()) {
52 if (args.find(
'D') != args.end()) {
53 params.
to_delete = *args.find(
'D')->second;
56 if (args.find(
'O') != args.end()) {
59 if (args.find(
'j') != args.end()) {
63 if (args.find(
'e') != args.end()) {
66 PrintError(
"Swissknife Ingest: unknown hash algorithm");
70 if (args.find(
'Z') != args.end()) {
74 if (args.find(
'U') != args.end()) {
77 if (args.find(
'G') != args.end()) {
81 bool create_catalog = args.find(
'C') != args.end();
89 if (args.find(
'P') != args.end()) {
93 if (args.find(
'H') != args.end()) {
94 params.
key_file = *args.find(
'H')->second;
97 const bool upload_statsdb = (args.count(
'I') > 0);
120 params.
spooler = upload::Spooler::Construct(spooler_definition,
121 &publish_statistics);
122 if (NULL == params.
spooler)
return 3;
124 upload::Spooler::Construct(spooler_definition_catalogs,
125 &publish_statistics));
126 if (!spooler_catalogs.
IsValid())
return 3;
128 const bool follow_redirects = (args.count(
'L') > 0);
129 const string proxy = (args.count(
'@') > 0) ? *args.find(
'@')->second :
"";
161 const std::string old_root_hash = manifest->catalog_hash().ToString(
true);
169 catalog_manager.
Init();
180 "Swissknife Ingest: Initialization of the synchronisation "
189 "Swissknife Ingest: Adding contents of authz file %s to"
192 int fd = open(params.
authz_file.c_str(), O_RDONLY);
195 "Swissknife Ingest: Unable to open authz file (%s)"
196 "from the publication process: %s",
201 std::string new_authz;
205 if (!read_successful) {
207 "Swissknife Ingest: Failed to read authz file (%s): %s",
212 catalog_manager.SetVOMSAuthz(new_authz);
216 PrintError(
"Swissknife Ingest: something went wrong during sync");
218 if (upload_statsdb) {
225 "Published revision number");
226 revision_counter->
Set(catalog_manager.GetRootCatalog()->revision());
230 "Swissknife Ingest: Wait for all uploads to finish");
231 params.
spooler->WaitForUpload();
232 spooler_catalogs->WaitForUpload();
233 params.
spooler->FinalizeSession(
false);
236 "Swissknife Ingest: Exporting repository manifest");
242 const std::string new_root_hash = manifest->catalog_hash().ToString(
true);
244 if (!spooler_catalogs->FinalizeSession(
true, old_root_hash, new_root_hash,
246 PrintError(
"Swissknife Ingest: Failed to commit the transaction.");
248 if (upload_statsdb) {
255 if (upload_statsdb) {
262 PrintError(
"Swissknife Ingest: Failed to create new repository");
Counter * Register(const std::string &name, const std::string &desc)
Algorithms ParseCompressionAlgorithm(const std::string &algorithm_option)
size_t avg_file_chunk_size
const manifest::Manifest * manifest() const
DriverType driver_type
the type of the spooler driver
std::string GetGMTimestamp(const std::string &format)
bool UploadStatistics(upload::Spooler *spooler, std::string local_path="")
SpoolerDefinition Dup2DefaultCompression() const
bool generate_legacy_bulk_chunks
unsigned file_mbyte_limit
uint64_t max_concurrent_write_jobs
static const unsigned kDefaultFileMbyteLimit
virtual bool Initialize()
static const unsigned kDefaultNestedKcatalogLimit
static const unsigned kDefaultRootKcatalogLimit
size_t min_file_chunk_size
std::string spooler_definition
std::string manifest_path
zlib::Algorithms compression_alg
unsigned nested_kcatalog_limit
int Main(const ArgumentList &args)
unsigned int number_of_concurrent_uploads
int64_t String2Int64(const string &value)
std::string base_directory
void Set(const int64_t val)
const char kSuffixCatalog
upload::Spooler * spooler
static StatisticsDatabase * OpenStandardDB(const std::string repo_name)
bool SafeReadToString(int fd, std::string *final_result)
unsigned root_kcatalog_limit
size_t max_file_chunk_size
bool StorePublishStatistics(const perf::Statistics *statistics, const std::string &start_time, const bool success)
std::string session_token_file
bool ObtainDacReadSearchCapability()
virtual void Traverse()=0
std::map< char, SharedPtr< std::string > > ArgumentList
Algorithms ParseHashAlgorithm(const string &algorithm_option)
std::string TrimString(const std::string &path, const std::string &toTrim, const int trimMode)
Any MkFromHexPtr(const HexPtr hex, const char suffix)
std::string MakeCanonicalPath(const std::string &path)
void PrintError(const string &message)
const upload::Spooler * spooler_catalogs() const
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)