<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License. See accompanying LICENSE file.
-->

<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

    <description>Kylin Metrics Related Configuration</description>

    <bean id="instantReservoir" class="org.apache.kylin.metrics.lib.impl.InstantReservoir"/>

    <bean id="blockingReservoir" class="org.apache.kylin.metrics.lib.impl.BlockingReservoir">
        <constructor-arg index="0">
            <value>10</value>
        </constructor-arg>
        <constructor-arg index="1">
            <value>10</value>
        </constructor-arg>
        <constructor-arg index="2">
            <value>10</value>
        </constructor-arg>
    </bean>

    <bean id="hiveSink" class="org.apache.kylin.metrics.lib.impl.hive.HiveSink"/>

    <bean id="kafkaSink" class="org.apache.kylin.metrics.lib.impl.kafka.KafkaSink"/>

    <bean id="initMetricsManager" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetClass" value="org.apache.kylin.metrics.MetricsManager"/>
        <property name="targetMethod" value="initMetricsManager"/>
        <property name="arguments">
            <list>
                <ref bean="hiveSink"/>
                <map key-type="org.apache.kylin.metrics.lib.ActiveReservoir" value-type="java.util.List">
                    <!--
                    <entry key-ref="instantReservoir">
                        <list>
                            <bean class="org.apache.kylin.common.util.Pair">
                                <property name="first"
                                          value="org.apache.kylin.metrics.lib.impl.kafka.KafkaReservoirReporter"/>
                                <property name="second">
                                    <props>
                                        <prop key="bootstrap.servers">sandbox:9092</prop>
                                    </props>
                                </property>
                            </bean>
                        </list>
                    </entry>
                    -->
                    <entry key-ref="blockingReservoir">
                        <list>
                            <bean class="org.apache.kylin.common.util.Pair">
                                <property name="first"
                                          value="org.apache.kylin.metrics.lib.impl.hive.HiveReservoirReporter"/>
                                <property name="second">
                                    <props>
                                    </props>
                                </property>
                            </bean>
                        </list>
                    </entry>
                </map>
            </list>
        </property>
    </bean>

</beans>