<commit_before><?xml version="1.0" encoding="UTF-8"?>
<project name="terrastore-install" basedir=".">

    <taskdef resource="net/sf/antcontrib/antlib.xml">
        <classpath>
            <pathelement location="ant/ant-contrib.jar"/>
        </classpath>
    </taskdef>

    <target name="quickstart" if="quickstart.dir" description="Terrastore quickstart.">

        <antcall target="version"/>

        <if>
            <not><available file="${quickstart.dir}/master"/></not>
            <then>
                <echo message="Install master on: ${quickstart.dir}/master"/>
                <antcall target="common-master">
                    <param name="install.dir" value="${quickstart.dir}/master"/>
                    <param name="config" value="terracotta-config.xml"/>
                    <param name="master" value="terrastore-single-master"/>
                    <param name="master.host.token" value="@master.server.host@"/>
                    <param name="master.host" value="%i"/>
                </antcall>
            </then>
        </if>

        <if>
            <not><available file="${quickstart.dir}/server1"/></not>
            <then>
                <echo message="Install server on: ${quickstart.dir}/server1"/>
                <antcall target="common-server">
                    <param name="install.dir" value="${quickstart.dir}/server1"/>
                </antcall>
            </then>
        </if>

        <if>
            <not><available file="${quickstart.dir}/server2"/></not>
            <then>
                <echo message="Install server on: ${quickstart.dir}/server2"/>
                <antcall target="common-server">
                    <param name="install.dir" value="${quickstart.dir}/server2"/>
                </antcall>
            </then>
        </if>

        <forget>
            <exec executable="${quickstart.dir}/master/bin/start.sh"/>
        </forget>

        <waitfor maxwait="1" maxwaitunit="minute" checkevery="1000" checkeveryunit="millisecond">
            <http url="http://localhost:9510/groupinfo" />
        </waitfor>

        <forget>
            <exec executable="${quickstart.dir}/server1/bin/start.sh">
                <arg value="--httpPort"/>
                <arg value="8000"/>
                <arg value="--nodePort"/>
                <arg value="6000"/>
                <arg value="--shutdownPort"/>
                <arg value="0"/>
                <arg value="--master"/>
                <arg value="localhost:9510"/>
            </exec>
        </forget>

        <waitfor maxwait="3" maxwaitunit="minute" checkevery="1000" checkeveryunit="millisecond">
            <http url="http://localhost:8000/" />
        </waitfor>

        <forget>
            <exec executable="${quickstart.dir}/server2/bin/start.sh">
                <arg value="--httpPort"/>
                <arg value="8001"/>
                <arg value="--nodePort"/>
                <arg value="6001"/>
                <arg value="--shutdownPort"/>
                <arg value="0"/>
                <arg value="--master"/>
                <arg value="localhost:9510"/>
            </exec>
        </forget>

        <waitfor maxwait="3" maxwaitunit="minute" checkevery="1000" checkeveryunit="millisecond">
            <http url="http://localhost:8001/"/>
        </waitfor>

        <sleep seconds="5"/>
        <echo message="Started master node."/>
        <echo message="Started first server node at 127.0.0.1:8000"/>
        <echo message="Started second server node at 127.0.0.1:8001"/>

        <input message="Type enter to quit without stopping the cluster, or press Ctrl-C to quit and stop all processes..."/>

    </target>

    <target name="server" if="install.dir" description="Install Terrastore server.">

        <antcall target="version"/>

        <antcall target="common-server"/>

    </target>

    <target name="single-master" if="install.dir" description="Install single Terrastore master.">

        <antcall target="version"/>

        <antcall target="common-master">
            <param name="config" value="terracotta-config.xml"/>
            <param name="master" value="terrastore-single-master"/>
            <param name="master.host.token" value="@master.server.host@"/>
            <param name="master.host" value="%i"/>
        </antcall>

    </target>

    <target name="ha-master-1" if="install.dir" description="Install Terrastore ha master 1.">

        <antcall target="version"/>

        <antcall target="common-master">
            <param name="config" value="terracotta-config-ha.xml"/>
            <param name="master" value="terrastore-ha-master-1"/>
        </antcall>

    </target>

    <target name="ha-master-2" if="install.dir" description="Install Terrastore ha master 2.">

        <antcall target="version"/>

        <antcall target="common-master">
            <param name="config" value="terracotta-config-ha.xml"/>
            <param name="master" value="terrastore-ha-master-2"/>
        </antcall>

    </target>

    <target name="version">
        <echo message="Terrastore Install Tool - Version 0.7.0"/>
    </target>

    <target name="common-server">

        <copy todir="${install.dir}">
            <fileset dir="terrastore-server/"/>
        </copy>

        <chmod dir="${install.dir}/bin" perm="ugo+x" includes="**/*.sh"/>

    </target>

    <target name="common-master">

        <property name="master.server.port" value="9510"/><commit_msg>Updated terrastore-install tool version.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<project name="terrastore-install" basedir=".">

    <taskdef resource="net/sf/antcontrib/antlib.xml">
        <classpath>
            <pathelement location="ant/ant-contrib.jar"/>
        </classpath>
    </taskdef>

    <target name="quickstart" if="quickstart.dir" description="Terrastore quickstart.">

        <antcall target="version"/>

        <if>
            <not><available file="${quickstart.dir}/master"/></not>
            <then>
                <echo message="Install master on: ${quickstart.dir}/master"/>
                <antcall target="common-master">
                    <param name="install.dir" value="${quickstart.dir}/master"/>
                    <param name="config" value="terracotta-config.xml"/>
                    <param name="master" value="terrastore-single-master"/>
                    <param name="master.host.token" value="@master.server.host@"/>
                    <param name="master.host" value="%i"/>
                </antcall>
            </then>
        </if>

        <if>
            <not><available file="${quickstart.dir}/server1"/></not>
            <then>
                <echo message="Install server on: ${quickstart.dir}/server1"/>
                <antcall target="common-server">
                    <param name="install.dir" value="${quickstart.dir}/server1"/>
                </antcall>
            </then>
        </if>

        <if>
            <not><available file="${quickstart.dir}/server2"/></not>
            <then>
                <echo message="Install server on: ${quickstart.dir}/server2"/>
                <antcall target="common-server">
                    <param name="install.dir" value="${quickstart.dir}/server2"/>
                </antcall>
            </then>
        </if>

        <forget>
            <exec executable="${quickstart.dir}/master/bin/start.sh"/>
        </forget>

        <waitfor maxwait="1" maxwaitunit="minute" checkevery="1000" checkeveryunit="millisecond">
            <http url="http://localhost:9510/groupinfo" />
        </waitfor>

        <forget>
            <exec executable="${quickstart.dir}/server1/bin/start.sh">
                <arg value="--httpPort"/>
                <arg value="8000"/>
                <arg value="--nodePort"/>
                <arg value="6000"/>
                <arg value="--shutdownPort"/>
                <arg value="0"/>
                <arg value="--master"/>
                <arg value="localhost:9510"/>
            </exec>
        </forget>

        <waitfor maxwait="3" maxwaitunit="minute" checkevery="1000" checkeveryunit="millisecond">
            <http url="http://localhost:8000/" />
        </waitfor>

        <forget>
            <exec executable="${quickstart.dir}/server2/bin/start.sh">
                <arg value="--httpPort"/>
                <arg value="8001"/>
                <arg value="--nodePort"/>
                <arg value="6001"/>
                <arg value="--shutdownPort"/>
                <arg value="0"/>
                <arg value="--master"/>
                <arg value="localhost:9510"/>
            </exec>
        </forget>

        <waitfor maxwait="3" maxwaitunit="minute" checkevery="1000" checkeveryunit="millisecond">
            <http url="http://localhost:8001/"/>
        </waitfor>

        <sleep seconds="5"/>
        <echo message="Started master node."/>
        <echo message="Started first server node at 127.0.0.1:8000"/>
        <echo message="Started second server node at 127.0.0.1:8001"/>

        <input message="Type enter to quit without stopping the cluster, or press Ctrl-C to quit and stop all processes..."/>

    </target>

    <target name="server" if="install.dir" description="Install Terrastore server.">

        <antcall target="version"/>

        <antcall target="common-server"/>

    </target>

    <target name="single-master" if="install.dir" description="Install single Terrastore master.">

        <antcall target="version"/>

        <antcall target="common-master">
            <param name="config" value="terracotta-config.xml"/>
            <param name="master" value="terrastore-single-master"/>
            <param name="master.host.token" value="@master.server.host@"/>
            <param name="master.host" value="%i"/>
        </antcall>

    </target>

    <target name="ha-master-1" if="install.dir" description="Install Terrastore ha master 1.">

        <antcall target="version"/>

        <antcall target="common-master">
            <param name="config" value="terracotta-config-ha.xml"/>
            <param name="master" value="terrastore-ha-master-1"/>
        </antcall>

    </target>

    <target name="ha-master-2" if="install.dir" description="Install Terrastore ha master 2.">

        <antcall target="version"/>

        <antcall target="common-master">
            <param name="config" value="terracotta-config-ha.xml"/>
            <param name="master" value="terrastore-ha-master-2"/>
        </antcall>

    </target>

    <target name="version">
        <echo message="Terrastore Install Tool - Version 0.7.1"/>
    </target>

    <target name="common-server">

        <copy todir="${install.dir}">
            <fileset dir="terrastore-server/"/>
        </copy>

        <chmod dir="${install.dir}/bin" perm="ugo+x" includes="**/*.sh"/>

    </target>

    <target name="common-master">

        <property name="master.server.port" value="9510"/>
{'fraction_non_alphanumeric': 0.1680518768837337, 'fraction_numerical': 0.01790117818978902, 'mean_word_length': 1.9690889370932756, 'pattern_counts': {'":': 0, '<': 255, '<?xml version=': 2, '>': 255, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 4, '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': '1761453', 'n_tokens_mistral': 3258, 'n_tokens_neox': 3001, 'n_words': 590}