org.apache.hadoop.hdfs.server.protocol
Class BalancerBandwidthCommand

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.protocol.ServerCommand
      extended by org.apache.hadoop.hdfs.server.protocol.DatanodeCommand
          extended by org.apache.hadoop.hdfs.server.protocol.BalancerBandwidthCommand
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class BalancerBandwidthCommand
extends org.apache.hadoop.hdfs.server.protocol.DatanodeCommand

Balancer bandwidth command instructs each datanode to change its value for the max amount of network bandwidth it may use during the block balancing operation. The Balancer Bandwidth Command contains the new bandwidth value as its payload. The bandwidth value is in bytes per second.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.protocol.DatanodeCommand
DatanodeCommand.Finalize
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hdfs.server.protocol.DatanodeCommand
REGISTER
 
Constructor Summary
BalancerBandwidthCommand(long bandwidth)
          Balancer Bandwidth Command constructor.
 
Method Summary
 long getBalancerBandwidthValue()
          Get current value of the max balancer bandwidth in bytes per second.
 void readFields(DataInput in)
          Reads the bandwidth payload from the Balancer Bandwidth Command packet.
 void write(DataOutput out)
          Writes the bandwidth payload to the Balancer Bandwidth Command packet.
 
Methods inherited from class org.apache.hadoop.hdfs.server.protocol.ServerCommand
getAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BalancerBandwidthCommand

public BalancerBandwidthCommand(long bandwidth)
Balancer Bandwidth Command constructor.

Parameters:
bandwidth - Blanacer bandwidth in bytes per second.
Method Detail

getBalancerBandwidthValue

public long getBalancerBandwidthValue()
Get current value of the max balancer bandwidth in bytes per second.

Returns:
bandwidth Blanacer bandwidth in bytes per second for this datanode.

write

public void write(DataOutput out)
           throws IOException
Writes the bandwidth payload to the Balancer Bandwidth Command packet.

Specified by:
write in interface org.apache.hadoop.io.Writable
Overrides:
write in class org.apache.hadoop.hdfs.server.protocol.ServerCommand
Parameters:
out - DataOutput stream used for writing commands to the datanode.
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Reads the bandwidth payload from the Balancer Bandwidth Command packet.

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class org.apache.hadoop.hdfs.server.protocol.ServerCommand
Parameters:
in - DataInput stream used for reading commands to the datanode.
Throws:
IOException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.