mahout:无法转换为序列文件

xbp102n0  于 2021-06-04  发布在  Hadoop
关注(0)|答案(2)|浏览(432)

我想把一些文本文件转换成mahout序列文件。我也是

mahout seqdirectory -i inputFolder -o outputFolder

但我总是有例外

java.lang.Exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:403)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.hadoop.mapreduce.lib.input.CombineFileRecordReader.initNextRecordReader(CombineFileRecordReader.java:164)
    at org.apache.hadoop.mapreduce.lib.input.CombineFileRecordReader.<init>(CombineFileRecordReader.java:126)
    at org.apache.mahout.text.MultipleTextFileInputFormat.createRecordReader(MultipleTextFileInputFormat.java:43)
    at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.<init>(MapTask.java:491)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:734)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:339)
    at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:235)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.apache.hadoop.mapreduce.lib.input.CombineFileRecordReader.initNextRecordReader(CombineFileRecordReader.java:155)
    ... 11 more
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.TaskAttemptContext, but class was expected
    at org.apache.mahout.text.WholeFileRecordReader.<init>(WholeFileRecordReader.java:52)
    ... 16 more

我正在hadoop2.2.0上运行mahout 0.8
有什么想法吗?

lyfkaqu1

lyfkaqu11#

当我读到mahout 0.8与hadoop1.2一起工作时。我只下载了mahout(它使用lib/hadoop中的hadoopjar)

k2fxgqgv

k2fxgqgv2#

前面的答案不正确。mahout 0.8有一个seqdirectory的mapreduce版本,这是一个新特性。mr版本中的一个bug导致了您看到的异常。
要使用mahout 0.8执行seqdirectory,请通过在命令行中指定-xm sequential选项来使用sequential版本。

mahout seqdirectory -i inputFolder -o outputFolder -xm sequential

默认情况下,如果没有指定,seqdirectory将执行mr版本。
这个问题已经在mahout 0.9中修复了。

相关问题