<commit_before>#!/bin/bash

JOB_DIR=/var/vcap/jobs/memcache_hazelcast
RUN_DIR=/var/vcap/sys/run/memcache_hazelcast
PIDFILE=$RUN_DIR/memcache_hazelcast.pid
LIB_DIR=$JOB_DIR/lib

source /var/vcap/packages/memcache-common/utils.sh

case $1 in

start)
pid_guard $PIDFILE "Memcache Hazelcast"

mkdir -p $RUN_DIR

# Clean-up any Tomcat droppings
rm -rf $RUN_DIR/tomcat

mkdir -p $LIB_DIR
cp /var/vcap/packages/memcache_hazelcast/memcache-hazelcast.jar $LIB_DIR

export JAVA_HOME=/var/vcap/packages/memcache-java

cd $JOB_DIR
exec $JAVA_HOME/bin/java -XX:OnOutOfMemoryError="/var/vcap/bosh/bin/monit restart memcache_hazelcast" \
-server -XX:+UseG1GC -Xms<%= p('memcache_hazelcast.heap_size') %> -Xmx<%= p('memcache_hazelcast.heap_size') %> \
<%= properties.memcache_hazelcast.debug ? " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=#{properties.memcache_hazelcast.debug}" : '' %> \
-jar /var/vcap/packages/memcache_hazelcast/memcache-hazelcast.jar --config=file:$JOB_DIR/config/config.yml

;;

stop)
kill_and_wait $PIDFILE <%= p('memcache_hazelcast.hazelcast.local_member_safe_timeout') + 100 %>

;;

*)
echo "Usage: memcache_hazelcast {start|stop}"

;;

esac
exit 0<commit_msg>Turn off kill -9 if fails to stop in time.<commit_after>#!/bin/bash

JOB_DIR=/var/vcap/jobs/memcache_hazelcast
RUN_DIR=/var/vcap/sys/run/memcache_hazelcast
PIDFILE=$RUN_DIR/memcache_hazelcast.pid
LIB_DIR=$JOB_DIR/lib

source /var/vcap/packages/memcache-common/utils.sh

case $1 in

start)
pid_guard $PIDFILE "Memcache Hazelcast"

mkdir -p $RUN_DIR

# Clean-up any Tomcat droppings
rm -rf $RUN_DIR/tomcat

mkdir -p $LIB_DIR
cp /var/vcap/packages/memcache_hazelcast/memcache-hazelcast.jar $LIB_DIR

export JAVA_HOME=/var/vcap/packages/memcache-java

cd $JOB_DIR
exec $JAVA_HOME/bin/java -XX:OnOutOfMemoryError="/var/vcap/bosh/bin/monit restart memcache_hazelcast" \
-server -XX:+UseG1GC -Xms<%= p('memcache_hazelcast.heap_size') %> -Xmx<%= p('memcache_hazelcast.heap_size') %> \
<%= properties.memcache_hazelcast.debug ? " -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=#{properties.memcache_hazelcast.debug}" : '' %> \
-jar /var/vcap/packages/memcache_hazelcast/memcache-hazelcast.jar --config=file:$JOB_DIR/config/config.yml

;;

stop)
kill_and_wait $PIDFILE <%= p('memcache_hazelcast.hazelcast.local_member_safe_timeout') + 100 %> 0

;;

*)
echo "Usage: memcache_hazelcast {start|stop}"

;;

esac
exit 0
{'fraction_non_alphanumeric': 0.14587650227932034, 'fraction_numerical': 0.005801906340654786, 'mean_word_length': 5.724233983286908, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '933209', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1003, 'n_words': 137}