4
我試圖在DistributedCache
上存儲TreeSet
以供Hadoop map-reduce作業使用。到目前爲止,我已經在添加從HDFS文件到DistributedCache
如下:在Hadoop DistributedCache上存儲TreeSet
Configuration conf = new Configuration();
DistributedCache.addCacheFile(new URI("/my/cache/path"), conf);
Job job = new Job(conf, "my job");
// Proceed with remainder of Hadoop map-reduce job set-up and running
如何有效地增加一個TreeSet(我已經在此建類)這個文件,我增加了DistributedCache ?我應該使用Java的本地串行化以某種方式將其序列化到文件上嗎?
請注意,TreeSet是在啓動map-reduce作業的主類中構建的。 TreeSet永遠不會被修改,我只是希望每個映射器都具有對此TreeSet的只讀訪問權限,而無需一遍又一遍地重建它。