#include <FileCatalogOptionsHandler.h>
Definition at line 14 of file FileCatalogOptionsHandler.h.
art::FileCatalogOptionsHandler::FileCatalogOptionsHandler |
( |
bpo::options_description & |
desc | ) |
|
|
explicit |
Definition at line 174 of file FileCatalogOptionsHandler.cc.
177 bpo::options_description sam_options{
"SAM options"};
179 sam_options.add_options()
180 (
"sam-web-uri", bpo::value<string>(),
"URI for SAM web service.")
181 (
"sam-process-id", bpo::value<string>(),
"SAM process ID.")
182 (
"sam-application-family",
183 bpo::value<string>(&
appFamily_),
"SAM application family.")
185 bpo::value<string>(&
appFamily_),
"SAM application family.")
186 (
"sam-application-version",
187 bpo::value<string>(&
appVersion_),
"SAM application version.")
189 bpo::value<string>(&
appVersion_),
"SAM application version.")
190 (
"sam-group", bpo::value<string>(),
"SAM group.")
191 (
"sam-file-type", bpo::value<string>(),
"File type for SAM metadata.")
193 bpo::value<vector<string>>(),
194 "SAM data tier (<spec-label>:<tier-spec>).")
195 (
"sam-run-type", bpo::value<string>(),
"Global run-type for SAM metadata.")
197 bpo::value<vector<string>>(),
198 "SAM stream name (<module-label>:<stream-name>).")
199 (
"sam-inherit-metadata",
"Input file provides the file type and run type.")
200 (
"sam-inherit-file-type",
"Input file provides the file type.")
201 (
"sam-inherit-run-type",
"Input file provides the run type.");
203 desc.add(sam_options);
int art::FileCatalogOptionsHandler::doCheckOptions |
( |
bpo::variables_map const & |
vm | ) |
|
|
overrideprivatevirtual |
int art::FileCatalogOptionsHandler::doProcessOptions |
( |
bpo::variables_map const & |
vm, |
|
|
fhicl::intermediate_table & |
raw_config |
|
) |
| |
|
overrideprivatevirtual |
Implements art::OptionsHandler.
Definition at line 214 of file FileCatalogOptionsHandler.cc.
219 auto const& ciLocation =
fhicl_key(services,
"CatalogInterface");
220 auto const& ftLocation =
fhicl_key(services,
"FileTransfer");
221 auto const& fcmdLocation =
fhicl_key(services,
"FileCatalogMetadata");
227 if (vm.count(
"sam-web-uri") > 0) {
229 vm[
"sam-web-uri"].as<string>());
231 if (vm.count(
"sam-process-id") > 0) {
233 raw_config.
put(
"source.fileNames",
234 vector<string>{vm[
"sam-process-id"].as<
string>()});
237 vm[
"sam-process-id"].as<string>());
241 raw_config,
fhicl_key(fcmdLocation,
"processID"))) {
243 <<
"configurations " <<
fhicl_key(ciLocation,
"webURI")
244 <<
" (--sam-web-uri) and\n" 246 <<
" (--sam-process-id) must be specified\n" 247 <<
"together or not at all.\n";
249 bool const wantSAMweb{
256 if (vm.count(
"sam-group") > 0) {
258 vm[
"sam-group"].as<string>());
264 check_metadata_options(vm);
266 string const mdFromInput{
"metadataFromInput"};
267 bool specifyDataTier{
false};
271 if (vm.count(
"sam-inherit-metadata") > 0) {
273 vector<string>{
"fileType",
"runType"});
274 specifyDataTier =
true;
279 if (vm.count(
"sam-inherit-file-type") > 0) {
280 md.emplace_back(
"file_type");
281 specifyDataTier =
true;
284 if (vm.count(
"sam-inherit-run-type") > 0) {
287 md.emplace_back(
"art.run_type");
291 raw_config.
put(
fhicl_key(fcmdLocation, mdFromInput), md);
295 if (vm.count(
"sam-run-type") > 0) {
297 vm[
"sam-run-type"].as<string>());
299 if (vm.count(
"sam-file-type") > 0) {
301 vm[
"sam-file-type"].as<string>());
303 bool const requireMetadata =
304 have_outputs(raw_config) &&
307 fhicl_key(fcmdLocation,
"applicationFamily")) ||
309 fhicl_key(fcmdLocation,
"applicationVersion")) ||
314 if (requireMetadata) {
315 fill_tiers_streams(vm, raw_config);
316 maybeThrowOnMissingMetadata(raw_config);
321 process_name = raw_config.
get<
string>(
"process_name");
323 if (requireMetadata && process_name.empty()) {
325 <<
"Non-empty / default process_name required for SAM metadata.\n";
328 raw_config.
put(
fhicl_key(ciLocation,
"service_provider"),
329 "IFCatalogInterface");
330 raw_config.
put(
fhicl_key(ftLocation,
"service_provider"),
"IFFileTransfer");
bool exists_outside_prolog(fhicl::intermediate_table const &config, std::string const &key)
void ensureTable(fhicl::intermediate_table &table, std::string const &fhicl_spec)
std::enable_if_t< std::is_convertible_v< T, std::string >, std::string > fhicl_key(T const &name)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::string art::FileCatalogOptionsHandler::appFamily_ {} |
|
private |
std::string art::FileCatalogOptionsHandler::appVersion_ {} |
|
private |
The documentation for this class was generated from the following files: