Search in sources :

Example 6 with DataTransferThrottler

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;
}
Also used : DataTransferThrottler(org.apache.hadoop.hdfs.util.DataTransferThrottler)

Aggregations

DataTransferThrottler (org.apache.hadoop.hdfs.util.DataTransferThrottler)6 Configuration (org.apache.hadoop.conf.Configuration)3 ServletContext (javax.servlet.ServletContext)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 HdfsConfiguration (org.apache.hadoop.hdfs.HdfsConfiguration)1 FileJournalManager (org.apache.hadoop.hdfs.server.namenode.FileJournalManager)1 EditLogFile (org.apache.hadoop.hdfs.server.namenode.FileJournalManager.EditLogFile)1 NameNodeFile (org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeFile)1 NameNodeMetrics (org.apache.hadoop.hdfs.server.namenode.metrics.NameNodeMetrics)1 Test (org.junit.Test)1