use of org.apache.hadoop.hdfs.util.DataTransferThrottler in project hadoop by apache.
the class ImageServlet method getThrottler.
/**
* Construct a throttler from conf
* @param conf configuration
* @return a data transfer throttler
*/
public static DataTransferThrottler getThrottler(Configuration conf) {
long transferBandwidth = conf.getLong(DFSConfigKeys.DFS_IMAGE_TRANSFER_RATE_KEY, DFSConfigKeys.DFS_IMAGE_TRANSFER_RATE_DEFAULT);
DataTransferThrottler throttler = null;
if (transferBandwidth > 0) {
throttler = new DataTransferThrottler(transferBandwidth);
}
return throttler;
}
Aggregations