<?xml version="1.0"?>
<model xmlns="http://www.neeveresearch.com/schema/x-ddl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <busProviders>
        <provider name="local" providerClass="com.neeve.perf.aep.engine.driver.local.LocalProvider" />
    </busProviders>

    <buses>
        <bus name="processor" descriptor="local://.&amp;encoding=${DRIVER_TEST_ENCODING::protobuf.serial}&amp;count=${DRIVER_TEST_COUNT::10000000}&amp;warmup_time=${DRIVER_TEST_WARMUP_TIME::2}&amp;rate=${DRIVER_TEST_RATE::100000}&amp;empty_message=${DRIVER_TEST_EMPTY_MESSAGE::false}&amp;lw_nowrite=${DRIVER_LW_NOWRITE::false}&amp;lw_print_interval_stats=${DRIVER_LW_PRINT_INTERVAL_STATS::false}&amp;injector_cpu_affinity_mask=${DRIVER_INJECTOR_CPU_AFFINITY_MASK::null}&amp;prompt_to_start=${DRIVER_PROMPT_TO_START::false}">
            <channels>
                <channel name="client" id="1">
                    <qos>Guaranteed</qos>
                </channel>
                <channel name="control" id="100">
                    <qos>BestEffort</qos>
                </channel>
            </channels>
        </bus>
    </buses>

    <apps>
        <app name="processor" mainClass="com.neeve.perf.aep.engine.es.Processor">
            <messaging>
                <factories>
                    <factory name="com.neeve.perf.aep.engine.messages.MessageFactory"/>
                    <factory name="com.neeve.perf.serialization.rumi.protobuf.MessageFactory"/>
                    <factory name="com.neeve.perf.serialization.rumi.quark.MessageFactory"/>
                </factories>
                <bus name="processor">
                    <channels>
                        <channel name="client" join="true"/>
                        <channel name="control" join="true"/>
                    </channels>
                    <detachedSend>
                        <queueDepth>${BUS_DETACHED_SEND_QUEUE_DEPTH::1024}</queueDepth>
                        <queueDrainerCpuAffinityMask>${BUS_DETACHED_SEND_QUEUE_DRAINER_CPU_AFFINITY_MASK::[0]}</queueDrainerCpuAffinityMask>
                    </detachedSend>
                </bus>
            </messaging>

            <inboundEventMultiplexing type="${MUX_TYPE::DedicatedThreaded}">
                <queueDepth>${MUX_QUEUE_DEPTH::1024}</queueDepth>
                <queueDrainerCpuAffinityMask>${MUX_CPU_AFFINITY_MASK::[0]}</queueDrainerCpuAffinityMask>
            </inboundEventMultiplexing>

            <storage enabled="${STORAGE_ENABLED::false}">
                <factories>
                    <factory name="com.neeve.perf.aep.engine.messages.MessageFactory"/>
                    <factory name="com.neeve.perf.serialization.rumi.protobuf.MessageFactory"/>
                    <factory name="com.neeve.perf.serialization.rumi.quark.MessageFactory"/>
                </factories>

                <clustering enabled="${CLUSTERING_ENABLED::false}">
                    <discoveryDescriptor>mcast://224.0.1.200:4099&amp;localIfAddr=${CLUSTER_DISCOVERY_LOCALIFADDR::0.0.0.0}</discoveryDescriptor>
                    <localIfAddr>${CLUSTER_REPLICATOR_LOCALIFADDR::0.0.0.0}</localIfAddr>
                    <localPort>${CLUSTER_REPLICATOR_LOCALPORT::0}</localPort>
                    <linkParams>${CLUSTER_LINK_PARAMS::null}</linkParams>
                    <detachedSend enabled="${CLUSTERING_DETACHED_SEND::false}">
                        <queueDepth>${CLUSTERING_DETACHED_SEND_QUEUE_DEPTH::1024}</queueDepth>
                        <queueDrainerCpuAffinityMask>${CLUSTERING_DETACHED_SEND_QUEUE_DRAINER_CPU_AFFINITY_MASK::[0]}</queueDrainerCpuAffinityMask>
                    </detachedSend>
                    <detachedDispatch enabled="${CLUSTERING_DETACHED_DISPATCH::false}">
                        <queueDepth>${CLUSTERING_DETACHED_DISPATCH_QUEUE_DEPTH::1024}</queueDepth>
                        <queueDrainerCpuAffinityMask>${CLUSTERING_DETACHED_DISPATCH_QUEUE_DRAINER_CPU_AFFINITY_MASK::[0]}</queueDrainerCpuAffinityMask>
                    </detachedDispatch>
                    <linkReaderCpuAffinityMask>${CLUSTERING_LINK_READER_CPU_AFFINITY_MASK::0}</linkReaderCpuAffinityMask>
                </clustering>

                <persistenceQuorum>${PERSISTENCE_QUORUM::1}</persistenceQuorum>
                <persistence enabled="${PERSISTENCE_ENABLED::false}">
                    <storeRoot>${PERSISTENCE_LOG_LOCATION::.}</storeRoot>
                    <initialLogLength>${PERSISTENCE_INITIAL_LOG_LENGTH::1}</initialLogLength>
                    <zeroOutInitial>${PERSISTENCE_ZERO_OUT_INITIAL::false}</zeroOutInitial>
                    <writeBufferSize>${PERSISTENCE_WRITE_BUFFER_SIZE::8192}</writeBufferSize>
                    <flushUsingMappedMemory>${PERSISTENCE_FLUSH_USING_MAPPED_MEMORY::false}</flushUsingMappedMemory>
                    <flushOnCommit>${PERSISTENCE_FLUSH_ON_COMMIT::false}</flushOnCommit>
                    <detachedPersist>
                        <queueDepth>${PERSISTENCE_DETACHED_QUEUE_DEPTH::1024}</queueDepth>
                        <queueDrainerCpuAffinityMask>${PERSISTENCE_DETACHED_QUEUE_DRAINER_CPU_AFFINITY_MASK::[0]}</queueDrainerCpuAffinityMask>
                    </detachedPersist>
                    <readBufferSize>${PERSISTENCE_READ_BUFFER_SIZE::8192}</readBufferSize>
                    <pageSize>${PERSISTENCE_PAGE_SIZE::4096}</pageSize>
                </persistence>
            </storage>

            <setSupportMetadata>false</setSupportMetadata>
            <setOutboundSequenceNumbers>false</setOutboundSequenceNumbers>
            <captureTransactionLatencyStats>false</captureTransactionLatencyStats>
        </app>
    </apps>

    <servers>
        <templates>
            <server name="server-template">
                <provisioning>
                    <jvm>
                        <jvmParamSets>
                            <jvmParamSet name="prefer-ipv4">
                                <jvmParams>-Djava.net.preferIPv4Stack=true</jvmParams>
                            </jvmParamSet>
                            <jvmParamSet name="heap-size" order="-1">
                                <jvmParams>${HEAP_SIZE_PARAMS}</jvmParams>
                            </jvmParamSet>
                            <jvmParamSet name="gc-tuning" order="0">
                                <jvmParams>-server</jvmParams>
                            </jvmParamSet>
                        </jvmParamSets>
                    </jvm>
                </provisioning>
            </server>
        </templates>

        <server name="processor-1a" template="server-template">
            <heartbeats enabled="true" interval="1"/>
            <apps>
                <app name="processor" autoStart="true"/>
            </apps>
        </server>
    </servers>
</model>
