function stop_qizx() {
sleep 2
- rm -rf mat.xq count.xq
+# rm -rf mat.xq count.xq
QIZXPIDS=`ps xwww --format "%p,%a" | grep java | grep qizx | cut -f 1 -d ' '`
for i in $QIZXPIDS
do
query="$1"
doc=`basename "$2"`
repeat="$3"
+ count="$4"
echo 'let $doc := collection("'"$doc"'") return count($doc'"$query"')' > count.xq
echo 'let $doc := collection("'"$doc"'") return $doc'"$query" > mat.xq
then
break
fi
- done
+ done
IT=0
- while true
- do
- OUTPUT=`$QIZX -g /raid0/kn/qizxlib/ -l xmark -r "$repeat" mat.xq -out /dev/null 2>&1`
+ if [ -z "$count" ]
+ then
+
+ while true
+ do
+ OUTPUT=`$QIZX -g /raid0/kn/qizxlib/ -l xmark -r "$repeat" mat.xq -out /dev/null 2>&1`
if echo "$OUTPUT" | grep -q 'java' >/dev/null 2>&1
then
if [ "$IT" = 5 ]
break
fi
done
+ else
+ time_mat="999999"
+ fi
echo $time_count
echo 0