为了账号安全,请及时绑定邮箱和手机立即绑定

WordCountTopology.java 缺少backType package

javac WordCountTopology.java

WordCountTopology.java:20: package backtype.storm does not exist
import backtype.storm.Config;
                     ^
WordCountTopology.java:21: package backtype.storm does not exist
import backtype.storm.LocalCluster;
                     ^
WordCountTopology.java:22: package backtype.storm does not exist
import backtype.storm.StormSubmitter;
                     ^
WordCountTopology.java:23: package backtype.storm.task does not exist
import backtype.storm.task.ShellBolt;
                          ^
WordCountTopology.java:24: package backtype.storm.topology does not exist
import backtype.storm.topology.BasicOutputCollector;
                              ^
WordCountTopology.java:25: package backtype.storm.topology does not exist
import backtype.storm.topology.IRichBolt;
                              ^
WordCountTopology.java:26: package backtype.storm.topology does not exist
import backtype.storm.topology.OutputFieldsDeclarer;
                              ^
WordCountTopology.java:27: package backtype.storm.topology does not exist
import backtype.storm.topology.TopologyBuilder;
                              ^
WordCountTopology.java:28: package backtype.storm.topology.base does not exist
import backtype.storm.topology.base.BaseBasicBolt;
                                   ^
WordCountTopology.java:29: package backtype.storm.tuple does not exist
import backtype.storm.tuple.Fields;
                           ^
WordCountTopology.java:30: package backtype.storm.tuple does not exist
import backtype.storm.tuple.Tuple;
                           ^
WordCountTopology.java:31: package backtype.storm.tuple does not exist
import backtype.storm.tuple.Values;
                           ^
WordCountTopology.java:32: package storm.starter.spout does not exist
import storm.starter.spout.RandomSentenceSpout;
                          ^
WordCountTopology.java:41: cannot find symbol
symbol  : class ShellBolt
location: class storm.starter.WordCountTopology
  public static class SplitSentence extends ShellBolt implements IRichBolt {
                                            ^
WordCountTopology.java:41: cannot find symbol
symbol  : class IRichBolt
location: class storm.starter.WordCountTopology
  public static class SplitSentence extends ShellBolt implements IRichBolt {
                                                                 ^
WordCountTopology.java:48: cannot find symbol
symbol  : class OutputFieldsDeclarer
location: class storm.starter.WordCountTopology.SplitSentence
    public void declareOutputFields(OutputFieldsDeclarer declarer) {
                                    ^
WordCountTopology.java:58: cannot find symbol
symbol  : class BaseBasicBolt
location: class storm.starter.WordCountTopology
  public static class WordCount extends BaseBasicBolt {
                                        ^
WordCountTopology.java:62: cannot find symbol
symbol  : class Tuple
location: class storm.starter.WordCountTopology.WordCount
    public void execute(Tuple tuple, BasicOutputCollector collector) {
                        ^
WordCountTopology.java:62: cannot find symbol
symbol  : class BasicOutputCollector
location: class storm.starter.WordCountTopology.WordCount
    public void execute(Tuple tuple, BasicOutputCollector collector) {
                                     ^
WordCountTopology.java:73: cannot find symbol
symbol  : class OutputFieldsDeclarer
location: class storm.starter.WordCountTopology.WordCount
    public void declareOutputFields(OutputFieldsDeclarer declarer) {
                                    ^
WordCountTopology.java:49: cannot find symbol
symbol  : class Fields
location: class storm.starter.WordCountTopology.SplitSentence
      declarer.declare(new Fields("word"));
                           ^
WordCountTopology.java:47: method does not override or implement a method from a supertype
    @Override
    ^
WordCountTopology.java:52: method does not override or implement a method from a supertype
    @Override
    ^
WordCountTopology.java:69: cannot find symbol
symbol  : class Values
location: class storm.starter.WordCountTopology.WordCount
      collector.emit(new Values(word, count));
                         ^
WordCountTopology.java:61: method does not override or implement a method from a supertype
    @Override
    ^
WordCountTopology.java:74: cannot find symbol
symbol  : class Fields
location: class storm.starter.WordCountTopology.WordCount
      declarer.declare(new Fields("word", "count"));
                           ^
WordCountTopology.java:72: method does not override or implement a method from a supertype
    @Override
    ^
WordCountTopology.java:86: cannot find symbol
symbol  : class TopologyBuilder
location: class storm.starter.WordCountTopology
    TopologyBuilder builder = new TopologyBuilder();
    ^
WordCountTopology.java:86: cannot find symbol
symbol  : class TopologyBuilder
location: class storm.starter.WordCountTopology
    TopologyBuilder builder = new TopologyBuilder();
                                  ^
WordCountTopology.java:88: cannot find symbol
symbol  : class RandomSentenceSpout
location: class storm.starter.WordCountTopology
    builder.setSpout("spout", new RandomSentenceSpout(), 5).setNumTasks(7);
                                  ^
WordCountTopology.java:91: cannot find symbol
symbol  : class Fields
location: class storm.starter.WordCountTopology
    builder.setBolt("count", new WordCount(), 12).fieldsGrouping("split", new Fields("word"));
                                                                              ^
WordCountTopology.java:93: cannot find symbol
symbol  : class Config
location: class storm.starter.WordCountTopology
    Config conf = new Config();
    ^
WordCountTopology.java:93: cannot find symbol
symbol  : class Config
location: class storm.starter.WordCountTopology
    Config conf = new Config();
                      ^
WordCountTopology.java:100: cannot find symbol
symbol  : variable StormSubmitter
location: class storm.starter.WordCountTopology
      StormSubmitter.submitTopologyWithProgressBar(args[0], conf, builder.createTopology());
      ^
WordCountTopology.java:105: cannot find symbol
symbol  : class LocalCluster
location: class storm.starter.WordCountTopology
      LocalCluster cluster = new LocalCluster();
      ^
WordCountTopology.java:105: cannot find symbol
symbol  : class LocalCluster
location: class storm.starter.WordCountTopology
      LocalCluster cluster = new LocalCluster();
                                 ^
36 errors

何解?

正在回答

1 回答

没有导入storm相关的包

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
走进大数据之storm流式计算基础
  • 参与学习       26624    人
  • 解答问题       22    个

ApacheStorm的起源、原理、基础用法、集群搭建讲解

进入课程

WordCountTopology.java 缺少backType package

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信