empiredan commented on code in PR #2191:
URL:
https://github.com/apache/incubator-pegasus/pull/2191#discussion_r1954007588
##########
admin_tools/pegasus_manual_compact.sh:
##########
@@ -119,10 +119,10 @@ function wait_manual_compact()
query_log_file="/tmp/$UID.$PID.pegasus.query_compact.${app_id}"
echo "${query_cmd}" | ./run.sh shell --cluster ${cluster}
&>${query_log_file}
- queue_count=`grep 'recent enqueue at' ${query_log_file} | grep -v
'recent start at' | wc -l`
- running_count=`grep 'recent start at' ${query_log_file} | wc -l`
+ queue_count=$(awk 'BEGIN {count=0} {match($0,
/"recent_enqueue_at":"([^"]+)"/, enqueue); match($0,
/"recent_start_at":"([^"]+)"/, start); if (enqueue[1] != "-" && start[1] ==
"-") {count++}} END {print count}' "$query_log_file")
+ running_count=$(awk 'BEGIN {count=0} {match($0,
/"recent_start_at":"([^"]+)"/, start); if (start[1] != "-" && length(start[1])
> 0) {count++}} END {print count}' "$query_log_file")
processing_count=$((queue_count+running_count))
- finish_count=`grep "last finish at" ${query_log_file} | grep -v
"recent enqueue at" | grep -v "recent start at" | grep -o 'last finish at
[^,]*' | sed 's/\[/,/;s/\]//' | awk -F"," -v date="$earliest_finish_time_ms"
'BEGIN{count=0}{if(length($2)==23 && $2>=date){count++;}}END{print count}'`
+ finish_count=$(awk 'BEGIN {count=0} {match($0,
/"last_finish":"([^"]+)"/, finish); if (finish[1] != "-" && length(finish[1]) >
0) {count++}} END {print count}' "$query_log_file")
Review Comment:
However, what will happen if `_manual_compact_last_finish_time_ms` still
hold the last finish time of previous `once` manual compaction task ?
`${trigger_time}` of this manual compaction task would be less than that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]