modify
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -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;
|
||||
|
25
code/Storm/storm-word-count/src/main/resources/assembly.xml
Normal file
25
code/Storm/storm-word-count/src/main/resources/assembly.xml
Normal 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>
|
Reference in New Issue
Block a user