課程
/云計算&大數(shù)據(jù)
/Hadoop
/Hadoop進階
請問有源代碼嗎?
2018-05-15
源自:Hadoop進階 3-4
正在回答
出現(xiàn)了java.io.FileNotFoundException: matrix2 的錯誤
?修改mapper2
@Override
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
//通過輸入流將全局緩存變量中的 右側(cè)矩陣 讀入List<String>中
Configuration conf = context.getConfiguration();
? ? ??
FileSystem fs = FileSystem.get(conf);
FSDataInputStream in = fs.open(new Path("/matrix/step1_output/part-r-00000"));
? ? ? ? //FileReader fr = new FileReader(itermOccurrenceMatrix);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
//每一行的格式是: 行 tab 列_值,列_值,列_值,列_值
String line = null;
while((line = br.readLine())!=null) {
cacheList.add(line);
}
in.close();
br.close();
hyonline_ 提問者
陸米 回復 hyonline_ 提問者
tql,就是有點搞不懂為什么原來不行
能行。
舉報
MapReduce原理,并實現(xiàn)簡單的推薦
2 回答找不到matrix2
3 回答job.addCacheArchive找不到該method
4 回答FileReader無法找到緩存文件
1 回答顯示運行失敗該怎么找錯
3 回答藍色和綠色是兩種不同的key值,為什么會進到同一個parition (2-3 Map-Shuffle-Reduce)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2018-05-16
出現(xiàn)了java.io.FileNotFoundException: matrix2 的錯誤
?修改mapper2
@Override
protected void setup(Context context) throws IOException, InterruptedException {
super.setup(context);
//通過輸入流將全局緩存變量中的 右側(cè)矩陣 讀入List<String>中
Configuration conf = context.getConfiguration();
? ? ??
FileSystem fs = FileSystem.get(conf);
FSDataInputStream in = fs.open(new Path("/matrix/step1_output/part-r-00000"));
? ? ? ? //FileReader fr = new FileReader(itermOccurrenceMatrix);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
//每一行的格式是: 行 tab 列_值,列_值,列_值,列_值
String line = null;
while((line = br.readLine())!=null) {
cacheList.add(line);
}
in.close();
br.close();
}
2019-05-21
tql,就是有點搞不懂為什么原來不行
2018-05-19
能行。