摘要: hadoop中用该类来控制对于数据的处理速度 ,主要思想如下:1、将数据处理分为一个个的周期(period)2、每个周期内处理的bytes固定 。3、定义每次处理周期的开始时间 。4、每次处处理完后调用BlockTransferThrottler.throttle(long numOfBytes)方法,若是还未到周期的结束时间,已经将处理了相应的bytes,则该线程wait 。代码以及注视如下:package org.apache.hadoop.hdfs.server.datanode;/** * a class to throttle the block transfers. * This. 阅读全文
posted @ 2012-03-03 20:27 xiao晓 阅读(703) 评论(0) 推荐(0) 编辑