本文整理汇总了Java中org.apache.hadoop.hdfs.server.balancer.Balancer类的典型用法代码示例。如果您正苦于以下问题:Java Balancer类的具体用法?Java Balancer怎么用?Java Balancer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Balancer类属于org.apache.hadoop.hdfs.server.balancer包,在下文中一共展示了Balancer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DataXceiverServer
import org.apache.hadoop.hdfs.server.balancer.Balancer; //导入依赖的package包/类
DataXceiverServer(ServerSocket ss, Configuration conf,
DataNode datanode) {
this.ss = ss;
this.datanode = datanode;
this.maxXceiverCount = conf.getInt("dfs.datanode.max.xcievers",
MAX_XCEIVER_COUNT);
this.estimateBlockSize = conf.getLong("dfs.block.size", DEFAULT_BLOCK_SIZE);
//set up parameter for cluster balancing
this.balanceThrottler = new BlockBalanceThrottler(
conf.getLong("dfs.balance.bandwidthPerSec", 1024L*1024),
Math.max(Balancer.MAX_NUM_CONCURRENT_MOVES,
conf.getInt("dfs.balance.maxNumThreads",
Balancer.MAX_NUM_CONCURRENT_MOVES)));
}
示例2: acquire
import org.apache.hadoop.hdfs.server.balancer.Balancer; //导入依赖的package包/类
/** Check if the block move can start.
*
* Return true if the thread quota is not exceeded and
* the counter is incremented; False otherwise.
*/
synchronized boolean acquire() {
if (numThreads >= Balancer.MAX_NUM_CONCURRENT_MOVES) {
return false;
}
numThreads++;
return true;
}
示例3: acquire
import org.apache.hadoop.hdfs.server.balancer.Balancer; //导入依赖的package包/类
/**
* Check if the block move can start.
* <p/>
* Return true if the thread quota is not exceeded and
* the counter is incremented; False otherwise.
*/
synchronized boolean acquire() {
if (numThreads >= Balancer.MAX_NUM_CONCURRENT_MOVES) {
return false;
}
numThreads++;
return true;
}