<commit_before>#!/bin/sh

usage() {
    cat 1>&2 <<EOF
WindGate Cleaner

Usage:
    $0 profile
    or
    $0 profile [batch-id flow-id] execuion-id

Parameters:
    profile
        name of WindGate profile name
    batch-id
        batch ID of current execution
    flow-id
        flow ID of current execution
    execution-id
        execution ID of current execution
        if not specified, this cleans all sessions
EOF
}

if [ $# -eq 1 ]
then
    _OPT_PROFILE="$1"
elif [ $# -eq 2 ]
then
    _OPT_PROFILE="$1"
    _OPT_EXECUTION_ID="$2"
elif [ $# -eq 4 ]
then
    _OPT_PROFILE="$1"
    _OPT_BATCH_ID="$2"
    _OPT_FLOW_ID="$3"
    _OPT_EXECUTION_ID="$4"
else
    usage
    exit 1
fi

if [ "$WG_CLASSPATH_DELIMITER" = "" ]
then
    _WG_CLASSPATH_DELIMITER=':'
else 
    _WG_CLASSPATH_DELIMITER=$WG_CLASSPATH_DELIMITER
fi

_WG_ROOT="$(dirname $0)/.."
if [ -e "$_WG_ROOT/conf/env.sh" ]
then
    . "$_WG_ROOT/conf/env.sh"
fi

_WG_PROFILE="$_WG_ROOT/profile/${_OPT_PROFILE}.properties"
_WG_SESSION="$_OPT_EXECUTION_ID"

_WG_PLUGIN=""
if [ -e "$_WG_ROOT/plugin" ]
then
    for f in $(ls "$_WG_ROOT/plugin/")
    do
        if [ "$_WG_PLUGIN" = "" ]
        then
            _WG_PLUGIN="$_WG_ROOT/plugin/$f"
        else
            _WG_PLUGIN="${_WG_PLUGIN}${_WG_CLASSPATH_DELIMITER}${_WG_ROOT}/plugin/$f"
        fi
    done
fi

_WG_CLASSPATH="$_WG_ROOT/conf"
if [ -d "$_WG_ROOT/lib" ]
then
    for f in $(ls "$_WG_ROOT/lib/")
    do
        _WG_CLASSPATH="${_WG_CLASSPATH}${_WG_CLASSPATH_DELIMITER}${_WG_ROOT}/lib/$f"
    done
fi
if [ "$ASAKUSA_HOME" != "" -a -d "$ASAKUSA_HOME/core/lib" ]
then
    for f in $(ls "$ASAKUSA_HOME/core/lib/")
    do
        _WG_CLASSPATH="${_WG_CLASSPATH}${_WG_CLASSPATH_DELIMITER}${ASAKUSA_HOME}/core/lib/$f"
    done
fi

export WINDGATE_PROFILE="$_OPT_PROFILE"

_WG_CLASS="com.asakusafw.windgate.bootstrap.WindGateAbort"

echo "Cleaning WindGate Session(s)"
echo "  -classpath $_WG_CLASSPATH"
echo "  -profile $_WG_PROFILE"
echo "  -session $_WG_SESSION"
echo "  -plugin $_WG_PLUGIN"

if [ -d "$HADOOP_HOME" ]<commit_msg>Added classpath $ASAKUSA_HOME/ext/lib to abort.sh (#69),<commit_after>#!/bin/sh

usage() {
    cat 1>&2 <<EOF
WindGate Cleaner

Usage:
    $0 profile
    or
    $0 profile [batch-id flow-id] execuion-id

Parameters:
    profile
        name of WindGate profile name
    batch-id
        batch ID of current execution
    flow-id
        flow ID of current execution
    execution-id
        execution ID of current execution
        if not specified, this cleans all sessions
EOF
}

if [ $# -eq 1 ]
then
    _OPT_PROFILE="$1"
elif [ $# -eq 2 ]
then
    _OPT_PROFILE="$1"
    _OPT_EXECUTION_ID="$2"
elif [ $# -eq 4 ]
then
    _OPT_PROFILE="$1"
    _OPT_BATCH_ID="$2"
    _OPT_FLOW_ID="$3"
    _OPT_EXECUTION_ID="$4"
else
    usage
    exit 1
fi

if [ "$WG_CLASSPATH_DELIMITER" = "" ]
then
    _WG_CLASSPATH_DELIMITER=':'
else 
    _WG_CLASSPATH_DELIMITER=$WG_CLASSPATH_DELIMITER
fi

_WG_ROOT="$(dirname $0)/.."
if [ -e "$_WG_ROOT/conf/env.sh" ]
then
    . "$_WG_ROOT/conf/env.sh"
fi

_WG_PROFILE="$_WG_ROOT/profile/${_OPT_PROFILE}.properties"
_WG_SESSION="$_OPT_EXECUTION_ID"

_WG_PLUGIN=""
if [ -e "$_WG_ROOT/plugin" ]
then
    for f in $(ls "$_WG_ROOT/plugin/")
    do
        if [ "$_WG_PLUGIN" = "" ]
        then
            _WG_PLUGIN="$_WG_ROOT/plugin/$f"
        else
            _WG_PLUGIN="${_WG_PLUGIN}${_WG_CLASSPATH_DELIMITER}${_WG_ROOT}/plugin/$f"
        fi
    done
fi

_WG_CLASSPATH="$_WG_ROOT/conf"
if [ -d "$_WG_ROOT/lib" ]
then
    for f in $(ls "$_WG_ROOT/lib/")
    do
        _WG_CLASSPATH="${_WG_CLASSPATH}${_WG_CLASSPATH_DELIMITER}${_WG_ROOT}/lib/$f"
    done
fi
if [ "$ASAKUSA_HOME" != "" -a -d "$ASAKUSA_HOME/core/lib" ]
then
    for f in $(ls "$ASAKUSA_HOME/core/lib/")
    do
        _WG_CLASSPATH="${_WG_CLASSPATH}${_WG_CLASSPATH_DELIMITER}${ASAKUSA_HOME}/core/lib/$f"
    done
fi
if [ -d "$ASAKUSA_HOME/ext/lib" ]
then
    for f in $(ls "$ASAKUSA_HOME/ext/lib/")
    do
        _WG_CLASSPATH="${_WG_CLASSPATH}${_WG_CLASSPATH_DELIMITER}${ASAKUSA_HOME}/ext/lib/$f"
    done
fi

export WINDGATE_PROFILE="$_OPT_PROFILE"

_WG_CLASS="com.asakusafw.windgate.bootstrap.WindGateAbort"

echo "Cleaning WindGate Session(s)"
echo "  -classpath $_WG_CLASSPATH"
echo "  -profile $_WG_PROFILE"
echo "  -session $_WG_SESSION"
echo "  -plugin $_WG_PLUGIN"

if [ -d "$HADOOP_HOME" ]
{'fraction_non_alphanumeric': 0.14091954022988507, 'fraction_numerical': 0.007816091954022988, 'mean_word_length': 3.124170616113744, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '3832370', 'n_tokens_mistral': 1857, 'n_tokens_neox': 1882, 'n_words': 340}