hadoop jar命令类名区分大小写吗?

xmjla07d  于 2021-06-03  发布在  Hadoop
关注(0)|答案(2)|浏览(439)

我最近刚开始学习hadoop1.1.2。
当我开始运行wordcount案例时,这两种代码都很好。
命令a:

hadoop jar /usr/local/hadoop/hadoop-examples-1.1.2.jar WordCount input output

命令b:

hadoop jar /usr/local/hadoop/hadoop-examples-1.1.2.jar wordcount input output

唯一的区别是主类名 wordcount .
所以我的问题是天气主类名 wordcount 默认情况下是否不区分大小写?
更新:
@阿马尔说 WordCount 不会好用的,我已经检查过他是对的。我被这里的文件误导了。官方文件需要更新。
但我还是不知道为什么 wordcount .

tvmytwxo

tvmytwxo1#

试着不穿衣服跑步 wordcount ,例如: hadoop jar /usr/local/hadoop/hadoop-examples-1.1.2.jar input output 您将收到如下信息:

Unknown program 'input' chosen.
Valid program names are:
  aggregatewordcount: An Aggregate based map/reduce program that counts the words in the input files.
  aggregatewordhist: An Aggregate based map/reduce program that computes the histogram of the words in the input files.
  dbcount: An example job that count the pageview counts from a database.
  grep: A map/reduce program that counts the matches of a regex in the input.
  join: A job that effects a join over sorted, equally partitioned datasets
  multifilewc: A job that counts words from several files.
  pentomino: A map/reduce tile laying program to find solutions to pentomino problems.
  pi: A map/reduce program that estimates Pi using monte-carlo method.
  randomtextwriter: A map/reduce program that writes 10GB of random textual data per node.
  randomwriter: A map/reduce program that writes 10GB of random data per node.
  secondarysort: An example defining a secondary sort to the reduce.
  sleep: A job that sleeps at each map and reduce task.
  sort: A map/reduce program that sorts the data written by the random writer.
  sudoku: A sudoku solver.
  teragen: Generate data for the terasort
  terasort: Run the terasort
  teravalidate: Checking results of terasort
  wordcount: A map/reduce program that counts the words in the input files.

因此,基本上第一个参数不是主类名,而是要运行的示例程序的名称。
所以,它甚至不应该接受 WordCount 不是给我的。以下命令的结果与上面显示的相同: bin/hadoop jar hadoop-examples-1.0.4.jar WordCount LICENSE.txt output 仅供参考:主类已经在 META-INF/MANIFEST.MF jar中包含的文件: Main-Class: org/apache/hadoop/examples/ExampleDriver

rjzwgtxy

rjzwgtxy2#

它当然是区分大小写的,因为它试图加载类 WordCount 或者 wordcount 从jar里,取决于外壳。因为java在这方面是区分大小写的,所以它也是 hadoop jar .

相关问题