0

I see that the Configuration class in Hadoop is writable http://hadoop.apache.org/docs/current/api/org/apache/hadoop/conf/Configuration.html. However, I do not see any of the methods that it has exposed that can be used to add a writable object (I see a lot of methods to set and get primitive types like int, long). Let us say, I have my own writable object and I want to add it to the configuration for all my mappers and reduces to use, how do I do this?

Thanks,

Venkat

4

2 に答える 2

1

この構成は、オブジェクト全体を渡すためのものではありません。Mappers/Reducer のセットアップに必要な単純なパラメーターを設定するには、構成をもっと使用する必要があります。ジョブの開始時に変数を設定するときに、conf を考えてください。構成の実行中に変更を加えた場合、実際にはデータを動的に渡すことを意図していないため、最後には変更されない可能性が高くなります。

ノード間でオブジェクト全体を渡したい場合に探しているのは、分散キャッシュです。技術的に言えば、これらはファイルですが、標準のオブジェクトのシリアル化を使用して追加できます。分散キャッシュについて

*異なるバージョンの Hadoop をリンクして申し訳ありません。それらのページは少し混乱していて、必要なものを見つけるのが難しい場合があります。

于 2013-05-20T03:34:56.410 に答える
1

You can check HBase sources (starting from HBase 0.94.6) MultiTableInputFormat.setConf() class method and appropriate TableMapReduceUtil code (for example .initTableMapperJob()). They pass Scan objects through configuration. Earlier TableInputFormat.setConf() class uses very similar mechanics. Usually only minimal attributes are passed through config but this is probably case closer to your one.

Hope it will help.

于 2013-05-25T14:42:47.853 に答える