HadoopDB GlobalHasher的参数问题


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 properties
		Path 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);
		

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章