zoukankan      html  css  js  c++  java
  • 报错org.apache.hadoop.mapreduce.lib.input.FileSplit cannot be cast to org.apache.hadoop.mapred.FileSplit

    报错

    java.lang.Exception: java.lang.ClassCastException: org.apache.hadoop.mapreduce.lib.input.FileSplit cannot be cast to org.apache.hadoop.mapred.FileSplit
        at org.apache.hadoop.mapred.LocalJobRunner$Job.runTasks(LocalJobRunner.java:462)
        at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:522)
    Caused by: java.lang.ClassCastException: org.apache.hadoop.mapreduce.lib.input.FileSplit cannot be cast to org.apache.hadoop.mapred.FileSplit
        at InvertedIndex$Map.map(InvertedIndex.java:34)
        at InvertedIndex$Map.map(InvertedIndex.java:1)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
        at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:243)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    2017-03-15 22:10:51,418 INFO [org.apache.hadoop.mapreduce.Job] - Job job_local1575636680_0001 running in uber mode : false
    2017-03-15 22:10:51,419 INFO [org.apache.hadoop.mapreduce.Job] -  map 0% reduce 0%
    2017-03-15 22:10:51,421 INFO [org.apache.hadoop.mapreduce.Job] - Job job_local1575636680_0001 failed with state FAILED due to: NA
    2017-03-15 22:10:51,427 INFO [org.apache.hadoop.mapreduce.Job] - Counters: 0


    import java.io.IOException;
    import java.util.StringTokenizer;
    import org.apache.hadoop.conf.Configuration;
    import org.apache.hadoop.fs.Path;
    import org.apache.hadoop.io.Text;
    import org.apache.hadoop.mapreduce.Job;
    import org.apache.hadoop.mapreduce.Mapper;
    import org.apache.hadoop.mapreduce.Reducer;
    import org.apache.hadoop.mapred.FileSplit;
    import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
    import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

    将颜色部分改为 import org.apache.hadoop.mapreduce.lib.input.FileSplit;


  • 相关阅读:
    SpringAOP--动态数据源
    SpringAOP--代理
    SpringAOP--aop使用
    Kafka03--Kafka消费者使用方式
    Kafka02--Kafka生产者简要原理
    Kafka01--Kafka生产者使用方式
    SpringBoot中的日志使用:
    LCS&&LRC&&LIS问题
    解决Idea.exe无法启动问题(idea2017.3版本)
    七牛云简单实用-uploadManager.put(..)抛出异常
  • 原文地址:https://www.cnblogs.com/tk55/p/6557007.html
Copyright © 2011-2022 走看看