This commit is contained in:
罗祥
2019-04-16 17:13:27 +08:00
parent 0d1f009af0
commit 8a35586f38
14 changed files with 185 additions and 19 deletions

View File

@ -28,7 +28,7 @@ public class CountBolt extends BaseRichBolt {
count++;
counts.put(word, count);
// 输出
System.out.print("当前实时统计结果:");
System.out.print("Real-time analysis results : ");
counts.forEach((key, value) -> System.out.print(key + ":" + value + "; "));
System.out.println();
}

View File

@ -1,6 +1,6 @@
package com.heibaiying.wordcount.component;
import org.apache.storm.shade.org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.storm.spout.SpoutOutputCollector;
import org.apache.storm.task.TopologyContext;
import org.apache.storm.topology.OutputFieldsDeclarer;

View File

@ -0,0 +1,25 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>jar-with-dependencies</id>
<!--指明打包方式-->
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
<!--排除storm环境中已经提供的storm-core-->
<excludes>
<exclude>org.apache.storm:storm-core</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>