Mahout 0.8维护笔记

本文介绍了 Apache Mahout 中分布式矩阵运算类 VectorMatrixMultiplicationJob 的优化过程,包括修改临时文件目录名称,以及在 BuildForest 和 Builder 类中对输出路径处理方式的改进。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(0)
类:
org.apache.mahout.clustering.spectral.common.VectorMatrixMultiplicationJob

方法:
public static DistributedRowMatrix runJob(Path markovPath, Vector diag, Path outputPath)
    throws IOException, ClassNotFoundException, InterruptedException

修改前语句:
return runJob(markovPath, diag, outputPath, new Path(outputPath, "tmp"));

修改后语句:
return runJob(markovPath, diag, outputPath, new Path(outputPath, "_tmp"));

(1)
类:
org.apache.mahout.classifier.df.mapreduce.BuildForest

方法:
private void buildForest() throws IOException, ClassNotFoundException, InterruptedException

修改前语句:
forestBuilder.setOutputDirName(outputPath.getName());

修改后语句:
forestBuilder.setOutputDirName(outputPath.toString());

(2)
类:
org.apache.mahout.classifier.df.mapreduce.Builder

方法:
public Path getOutputPath(Configuration conf) throws IOException

修改前语句:
FileSystem fs = FileSystem.get(conf);
return new Path(fs.getWorkingDirectory(), outputDirName);

修改后语句:
FileSystem fs = FileSystem.get(conf);
return fs.makeQualified(new Path(outputDirName));
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值