2012-10-24 03:39:51 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
echo " commandline query to RealtimeStandaloneMain service using curl"
|
2012-10-24 12:54:05 -04:00
|
|
|
echo " before running this, do: run_server.sh"
|
2012-10-24 03:39:51 -04:00
|
|
|
|
|
|
|
set +u
|
|
|
|
shopt -s xpg_echo
|
|
|
|
shopt -s expand_aliases
|
|
|
|
trap "exit 1" 1 2 3 15
|
|
|
|
|
2012-10-26 13:20:56 -04:00
|
|
|
QUERY_FILE="${1:-group_by}_query.body"
|
|
|
|
|
|
|
|
[ ! -e $QUERY_FILE ] && echo "expecting file $QUERY_FILE to be in current directory" && exit 2
|
2012-10-24 03:39:51 -04:00
|
|
|
|
2012-10-24 04:51:32 -04:00
|
|
|
for delay in 5 15 15 15 15 15 15 15 15 15 15
|
2012-10-24 03:39:51 -04:00
|
|
|
do
|
|
|
|
echo "sleep for $delay seconds..."
|
|
|
|
echo " "
|
|
|
|
sleep $delay
|
2012-10-26 13:20:56 -04:00
|
|
|
curl -X POST 'http://localhost:8080/druid/v2/' -H 'content-type: application/json' -d @$QUERY_FILE
|
2012-10-24 03:39:51 -04:00
|
|
|
echo " "
|
|
|
|
echo " "
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "$0 finished; you might want to terminate the background process run_server.sh"
|