Java Code Examples for org.apache.hadoop.conf.Configuration.getLongBytes()

The following are Jave code examples for showing how to use getLongBytes() of the org.apache.hadoop.conf.Configuration class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: hadoop   File: DataXceiverServer.java   Source Code and License Vote up 6 votes
DataXceiverServer(PeerServer peerServer, Configuration conf,
    DataNode datanode) {
  
  this.peerServer = peerServer;
  this.datanode = datanode;
  
  this.maxXceiverCount = 
    conf.getInt(DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_KEY,
                DFSConfigKeys.DFS_DATANODE_MAX_RECEIVER_THREADS_DEFAULT);
  
  this.estimateBlockSize = conf.getLongBytes(DFSConfigKeys.DFS_BLOCK_SIZE_KEY,
      DFSConfigKeys.DFS_BLOCK_SIZE_DEFAULT);
  
  //set up parameter for cluster balancing
  this.balanceThrottler = new BlockBalanceThrottler(
      conf.getLong(DFSConfigKeys.DFS_DATANODE_BALANCE_BANDWIDTHPERSEC_KEY,
          DFSConfigKeys.DFS_DATANODE_BALANCE_BANDWIDTHPERSEC_DEFAULT),
      conf.getInt(DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_KEY,
          DFSConfigKeys.DFS_DATANODE_BALANCE_MAX_NUM_CONCURRENT_MOVES_DEFAULT));
}
 
Example 2
Project: hadoop   File: BlockSizeParam.java   Source Code and License Vote up 4 votes
/** @return the value or, if it is null, return the default from conf. */
public long getValue(final Configuration conf) {
  return getValue() != null? getValue()
      : conf.getLongBytes(DFS_BLOCK_SIZE_KEY, DFS_BLOCK_SIZE_DEFAULT);
}