2011-03-07 15 views
2

処理ログ用に単純なMapReduceプロジェクトをHadoopに実装しました。入力パスは、ログがあるディレクトリです。Hadoop Mapperクラスの入力パスを取得

これはうまく動作しますが、Mapperを実装しているクラスでいつでもログの入力パスがどのように処理されているかを知りたいと思います。 Mapperコードは次のとおりです。

public class StatsMapper extends MapReduceBase implements Mapper<WritableComparable<Text>,Text,Text,Text> { 

    public static final Log LOG = LogFactory.getLog(StatsMapper.class); 

    public void configure(JobConf conf) {} 

    public void map(WritableComparable<Text> key, Text value, OutputCollector<Text,Text> output, Reporter reporter) 
      throws IOException { 

     process(key,value); 

    } 

} 

事前

+0

を読んRecordReaderオブジェクトのファクトリを提供します タスクにファイルを分割InputSplitsを定義します「ログの入力パスがどのように処理されているか」はどういう意味ですか? –

答えて

2

おかげでのInputFormatセクションこれらの入力ファイルが分割されているとのInputFormatによって定義される読み出し方法here

をお読みください。 InputFormatは、以下の機能を提供するクラスです: が入力 ために使用されるべきファイルやその他のオブジェクトを選択し、ファイルに

+0

ありがとう、それはまさに私が探していたものです;) – supersoft

関連する問題