2012-10-24 03:39:51 -04:00
#!/usr/bin/env bash
2012-11-24 08:04:25 -05:00
echo "This will run RealtimeStandaloneMain service in background"
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
# props are set in src/main/resources/runtime.properties
2012-11-24 08:04:25 -05:00
[ -d /tmp/rand_realtime ] && echo "cleaning up from previous run.." && /bin/rm -fr /tmp/rand_realtime
2012-10-24 03:39:51 -04:00
2012-11-24 08:04:25 -05:00
# check spec file exists
2012-10-24 03:39:51 -04:00
[ ! -e rand_realtime.spec ] && echo "expecting file rand_realtime.spec (as specified by property druid.realtime.specFile) to be in current directory" && exit 3
# start RealtimeNode process
#
2012-11-24 08:04:25 -05:00
echo "Log output of service can be found in ./RealtimeNode.out"
java -Xmx600m -Duser.timezone= UTC -Dfile.encoding= UTF-8 -classpath target/druid-examples-rand-*-selfcontained.jar druid.examples.RealtimeStandaloneMain >RealtimeNode.out 2>& 1 &
2012-10-24 03:39:51 -04:00
PID = $!
2012-11-24 08:04:25 -05:00
trap " kill $PID ; exit 1 " 1 2 3 15
2012-10-24 03:39:51 -04:00
sleep 4
grep druid.examples.RandomFirehoseFactory RealtimeNode.out | awk '{ print $7,$8,$9,$10,$11,$12,$13,$14,$15 }'
wait $PID
echo "RealtimeStandaloneMain finished"