Changeset 36627 for branches/eam_branches/ipp-20140206/pstamp/scripts
- Timestamp:
- Apr 1, 2014, 11:03:38 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140206
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
pstamp/scripts/pstamp_insert_request.pl (modified) (3 diffs)
-
pstamp/scripts/pstampparse.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140206
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140206/pstamp/scripts/pstamp_insert_request.pl
r35487 r36627 45 45 my $pstamptool = can_run('pstamptool') or (warn "Can't find pstamptool" and $missing_tools = 1); 46 46 my $fields = can_run('fields') or (warn "Can't find fields" and $missing_tools = 1); 47 my $fhead = can_run('fhead') or (warn "Can't find fhead" and $missing_tools = 1); 47 48 48 49 if ($missing_tools) { … … 56 57 # Note that if it's a pstamp request then REQ_NAME should be defined. 57 58 # if it's a detectability query it will not have a REQ_NAME but will have a QUERY_ID 58 my $command = "echo $tmp_req_file | $fields -x 0 EXTNAME EXTVER REQ_NAME QUERY_ID"; 59 # my $command = "echo $tmp_req_file | $fields -x 0 EXTNAME EXTVER REQ_NAME QUERY_ID"; 60 my $command = "$fhead -x 0 $tmp_req_file"; 59 61 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 60 62 run(command => $command, verbose => $verbose); 61 if (0) {62 # stoopid fields doesn't set exit status to zero when it works63 63 unless ($success) { 64 64 print STDERR @$stderr_buf; 65 65 exit $error_code >> 8; 66 66 } 67 }68 67 my $output = join "", @$stdout_buf; 69 (undef, $extname, $extver, $req_name) = split " ", $output; 68 69 70 my $makehash = 0; 71 my %hash; 72 foreach my $line (split "\n", $output) { 73 chomp $line; 74 # split lines inte left and right using equals sign. left is the keyword 75 my ($key, $right) = split "=", $line; 76 # skip if there was no '=' 77 next if !$right; 78 79 $key =~ s/ //g; 80 81 # separate value from comment 82 my ($value, $comment) = split "/", $right; 83 # remove ' and space characters from key and value 84 $value =~ s/'//g; 85 $value =~ s/ //g; 86 87 # print "$key $value\n"; 88 89 # extract the values that we are looking for 90 $extname = $value if ($key eq "EXTNAME"); 91 $extver = $value if ($key eq "EXTVER"); 92 $req_name = $value if ($key eq "REQ_NAME"); 93 $req_name = $value if ($key eq "QUERY_ID"); 94 95 # optionally build hash. Duplicate keys get the last value seen 96 if ($makehash) { 97 $hash{$key} = $value; 98 } 99 } 100 101 # (undef, $extname, $extver, $req_name) = split " ", $output; 102 70 103 if (!$extname or ! (($extname eq "PS1_PS_REQUEST") or ($extname eq "MOPS_DETECTABILITY_QUERY"))) { 71 104 print STDERR "invalid request file\n"; 105 print "invalid request file\n"; 72 106 exit $PS_EXIT_DATA_ERROR; 73 107 } 108 74 109 if (!defined $req_name) { 75 110 print STDERR "invalid request file no REQ_NAME or QUERY_ID\n"; 111 print "invalid request file no REQ_NAME or QUERY_ID\n"; 112 exit $PS_EXIT_DATA_ERROR; 113 } 114 if (!defined $extver) { 115 print STDERR "invalid request file no EXTVER found\n"; 116 print "invalid request file no EXTVER found\n"; 76 117 exit $PS_EXIT_DATA_ERROR; 77 118 } … … 119 160 120 161 exit 0; 162 121 163 # Ask the database for the next web request number 122 164 sub get_webreq_num -
branches/eam_branches/ipp-20140206/pstamp/scripts/pstampparse.pl
r36165 r36627 243 243 my $watch_for_big_requests = (!($label =~ /BIG/) and ($label =~ /PSI/ or $label =~ /WEB/)); 244 244 245 my $big_limit = 100; # XXX: this should be in a configuration file somewhere not hard coded 245 # XXX: these should be in a configuration file somewhere not hard coded 246 my $big_limit = 100; 247 my $job_big_limit = 400; 246 248 247 249 if ($watch_for_big_requests and $nRows > $big_limit) { … … 267 269 268 270 # see whether number of jobs limit for high priority request was exceeded 269 if ($watch_for_big_requests and $num_jobs > $ big_limit) {271 if ($watch_for_big_requests and $num_jobs > $job_big_limit) { 270 272 $label = change_to_lower_priority_label($label); 271 273 $watch_for_big_requests = 0; … … 311 313 my $rownum = $row->{ROWNUM}; 312 314 if (!validID($rownum)) { 315 $rownum = 'NULL' if !defined $rownum; 313 316 print STDERR "$rownum is not a valid ROWNUM\n"; 314 317 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); … … 316 319 } 317 320 my $job_type = $row->{JOB_TYPE}; 318 if (($job_type ne "stamp") and ($job_type ne "get_image")) { 321 if (!defined $job_type || (($job_type ne "stamp") and ($job_type ne "get_image"))) { 322 $job_type = 'NULL' if !defined $job_type; 319 323 print STDERR "$job_type is not a valid JOB_TYPE\n"; 320 324 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST); … … 325 329 if (($req_type ne "byid") and ($req_type ne "bycoord") and ($req_type ne "byexp") and 326 330 ($req_type ne "byskycell") and ($req_type ne "bydiff")) { 331 $req_type = 'NULL' if !defined $req_type; 327 332 print STDERR "$req_type is not a valid REQ_TYPE\n"; 328 333 insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
Note:
See TracChangeset
for help on using the changeset viewer.
