modify
This commit is contained in:
@ -1,4 +0,0 @@
|
||||
worker-id: 7b8e6dbf-1e3e-4368-8f0c-1a4936042ca7
|
||||
logs.users: []
|
||||
logs.groups: []
|
||||
topology.submitter.user: ciic
|
@ -1,4 +0,0 @@
|
||||
worker-id: 931219fd-8b9a-4333-9fda-5d1df11a258c
|
||||
logs.users: []
|
||||
logs.groups: []
|
||||
topology.submitter.user: ciic
|
@ -1,4 +0,0 @@
|
||||
worker-id: 9cdf2e0f-b135-41c6-b3fd-1502afddf212
|
||||
logs.users: []
|
||||
logs.groups: []
|
||||
topology.submitter.user: ciic
|
@ -1,4 +0,0 @@
|
||||
worker-id: 9837751b-8320-4651-b325-3c64898b976d
|
||||
logs.users: []
|
||||
logs.groups: []
|
||||
topology.submitter.user: ciic
|
@ -17,6 +17,19 @@
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/resources/assembly.xml</descriptor>
|
||||
</descriptors>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>com.heibaiying.wordcount.ClusterWordCountApp</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@ -27,6 +40,12 @@
|
||||
<artifactId>storm-core</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.8.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
@ -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