argc,
const char* argv[]) :
59m_NetICacheClient(
eVoid),
60m_NetStorage(
eVoid),
61m_NetStorageByKey(
eVoid)
67 #define OPT_DEF(opt_type, opt_id) CCommandLineParser::opt_type, opt_id 69 #define OPT_DEF(opt_type, opt_id) CCommandLineParser::opt_type 94 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT 95{
OPT_DEF(eSwitch, eAllowXSiteConn),
96 "allow-xsite-conn",
"Allow cross-site connections.", {-1}},
100 "no-conn-retries",
"Do not attempt to reconnect to " 101 "services after the first connection failure.", {-1}},
108 "auth",
"Authentication string (\"client_name\").", {-1}},
111 INPUT_OPTION,
"Provide input data on the command line. " 112 "The standard input stream will not be read.", {-1}},
119 "specify its arguments.", {-1}},
122 "remote-app-stdin",
"Treat the job as a 'remote_app' job " 123 "and extract the standard input stream of the " 124 "remote application.", {-1}},
127 "remote-app-stdout",
"Treat the job as a 'remote_app' job " 128 "and extract the standard output stream of the " 129 "remote application.", {-1}},
132 "remote-app-stderr",
"Extract the standard error stream of the " 133 "remote application.", {-1}},
140 "One of the output formats supported by this command.", {-1}},
144 "or server address.", {-1}},
148 "cache name to use.", {-1}},
156 OFFSET_OPTION,
"Byte offset of the portion of data.", {-1}},
159 "size|" SIZE_OPTION,
"Length (in bytes) of the portion of data.", {-1}},
162 "ttl",
"Override the default time-to-live value (in seconds).", {-1}},
165 "enable-mirroring",
"Enable NetCache mirroring functionality.", {-1}},
169 "to find the blob.", {-1}},
172 "use-compound-id",
"Return key in CompoundID format.", {-1}},
176 "or server address.", {-1}},
188 "created with a user-defined key from objects created " 189 "by other users.", {-1}},
198 MOVABLE_OPTION,
"Allow the object to move between storages.", {-1}},
204 "no-meta-data",
"Do not use relational database for " 205 "ownership, change tracking, and object attributes.", {-1}},
209 "or server address.", {-1}},
216 "(a host:port pair).", {-1}},
219 BATCH_OPTION,
"Enable batch mode and specify batch size.", {-1}},
225 "affinity-list",
"Comma-separated list of affinity tokens.", {-1}},
228 "use-preferred-affinities",
"Accept a job with any of " 229 "the affinities registered earlier as preferred.", {-1}},
233 "affinity, without an affinity, or with an affinity " 234 "that is not preferred by any worker (in which case " 235 "it is added to the preferred affinities).", {-1}},
241 "exclusive-job",
"Create an exclusive job.", {-1}},
245 "(inhibits reading from the standard input stream or an " 246 "input file).", {-1}},
250 "to use as the job output.", {-1}},
253 "return-code",
"Job return code.", {-1}},
256 LIMIT_OPTION,
"Maximum number of records to return.", {-1}},
259 "AUTH_TOKEN",
"Security token that grants the " 260 "caller permission to manipulate the job.", {-1}},
267 "the argument to this option, mark the job identified by " 272 "reservation of the specified job.", {-1}},
276 "to mark the job as impossible to read.", {-1}},
279 "error-message",
"Provide an optional error message.", {-1}},
285 "job-group-info",
"Print information on job groups.", {
eQueue, -1}},
288 "client-info",
"Print information on the recently " 289 "connected clients.", {
eQueue, -1}},
292 "notification-info",
"Print a snapshot of the " 293 "currently subscribed notification listeners.", {
eQueue, -1}},
296 "affinity-info",
"Print information on the " 297 "currently handled affinities.", {
eQueue, -1}},
300 "active-job-count",
"Only print the total number of " 301 "Pending and Running jobs in all queues combined.", {-1}},
304 "jobs-by-status",
"Print the number of jobs itemized by their " 306 "is given, only the jobs with the specified affinity " 307 "will be counted.", {-1}},
310 "start-after-job",
"Specify the key of the last job " 311 "in the previous dump batch.", {-1}},
314 "job-count",
"Specify the maximum number of jobs in the output.", {-1}},
317 "job-status",
"Select jobs by job status.", {-1}},
320 "verbose",
"Produce more verbose output.", {-1}},
326 "status-only",
"Print job status only.", {-1}},
329 "progress-message-only",
"Print only the progress message.", {-1}},
332 "defer-expiration",
"Prolong job lifetime by " 333 "updating its last access timestamp.", {-1}},
337 "changes to the given value. The option can be given " 338 "more than once to wait for any one of multiple values. " 339 "Use the keyword 'Any' to wait for any status change.", {-1}},
343 "the index greater than ARG.", {-1}},
346 "extend-lifetime",
"Extend job lifetime by " 347 "the specified number of seconds.", {-1}},
350 "progress-message",
"Set job progress message.", {-1}},
356 "all-jobs",
"Apply to all jobs in the queue.", {-1}},
363 "and specify an error message.", {-1}},
381 "queue-description",
"Optional queue description.", {-1}},
390 "running jobs are completed.", {-1}},
393 NOW_OPTION,
"Take action immediately.", {-1}},
396 DIE_OPTION,
"Terminate the server process abruptly.", {-1}},
399 DRAIN_OPTION,
"Tell the server to wait until all of its " 400 "data is expired prior to shutting down.", {-1}},
403 "compat-mode",
"Enable backward compatibility tweaks.", {-1}},
412 "dump-cgi-env",
"For remote_cgi jobs, print the CGI environment " 413 "variables saved by cgi2rcgi as a part of job input.", {-1}},
416 "dump-cgi-stdin",
"For remote_cgi jobs, dump the standard " 417 "input saved by cgi2rcgi as a part of job input.", {-1}},
420 "aggregation-interval",
"NetCache: specify the statistics " 421 "aggregation interval to return ('1min', '5min', '1h', " 422 "'life', and so on). Default: 'life'.", {-1}},
425 "previous-interval",
"NetCache: return statistics for the " 426 "previous (complete) aggregation interval (instead of " 427 "returning the current but incomplete statistics).", {-1}},
430 "ft-site",
"FileTrack site to use: 'submit' (or 'prod'), " 431 "'dsubmit' (or 'dev'), 'qsubmit' (or 'qa'). " 432 "Default: 'submit'.", {-1}},
436 "FileTrack directly, either an API key or token is required.", {-1}},
439 "mirror",
"NetCache: reconfigure mirroring.", {-1}},
444 "no-dns-lookup",
"Disable reverse DNS lookup " 445 "for the server IP addresses.", {-1}},
453 "even if provided locator has a NetStorage service. Cannot be " 457 "no-server-check",
"Disable server check.", {-1}},
460 "report-progress",
"Report progress.", {-1}},
467 "client-node",
"Client application identifier.", {-1}},
475 "multiline",
"Expect multiple lines of output.", {-1}},
479 "the automation protocol to the specified file.", {-1}},
482 "debug-console",
"Start an automation debugging session " 486 "dump-ns-notifications",
"Suppress normal processing " 487 "of this command, but print notifications received " 488 "from the NetSchedule servers over UDP within " 489 "the specified timeout.", {-1}},
518 #define ICACHE_KEY_FORMAT_EXPLANATION_BASE \ 519 "\n\nBoth NetCache and ICache modes are supported. "\
520"ICache mode requires blob ID to be specified in one of the " \
521"following formats:\n" \
522" * \"key,version,subkey\"\n"
524 #define ICACHE_KEY_FORMAT_EXPLANATION \ 525 ICACHE_KEY_FORMAT_EXPLANATION_BASE \ 526 " * \"key\" \"version\" \"subkey\"" 528 #define ICACHE_KEY_FORMAT_EXPLANATION_OPT_VERSION \ 529 ICACHE_KEY_FORMAT_EXPLANATION_BASE \ 530 " * \"key\" [\"version\"] \"subkey\"\n"\
531" (version could be omitted only if " PASSWORD_OPTION ", " \
532OFFSET_OPTION " and " SIZE_OPTION " options are not used)."
534 #define MAY_REQUIRE_LOCATION_HINTING \ 535 "Some object locators may require additional options "\
536"to hint at the actual object location."
538 #define ABOUT_NETSTORAGE_OPTION \ 539 "\n\nIf a NetStorage service (or server) is specified "\
540"via the '--" NETSTORAGE_OPTION "' option or provided object locator " \
541"contains a NetStorage service, that service " \
542"or server will be used as a gateway to the actual storage " \
543"back-end (e.g. NetCache). If the option is not specified " \
544"and either the locator does not contain a NetStorage service " \
545"or '--" DIRECT_MODE_OPTION "' option specified, " \
546"a direct connection to the storage back-end is established."
548 #define WN_NOT_NOTIFIED_DISCLAIMER \ 549 "Worker nodes that may have already "\
550"started job processing will not be notified."
552 #define ABOUT_SWITCH_ARG \ 553 "The "SWITCH_ARG " argument can be either 'on' or 'off'."
555 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT 556 #define ALLOW_XSITE_CONN_IF_SUPPORTED eAllowXSiteConn, 558 #define ALLOW_XSITE_CONN_IF_SUPPORTED 561 #define NETSTORAGE_COMMON_OPTIONS \ 562 eNetStorage, eObjectKey, eUserKey, eNamespace, \ 563 eFastStorage, ePersistent, eMovable, eCacheable, eNoMetaData, \ 566 #define NETSTORAGE_DIRECT_OPTIONS \ 567 eDirectMode, eNetCache, eFileTrackSite 580 "whatis",
"Determine argument type and characteristics.",
581 "This command makes an attempt to guess the type of its " 582 "argument. If the argument is successfully recognized " 583 "as a token that represents a Grid object, the type-" 584 "dependent information about the object is printed.\n\n" 593 "This command wraps the specified client identification " 594 "parameters in a session token. The returned token can " 595 "be passed later to other commands either through " 598 "which makes it possible to set client identification " 599 "parameters all at once.\n",
606 "blobinfo|bi",
"Retrieve metadata of a NetCache blob.",
607 "Print vital information about the specified blob. " 608 "Expired blobs will be reported as not found." 615 "getblob|gb",
"Retrieve a blob from NetCache.",
616 "Read the blob identified by ID and send its contents " 617 "to the standard output (or to the specified output " 618 "file). Expired blobs will be reported as not found." 625 "putblob|pb",
"Create or rewrite a NetCache blob.",
626 "Read data from the standard input (or a file) until EOF is " 627 "encountered and save the received data as a NetCache blob." 635 "rmblob|rb",
"Remove a NetCache blob.",
636 "Delete a blob if it exists. If the blob has expired " 637 "(or never existed), no errors are reported." 644 "purge",
"Delete all blobs from an ICache database.",
645 "This command purges the specified ICache database. " 646 "Administrative privileges are required.",
651 "upload",
"Create or rewrite a NetStorage object.",
652 "Save the data coming from the standard input (or an input file) " 653 "to a network storage. The choice of the storage is based on the " 654 "specified options and/or NetStorage server settings " 655 "(if NetStorage service is used). After the data has been written, " 656 "if new object is created and no locator/user key is provided, " 657 "the generated object locator is printed to the standard output." 665 "download",
"Retrieve a NetStorage object.",
666 "Read the object pointed to by the specified locator or user key and " 667 "send its contents to the standard output or a file." 675 "relocate",
"Move a NetStorage object to a different storage.",
676 "Transfer object contents to the new location hinted by " 677 "a combination of the specified options and/or " 678 "NetStorage server settings (if NetStorage service is used). " 679 "After the data has been transferred, a new object locator " 680 "will be generated and printed to the standard output, " 681 "unless user key is provided to specify the original object." 690 "objectinfo",
"Print information about a NetStorage object.",
699 "rmobject",
"Remove a NetStorage object.",
707 "createloc",
"Create a NetStorage object locator.",
708 "Create a NetStorage object locator for an ICache blob. " 709 "Blob ID must be specified in one of the following formats:\n"\
710 " * \"key,version,subkey\"\n" 711 " * \"key\" [\"version\"] \"subkey\"\n"\
712 " (version could be omitted).",
716 "getattrlist",
"Get list of all attributes set on a NetStorage object.",
723 "getattr",
"Get a NetStorage object attribute value.",
730 "setattr",
"Set a NetStorage object attribute value.",
738 "Print vital information about the specified NetSchedule job. " 739 "Expired jobs will be reported as not found." 740 "\n\nThe following output formats are supported: \"" 751 "submitjob",
"Submit one or more jobs to a NetSchedule queue.",
752 "Create one or multiple jobs by submitting input data to " 753 "a NetSchedule queue. The first submitted job will be " 754 "executed immediately as long as there is a worker node " 755 "waiting for a job on that queue.\n\n" 756 "This command has three modes of operation:\n\n" 757 " - single job submission;\n" 758 " - batch submission;\n" 759 " - preparation of input for \"offline\" job execution.\n\n" 761 "' or '--" INPUT_OPTION "' options are given, job input is read " 762 "from the standard input stream, and the rest of attributes are " 763 "taken from their respective command line options. The '--" 765 "by the 'remote_app' worker node, in which case either '--" 767 "define the standard input stream of the remote_app job.\n\n" 769 "job submission mode, " GRID_APP_NAME " will wait for the job " 770 "to terminate, and if the job terminates within the specified " 771 "number of seconds or when this timeout has passed while the " 772 "job is still Pending or Running, job status will be printed right " 773 "after the job ID. And if this status is 'Done', job output will be " 775 "option is given, in which case the output goes to the specified " 777 "A NetCache server is required for saving job input if it " 778 "exceeds the capability of the NetSchedule internal storage.\n\n" 779 "Batch submission mode is activated by the '--" 780 BATCH_OPTION "' option, which takes the maximum batch size " 781 "as its argument. When this mode is enabled, all options that " 782 "define job attributes are ignored. Instead, job attributes " 783 "are read from the standard input stream or the specified " 784 "input file - one line per job. Each line must contain a " 785 "space-separated list of job attributes as follows:\n\n" 786 " input=\"DATA\" OR args=\"REMOTE_APP_ARGS\"\n" 787 " affinity=\"TOKEN\"\n" 789 "Special characters in all quoted strings must be properly " 790 "escaped. It is OK to omit quotation marks for a string that " 791 "doesn't contain spaces. The \"input\" attribute is required " 792 "unless the \"args\" attribute is specified. The latter enables " 793 "remote_app mode and defines command line arguments for a " 794 "remote_app job, in which case the \"input\" attribute becomes " 795 "optional and defines the standard input stream for the " 796 "remote_app job.\n\n" 798 " input=\"db, 8548@394.701\" exclusive\n" 799 " args=\"checkout p1/d2\" affinity=\"bin1\"\n\n" 800 "In batch mode, the IDs of the created jobs are printed to the " 801 "standard output stream (or the specified output file) one job " 803 "The third mode of operation bypasses NetSchedule and NetCache, " 804 "and saves the input data for direct consumption by the worker node " 805 "(primarily for testing or debugging). This mode is enabled by the " 807 "directory where input data will be saved.",
816 "Listen to the job status change notifications and return " 817 "when one of the following conditions has been met:\n\n" 819 "' option has passed. This option is required.\n\n" 820 "* The job has come to a status indicated by one or " 822 "* A new job history event with the index greater than the " 824 "' option has occurred.\n\n" 828 "progresses to a status other than 'Pending' or 'Running'.\n\n" 829 "The output of this command is independent of the reason it " 830 "exits: the latest job event index is printed to the standard " 831 "output on the first line and the current job status is printed " 832 "on the second line.",
839 "getjobinput",
"Read job input.",
840 "Retrieve and print job input to the standard output stream or " 841 "save it to a file.",
848 "getjoboutput",
"Read job output if the job is completed.",
849 "Retrieve and print job output to the standard output stream or " 850 "save it to a file. If the job does not exist or has not been " 851 "completed successfully, an appropriate error message is printed " 852 "to the standard error stream and the program exits with a non-zero " 860 "Incrementally harvest IDs of successfully completed, failed, " 861 "and canceled jobs. This command has two modes of operation: " 862 "simple mode (without acknowledgment) and reliable mode (with " 863 "acknowledgment). The former is the default; the latter is " 865 "In simple mode, if any of the specified NetSchedule servers " 866 "has a job that's done, failed, or canceled, the ID of that job will " 867 "be printed on the first line, and its status - 'Done', 'Failed', " 868 "or 'Canceled' - on the second line. Also, if the job is 'Done', " 869 "its entire output will be printed as well, starting from the third " 871 "which case the output goes to the specified file).\n\n" 872 "After the job output has been successfully printed, the status " 873 "of the job is immediately changed to 'Confirmed', which means " 874 "that the job won't be available for reading anymore.\n\n" 875 "In reliable mode, job reading is a two-step process. The first " 877 "option, acquires a reading reservation. If there's a job that's " 878 "done, failed, or canceled, its ID is printed on the first line along " 879 "with its final status ('Done', 'Failed', or 'Canceled') on the next " 880 "line and a unique reservation token on the third line. This first " 881 "step changes the status of the returned job from 'Done' to " 882 "'Reading'. The reading reservation is valid for a short period " 883 "of time configurable on the server. " 884 "If the server does not receive a reading confirmation (see " 885 "below) within this time frame, the job will change its status " 886 "back to the original status ('Done', 'Failed', or 'Canceled').\n\n" 887 "The second step is activated by one of the following " 890 "these options requires the reservation token that was issued " 891 "by NetSchedule during the first step to be passed as the " 892 "argument for the option. The corresponding job ID must be " 893 "provided with the '--" JOB_ID_OPTION "' option. The job must " 894 "still be in the 'Reading' status. After the finalization " 895 "step, the status of the job will change depending on the " 896 "option given as per the following table:\n\n" 897 " Option Resulting status\n" 898 " ================ ================\n" 902 "The 'Confirmed' status and the 'ReadFailed' status are final and " 906 "wait the specified number of seconds until a job becomes available " 907 "for reading. Without this option, if there are no completed, " 908 "failed, or canceled jobs in the queue, nothing will be printed " 909 "and the exit code will be zero.",
918 "canceljob",
"Cancel one or more NetSchedule jobs.",
919 "Mark the specified job (or multiple jobs) as canceled. " 920 "This command also instructs the worker node that may be " 921 "processing those jobs to stop the processing.",
927 "requestjob",
"Get a job from NetSchedule for processing.",
928 "Return a job pending for execution. The status of the job is changed " 929 "from \"Pending\" to \"Running\" before the job is returned. " 930 "This command makes it possible for " GRID_APP_NAME " to emulate a " 932 "The affinity-related options affect how the job is selected. " 934 "is returned only if its affinity matches one of the specified " 936 "Job retrieval can also be restricted to the group name specified " 938 "If a job is acquired, its ID and attributes are printed to the " 939 "standard output stream on the first and the second lines " 940 "respectively, followed by the input data of the job unless the '--" 942 "input data will be saved to that file.\n\n" 943 "The format of the line with job attributes is as follows:\n\n" 944 "auth_token [affinity=\"job_affinity\"] [exclusive]\n\n" 945 "If none of the NetSchedule servers has pending jobs in the " 946 "specified queue, nothing is printed and the exit code of zero " 955 "commitjob",
"Mark the job as complete or failed.",
956 "Change the state of the job to either 'Done' or 'Failed'. This " 957 "command can only be executed on jobs that are in the 'Running' " 961 "given, the job output is read from the standard input stream.\n\n" 962 "If the job is being reported as failed, an error message " 972 "returnjob",
"Return a previously accepted job.",
973 "Due to insufficient resources or for any other reason, " 974 "this command can be used by a worker node to return a " 975 "previously accepted job back to the NetSchedule queue. " 976 "The job will change its state from Running back to " 977 "Pending, but the information about previous runs will " 978 "not be discarded, and the expiration time will not be " 985 "clearnode",
"Fail incomplete jobs and clear client record.",
987 "client identification. This command removes the corresponding " 988 "client registry record from all NetSchedule servers. If there " 989 "are running jobs assigned to the client, their status will be " 990 "changed back to Pending (or Failed if no retries left).",
996 "updatejob",
"Modify attributes of an existing job.",
997 "Change one or more job properties. The outcome depends " 998 "on the current state of the job.",
1008 "prints the following information on the specified queue: " 1009 "the queue configuration parameters, queue type (static or " 1010 "dynamic), and, if the queue is dynamic, its description and " 1011 "the queue class name. For newer NetSchedule versions, additional " 1012 "queue parameters may be printed.\n\n" 1014 "command prints information about every queue on each server " 1017 "to get the information on queue classes instead of queues.\n\n" 1026 "dumpqueue",
"Dump a NetSchedule queue.",
1027 "This command dumps detailed information about jobs in a " 1028 "NetSchedule queue. It is possible to limit the number of " 1029 "records printed and also to filter the output by job status " 1030 "and/or job group.",
1036 "createqueue",
"Create a dynamic NetSchedule queue.",
1037 "This command creates a new NetSchedule queue using " 1038 "a template known as queue class.",
1044 "getqueuelist",
"Print the list of available NetSchedule queues.",
1045 "This command takes a NetSchedule service name (or server " 1046 "address) and queries each server participating that service " 1047 "for the list of configured or dynamically created queues. " 1048 "The collected lists are then combined in a single list of " 1049 "queues available on all servers in the service. For each " 1050 "queue available only on a subset of servers, its servers " 1051 "are listed in parentheses after the queue name.",
1056 "deletequeue",
"Delete a dynamic NetSchedule queue.",
1058 "Static queues cannot be deleted, although it is " 1059 "possible to cancel all jobs in a static queue.",
1065 "replay",
"Rerun a job in debugging environment.",
1066 "This command facilitates debugging of remote_cgi and remote_app " 1067 "jobs as well as \"native\" worker nodes. By using this command, " 1068 "job input can be preserved for later re-run in debugging or " 1069 "testing environment. Job output can also be preserved to compare " 1070 "it with \"reference\" runs.",
1077 "serverinfo|si",
"Print information about a Grid server.",
1078 "Query and print information about a running " 1079 "NetCache, NetSchedule, NetStorage, or worker node process." 1080 "\n\nThe following output formats are supported: \"" 1091 "stats|stat|status",
"Show server status and access statistics.",
1092 "Dump accumulated statistics on server access and " 1094 "When applied to a NetSchedule server, this operation " 1108 "health",
"Evaluate availability of a server.",
1109 "Retrieve vital parameters of a running NetCache " 1110 "or NetSchedule server and estimate its availability " 1119 "sanitycheck",
"Run basic functionality tests on a service.",
1120 "Verify that the specified service is capable of performing " 1121 "its primary tasks. For NetCache servers, it means writing and " 1122 "reading blobs; for NetSchedule servers - submitting, returning, " 1123 "failing, and completing jobs.\n\n" 1124 "A queue name and/or a queue class name is required for NetSchedule " 1125 "testing. If a queue class is specified, it will be used to create a " 1126 "temporary queue (with the given name, if the '--" QUEUE_OPTION 1127 "' option is also specified). The default value for '--" QUEUE_OPTION 1134 "getconf",
"Dump actual configuration of a server.",
1135 "Print the effective configuration parameters of a " 1136 "running NetCache, NetSchedule, or NetStorage server.",
1142 "reconf",
"Reload server configuration.",
1143 "Update configuration parameters of a running server. " 1144 "The server will look for a configuration file in the " 1145 "same location that was used during start-up.",
1150 "drain",
"Turn server drain mode on or off.",
1151 "When in drain mode, NetSchedule does not accept new jobs. " 1152 "As existing jobs expire naturally, the server is drained. " 1153 "Drain mode can be enabled for a particular queue or for " 1154 "the whole server.\n\n" 1162 "Depending on whether the command is applied to a worker node " 1163 "or a NetSchedule service, the worker node or the entire " 1164 "NetSchedule queue will be paused.\n\n" 1166 "(if the option is applied to a single worker node) or all " 1167 "worker nodes connected to the given queue (if the option is " 1168 "applied to a NetSchedule service) to stop processing and return " 1169 "all running jobs.\n\n" 1170 "For worker nodes, two additional options can be specified:\n\n" 1172 "worker node must wait for the running jobs to complete.\n\n" 1174 "that when '" GRID_APP_NAME "' returns, no jobs are running.",
1181 "resume",
"Continue job processing.",
1189 "shutdown",
"Send a shutdown request to a remote server.",
1190 "Depending on the option specified, this command sends " 1191 "a shutdown request to a NetCache, NetSchedule or NetStorage " 1192 "server or a worker node process.\n\n" 1194 "' are applicable only to worker nodes and NetStorage servers.\n\n" 1195 "The '--" DRAIN_OPTION "' option is supported by NetSchedule " 1196 "servers version 4.11.0 and up and by NetCache servers version " 1203 "discover|lbsm",
"Perform service name resolution using LBSM.",
1204 "Query LBSM for the specified service name and print IPv4 socket " 1205 "addresses and rates of the servers in that service.",
1209 "exec",
"Execute an arbitrary command on one or more servers.",
1210 "This command is intended for testing and debugging purposes." 1211 "\n\nThe following output formats are supported: \"" 1220 "automate",
"Run as a pipe-based automation server.",
1222 "server that can be used to interact with Grid objects " 1223 "through a Python module (ncbi.grid).",
1227 #define TOTAL_NUMBER_OF_COMMANDS int(sizeof(s_CommandDefinitions) / \ 1228 sizeof(*s_CommandDefinitions)) 1282 if(!
strcmp(arg,
"--latency")) {
1285}
else if(!
strcmp(arg,
"--first-latency")) {
1288}
else if(!
strcmp(arg,
"--last-latency")) {
1291}
else if(!
strcmp(arg,
"--all-latency")) {
1303 const stringnetservice_api_section(
"netservice_api");
1304 const stringmax_find_lbname_retries(
"max_find_lbname_retries");
1305 if(!reg.
HasEntry(netservice_api_section, max_find_lbname_retries))
1306reg.
Set(netservice_api_section, max_find_lbname_retries,
"0");
1308 if(!reg.
HasEntry(netservice_api_section,
"warn_on_unexpected_reply")) {
1309reg.
Set(netservice_api_section,
"warn_on_unexpected_reply",
"true");
1313 const int* cmd_opt;
1320 "/connect/ (302.109)",
1321R
"(SOCK#\d+\[\d+\]@([0-9.:]+): Written at offset \d+[\s\S]+ ncbi_phid=[\s\S]+)", 1322 R"(SOCK#\d+\[\d+\]@([0-9.:]+): Read at offset \d+[\s\S]+)" 1326 boolenable_extended_cli =
false;
1327 bool debug=
false;
1330 const char** argv =
m_ArgV+ 1;
1332 while(--argc >= 0) {
1333 if(
strcmp(*argv,
"--extended-cli") == 0)
1334enable_extended_cli =
true;
1335 else if(
strcmp(*argv,
"--admin") == 0)
1337 else if(
strcmp(*argv,
"--debug") == 0)
1340latency_report.Start(latency);
1347 memmove(argv, argv + 1, argc *
sizeof(*argv));
1350 if(enable_extended_cli && (
debug|| latency_report)) {
1363reg.
Set(netservice_api_section,
"connection_data_logging",
"true");
1364latency_report.SetDebug(
debug);
1368 "Utility to access and control NCBI Grid services.");
1375 "EOption order must match positions in s_OptionDefinitions.");
1381 else if(!enable_extended_cli)
1395 if(!enable_extended_cli &&
1402 for(cmd_opt = cmd_def->
options; *cmd_opt >= 0; ++cmd_opt)
1417 catch(exception& e) {
1422 for(cmd_opt = cmd_def->
options; *cmd_opt >= 0; ++cmd_opt)
1428 const char* opt_value;
1461 " %s: invalid output format '%s'.\n",
1538 " %s: batch size must be greater that zero.\n",
1624 if(
strcmp(opt_value,
"-")) {
1625 input_file.open(opt_value, ifstream::binary);
1627fprintf(stderr,
"%s: %s\n", opt_value,
strerror(errno));
1661 ": too many positional parameters.\n");
1667fprintf(stderr,
"%s: %s\n", opt_value,
strerror(errno));
1671 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT 1672 caseeAllowXSiteConn:
1685 for(
const int* required_opt =
1687*required_opt != -1; ++required_opt)
1690 ": option '--%s' requires option '--%s'.\n",
1693*required_opt].name_variants);
1696 while(--opt_id >= 0);
1699 const stringconnection_max_retries(
"connection_max_retries");
1700 if(!reg.
HasEntry(netservice_api_section, connection_max_retries))
1701reg.
Set(netservice_api_section, connection_max_retries,
"0");
1711 "' and '--" INPUT_OPTION "' are mutually exclusive.\n");
1717_setmode(_fileno(stdout), O_BINARY);
1725 intretcode = (this->*cmd_def->
cmd_proc)();
1730fprintf(stderr,
"%s\n", e.
GetMsg().c_str());
1743 catch(
string& s) {
1744fprintf(stderr,
"%s\n", s.c_str());
1752 stringwarning(warn_msg);
1754 const char* server_type = not_worker_node_admin ?
1755 "NetSchedule server":
"Worker node";
1761fprintf(stderr,
"%s at %s: WARNING [%s]: %s\n",
1767fprintf(stderr,
"%s at %s: WARNING: %s\n",
1781 const char* status_str)
1790 "invalid job status '"<< status_str <<
'\'');
1808 while(label_field) {
1811fprintf(stderr,
GRID_APP_NAME ": invalid login token format.\n");
1825host = value_field.
GetHost();
1842pid = value_field.
GetID();
1847 #ifdef NCBI_GRID_XSITE_CONN_SUPPORT 1870(user.empty() ?
kEmptyStr: user +
'@') +
1888_setmode(_fileno(stdin), O_BINARY);
1892 int main(
intargc,
const char* argv[])
1895 returnapp.
AppMain(argc, argv);
int Parse(int argc, const char *const *argv)
Parse the command line.
bool NextOption(int *opt_id, const char **opt_value)
void AddOption(EOptionType type, int opt_id, const string &name_variants, const string &description)
void AddCommandCategory(int cat_id, const string &title)
void AddCommand(int cmd_id, const string &name_variants, const string &synopsis, const string &usage, int cat_id=-1)
void AddAssociation(int cmd_id, int opt_id)
Compound ID field â an element of the compound ID that has a type and a value.
string GetString() const
Return the string value that this field contains.
CCompoundIDField GetNextHomogeneous()
Return the next field of the same type.
CCompoundIDField GetNextNeighbor()
Return the next immediately adjacent field.
string GetServiceName() const
Return the LBSM service name that this field contains.
bool GetBoolean() const
Return the Boolean value that this field contains.
string GetHost() const
Return the host name or address that this field contains.
Int8 GetTimestamp() const
Return the UNIX timestamp that this field contains.
string GetDatabaseName() const
Return the database name that this field contains.
string GetLabel() const
Return the application-specific tag that this field contains.
Uint8 GetID() const
Return the ID value that this field contains.
CCompoundID FromString(const string &cid)
Unpack the base64-encoded ID and return a CCompoundID object for field extraction.
Base64-encoded ID string that contains extractable typed fields.
CCompoundIDField GetFirst(ECompoundIDFieldType field_type)
Return the first field of the specified type or NULL if this compound ID contains no fields of such t...
static bool OnWarning(bool worker_node_admin, const string &warn_msg, CNetServer server)
CCompoundIDPool m_CompoundIDPool
bool IsOptionSet(int option) const
struct CGridCommandLineInterfaceApp::SOptions m_Opts
void MarkOptionAsExplicitlySet(int option)
void MarkOptionAsAccepted(int option)
bool ParseLoginToken(const string &token)
void MarkOptionAsSet(int option)
CGridCommandLineInterfaceApp(int argc, const char *argv[])
static void PrintLine(const string &line)
bool IsOptionAcceptedButNotSet(EOption option) const
int Cmd_NetStorageObjectInfo()
virtual int Run()
Run the application.
CNetScheduleAPI::EJobStatus StringToJobStatus(const char *status_str)
int Cmd_RemoveNetStorageObject()
string GetServerAddress() const
static void AllowXSiteConnections()
string m_TemporaryFileName
FILE * CreateTemporaryFile(const char *output_file_name)
#define GRID_APP_VERSION_INFO
static char s_ConnDebugEnv[]
struct SCommandDefinition s_CommandDefinitions[]
#define ABOUT_NETSTORAGE_OPTION
#define WN_NOT_NOTIFIED_DISCLAIMER
struct SOptionDefinition s_OptionDefinitions[eNumberOfOptions]
#define MAY_REQUIRE_LOCATION_HINTING
static const char *const s_OutputFormats[eNumberOfOutputFormats]
#define TOTAL_NUMBER_OF_COMMANDS
#define ALLOW_XSITE_CONN_IF_SUPPORTED
#define NETSTORAGE_DIRECT_OPTIONS
CLogLatencies::EWhich s_GetLatency(const char *arg)
struct SCommandCategoryDefinition s_CategoryDefinitions[eNumberOfCommandCategories]
#define ICACHE_KEY_FORMAT_EXPLANATION
#define OPT_DEF(opt_type, opt_id)
int main(int argc, const char *argv[])
#define NETSTORAGE_COMMON_OPTIONS
#define ICACHE_KEY_FORMAT_EXPLANATION_OPT_VERSION
@ eNumberOfCommandCategories
Declarations of command line interface arguments and handlers.
#define RAW_OUTPUT_FORMAT
#define QUEUEINFO_COMMAND
#define RELIABLE_READ_OPTION
#define LOGIN_TOKEN_HOST_FIELD
#define LOGIN_TOKEN_FILETRACK_SITE
#define WAIT_FOR_JOB_COMPLETION_OPTION
#define LOGIN_TOKEN_SESSION_PID_FIELD
#define LOGIN_TOKEN_QUEUE_FIELD
#define LOGIN_TOKEN_FILETRACK_TOKEN
#define LOGIN_TOKEN_OPTION
#define HUMAN_READABLE_OUTPUT_FORMAT
#define WAIT_FOR_JOB_EVENT_AFTER_OPTION
#define LOGIN_TOKEN_SESSION_TIMESTAMP_FIELD
#define LOGIN_TOKEN_ENABLE_MIRRORING
#define LOGIN_TOKEN_USER_FIELD
#define FAST_STORAGE_OPTION
#define WORKER_NODE_OPTION
#define PROTOCOL_DUMP_OPTION
#define REMOTE_APP_ARGS_OPTION
#define QUEUE_CLASSES_OPTION
#define INPUT_FILE_OPTION
#define TRY_ALL_SERVERS_OPTION
#define LOGIN_TOKEN_NO_CONN_RETRIES
#define QUEUE_CLASS_OPTION
#define JOB_OUTPUT_DIR_OPTION
#define LOGIN_TOKEN_NETCACHE_FIELD
#define OBJECT_KEY_OPTION
#define OUTPUT_FILE_OPTION
#define WAIT_FOR_JOB_STATUS_OPTION
#define JOB_OUTPUT_BLOB_OPTION
#define NETSCHEDULE_CHECK_QUEUE
#define CONFIRM_READ_OPTION
#define ANY_AFFINITY_OPTION
#define NETSTORAGE_OPTION
#define PERSISTENT_OPTION
#define JOB_OUTPUT_OPTION
#define LOGIN_TOKEN_ICACHE_NAME_FIELD
#define LOGIN_TOKEN_ALLOW_XSITE_CONN
#define LOGIN_TOKEN_AUTH_FIELD
#define CLIENT_SESSION_OPTION
#define JSON_OUTPUT_FORMAT
#define NETSCHEDULE_OPTION
#define LOGIN_TOKEN_SESSION_UID_FIELD
@ eExtendedOptionDelimiter
@ eUsePreferredAffinities
#define ALL_QUEUES_OPTION
#define LOGIN_TOKEN_NETSCHEDULE_FIELD
#define LOGIN_TOKEN_APP_UID_FIELD
#define DIRECT_MODE_OPTION
#define WAIT_TIMEOUT_OPTION
#define CLAIM_NEW_AFFINITIES_OPTION
#define JOB_INPUT_DIR_OPTION
#define ROLLBACK_READ_OPTION
const CNcbiEnvironment & GetEnvironment(void) const
Get the application's cached environment.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
void DisableArgDescriptions(TDisableArgDesc disable=fDisableStdArgs)
CNcbiRegistry & GetRWConfig(void)
Get the application's cached configuration parameters, accessible for read-write for an application's...
void UnsetDiagPostFlag(EDiagPostFlag flag)
Unset the specified flag (globally).
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
void SetDiagUserAndHost(TDiagUserAndHost flags=fDiag_AddUser|fDiag_AddHost)
Set username and hostname properties for the diag context.
TDiagPostFlags SetDiagTraceAllFlags(TDiagPostFlags flags)
Versions of the above for extra trace flags.
void SetDiagTrace(EDiagTrace how, EDiagTrace dflt=eDT_Default)
Set the diagnostic trace settings.
TDiagPostFlags SetDiagPostAllFlags(TDiagPostFlags flags)
Set global post flags to "flags".
@ eDPF_Location
Include class and function if any.
@ eDPF_ErrorID
Error code and subcode (default)
@ eDPF_OmitInfoSev
No sev. indication if eDiag_Info.
@ eDPF_Default
Use global default flags (merge with).
@ eDPF_File
File name (not full path)
@ eDPF_LongFilename
Full file path.
@ eDPF_All
All flags (except for the "unusual" ones!)
@ eDT_Enable
Enable messages of severity "eDiag_Trace".
@ eDiag_Trace
Trace message.
#define NCBI_USER_THROW_FMT(message)
Throw a "user exception" with message processed as output to ostream.
const string & GetMsg(void) const
Get message string.
string ReportThis(TDiagPostFlags flags=eDPF_Exception) const
Report this exception only.
#define NCBI_THROW_FMT(exception_class, err_code, message)
The same as NCBI_THROW but with message processed as output to ostream.
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Remove a directory entry.
EJobStatus
Job status codes.
static ENetScheduleWarningType ExtractWarningType(string &warn_msg)
static const char * WarningTypeToString(ENetScheduleWarningType warning_type)
static EJobStatus StringToStatus(const CTempString &status_str)
Parse status string into enumerator value.
@ eJobNotFound
No such job.
@ fNST_NoMetaData
Do not use NetStorage relational database to track ownership & changes.
@ fNST_Cacheable
Has no effect at the moment.
@ fNST_Movable
Allow the object to move between storages.
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
virtual bool HasEntry(const string §ion, const string &name=kEmptyStr, TFlags flags=0) const
bool Set(const string §ion, const string &name, const string &value, TFlags flags=0, const string &comment=kEmptyStr)
Set the configuration parameter value.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static size_t StringToSizet(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to size_t.
static Uint8 StringToUInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Uint8.
static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to unsigned int.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
static const char label[]
unsigned int
A callback function used to compare two keys in a database.
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
while(yy_chk[yy_base[yy_current_state]+yy_c] !=yy_current_state)
const TYPE & Get(const CNamedParameterList *param)
int strcmp(const char *str1, const char *str2)
@ eVoid
To create a void (uninitialized) instance of a component.
#define NcbiSysChar_putenv
bool AddPart(const string &part)
string aggregation_interval
time_t extend_lifetime_by
struct CGridCommandLineInterfaceApp::SOptions::SNCID ncid
TNetStorageFlags netstorage_flags
char option_flags[eNumberOfOptions]
EOutputFormat output_format
const char * name_variants
int(CGridCommandLineInterfaceApp::* cmd_proc)()
int options[eNumberOfOptions+1]
int output_formats[eNumberOfOutputFormats+1]
CCommandLineParser::EOptionType type
const char * name_variants
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4