Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
122 lines (107 sloc) 4.06 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- <bean id="printEventPE" class="org.apache.s4.processor.PrintEventPE">
<property name="id" value="printEventPE"/>
<property name="keys">
<list>
<value>TopicSeen topic</value>
</list>
</property>
</bean> -->
<bean id="topicExtractorPE" class="org.apache.s4.example.twittertopiccount.TopicExtractorPE">
<property name="id" value="topicSeenPE"/>
<property name="keys">
<list>
<value>RawStatus *</value>
</list>
</property>
<property name="dispatcher" ref="twitDispatcher"/>
<property name="outputStreamName" value="TopicSeen"/>
</bean>
<bean id="topicCountAndReportPE" class="org.apache.s4.example.twittertopiccount.TopicCountAndReportPE">
<property name="id" value="topicCountAndReportPE"/>
<property name="keys">
<list>
<value>TopicSeen topic</value>
</list>
</property>
<property name="threshold" value="4"/>
<property name="outputFrequencyByTimeBoundary" value="5"/>
<property name="dispatcher" ref="forkdispatcher"/>
<property name="outputStreamName" value="AggregatedTopicSeen"/>
<property name="ttl" value="36000"/>
</bean>
<bean id="dtfPersister" class="org.apache.s4.example.twittertopiccount.DirectToFilePersister">
<property name="outputFilename" value="/tmp/top_n_hashtags"/>
</bean>
<bean id="top10TopicPE" class="org.apache.s4.example.twittertopiccount.TopNTopicPE">
<property name="id" value="top10TopicPE"/>
<property name="keys">
<list>
<value>AggregatedTopicSeen reportKey</value>
</list>
</property>
<property name="entryCount" value="10"/>
<property name="outputFrequencyByTimeBoundary" value="10"/>
<property name="persister" ref="dtfPersister"/>
<property name="persistTime" value="864000"/>
<property name="persistKey" value="myapp:top10Topics"/>
<property name="ttl" value="36000"/>
</bean>
<bean id="topicSeenPartitioner" class="org.apache.s4.dispatcher.partitioner.DefaultPartitioner">
<property name="streamNames">
<list>
<value>TopicSeen</value>
</list>
</property>
<property name="hashKey">
<list>
<value>topic</value>
</list>
</property>
<property name="hasher" ref="hasher"/>
<property name="debug" value="false"/>
</bean>
<bean id="aggregatedTopicSeenPartitioner" class="org.apache.s4.dispatcher.partitioner.DefaultPartitioner">
<property name="streamNames">
<list>
<value>AggregatedTopicSeen</value>
</list>
</property>
<property name="hashKey">
<list>
<value>reportKey</value>
</list>
</property>
<property name="hasher" ref="hasher"/>
<property name="debug" value="false"/>
</bean>
<bean id="twitDispatcher" class="org.apache.s4.dispatcher.Dispatcher" init-method="init">
<property name="partitioners">
<list>
<ref bean="topicSeenPartitioner"/>
<ref bean="aggregatedTopicSeenPartitioner"/>
</list>
</property>
<property name="eventEmitter" ref="commLayerEmitter"/>
<property name="loggerName" value="s4"/>
</bean>
<!-- dispatcher to S4 and client adapter -->
<bean id="forkdispatcher" class="org.apache.s4.dispatcher.MultiDispatcher">
<property name="dispatchers">
<list>
<!-- send everything through the S4 dispatcher -->
<ref bean="twitDispatcher"/>
<!-- send some streams to client adapters -->
<bean id="selectiveDispatchToAdapter" class="org.apache.s4.dispatcher.StreamSelectingDispatcher">
<property name="dispatcher" ref="dispatcherToClientAdapters"/>
<property name="streams">
<list>
<value>AggregatedTopicSeen</value>
</list>
</property>
</bean>
</list>
</property>
</bean>
</beans>
Jump to Line
Something went wrong with that request. Please try again.