HadoopDB GlobalHasher的参数问题

来源:互联网 发布:知天下图 编辑:程序博客网 时间:2024/05/21 17:48


hadoop jar hadoopdb.jar edu.yale.cs.hadoopdb.dataloader.GlobalHasher input_path output_path 10 \| 0
上面的命令是将数据切分到10个分区内,即集群中的10个结点,最后的参数 0是指对每行记录的第一个字段进行hash,可将其视作键值。


下面是edu.yale.cs.hadoopdb.dataloader.GlobalHasher类中的一段代码,可以看到

该全局hasher要求输入四个参数

//输入 目录FileInputFormat.setInputPaths(conf, new Path(args[0]));// OUTPUT propertiesPath outputPath = new Path(args[1]);HDFSUtil.deletePath(outputPath);FileOutputFormat.setOutputPath(conf, outputPath);//分区数量int partNo = Integer.parseInt(args[2]);conf.setNumReduceTasks(partNo);//分界符conf.set(DELIMITER_PARAM, args[3]);//要hash的字段位置int hashFieldPos = Integer.parseInt(args[4]);conf.setInt(HASH_FIELD_POS_PARAM, hashFieldPos);

原创粉丝点击