Changeset 6180
- Timestamp:
- Jan 22, 2006, 10:04:22 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/doc/p2tools.sh (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/doc/p2tools.sh
r6021 r6180 5 5 # 6 6 # queues: 7 # p2pending: (url) (expID) (cameraID) (chipID) (state)7 # p2pending: expID class classID url 8 8 # 9 9 # globals: 10 10 11 queueinit stdout 12 queueinit stderr 13 queueinit p2pending 14 15 macro p2parse 16 if ($0 != 7) 17 echo "usage: p2parse (key) (expID) (class) (classID) (url) (state)" 18 break 19 end 20 $expID = $2 21 $class = $3 22 $classID = $4 23 $url = $5 24 $key = $expID.$classID 25 end 26 11 27 # p2pending : search for images to be processed 12 28 task p2pending 13 command p2search -pending29 command p2search.sh -pending 14 30 host local 15 31 … … 22 38 task.exit 0 23 39 local i Nstdout 40 41 # pop off the header line 42 queuepop stdout 43 24 44 # keep only new, unique entries (URL is key) 25 45 queuesize stdout -var Nstdout 26 46 for i 0 $Nstdout 27 47 queuepop stdout -var line 28 queuepush p2pending -uniq -key 0 "$line new" 48 p2parse unknown $line new 49 queuepush p2pending -uniq -key 0 "$key $line new" 29 50 end 51 echo "loaded p2pending, current state:" 52 queueprint p2pending 30 53 end 31 54 end … … 33 56 # ppImage : submit an image for processing by ppImage 34 57 task ppImage 35 periods -exec 0.158 periods -exec 1 36 59 periods -timeout 120 37 60 … … 44 67 # if ($network == 0) break 45 68 46 queuepop p2pending -var line -key 4new69 queuepop p2pending -var line -key 5 new 47 70 if ("$line" == "NULL") break 71 p2parse $line 48 72 49 list tmp -split $line 50 $url = $tmp:0 51 $expID = $tmp:1 52 $camera = $tmp:2 53 $chip = $tmp:3 54 queuepush p2pending "$url $expID $camera $chip run" 73 echo "new ppImaage: $key $expID $class $classID $url run" 74 queuepush p2pending "$key $expID $class $classID $url run" 55 75 56 76 # need to decide real name for this function 57 $host = `chip.host $camera $chip` 58 host $host 59 command ppImage $url $chip 77 # $host = `chip.host $camera $chip` 78 # host $host 79 80 host local 81 echo command ppImage.sh $key $url $classID 82 command ppImage.sh $key $url $classID 60 83 end 61 84 … … 63 86 task.exit 0 64 87 # if ppImage updates the DB: 88 echo "done with $taskarg:1" 65 89 queueinit stdout 66 queuepush p2pending $taskargs:0 $taskargs:1 $taskargs:2 $taskargs:3 done 90 queuepop p2pending -key 0 $taskarg:1 -var line 91 echo "got line: $line" 92 93 if ("$line" == "NULL") 94 echo "missing entry in p2pending queue?" 95 break 96 end 97 98 p2parse $line 99 queuepush p2pending "$key $expID $class $classID $url done" 100 echo queuepush p2pending "$key $expID $class $classID $url done" 67 101 68 102 # if ppImage does NOT update the DB: 69 queueinit stdout70 exec p2search -done $taskargs:0 $taskargs:1 $taskargs:271 queuepush p2pending $taskargs:0 $taskargs:1 $taskargs:2 $taskargs:3 done72 103 end 73 104 … … 80 111 81 112 # timeout shorter than exec so jobs do not build up 82 periods -exec 5113 periods -exec 100 83 114 periods -poll 1 84 115 periods -timeout 4 116 117 # task is never allowed to run 118 task.exec 119 break 120 end 85 121 end 86 122 … … 91 127 92 128 # timeout shorter than exec so jobs do not build up 93 periods -exec 5129 periods -exec 100 94 130 periods -poll 1 95 131 periods -timeout 4 132 133 # task is never allowed to run 134 task.exec 135 break 136 end 96 137 end 97
Note:
See TracChangeset
for help on using the changeset viewer.
