org.apache.hadoop.dfs
Class UpgradeStatusReport

java.lang.Object
  extended by org.apache.hadoop.dfs.UpgradeStatusReport
All Implemented Interfaces:
Writable

public class UpgradeStatusReport
extends Object
implements Writable

Base upgrade upgradeStatus class. Overload this class if specific status fields need to be reported. Describes status of current upgrade.


Field Summary
protected  short upgradeStatus
           
protected  int version
           
 
Constructor Summary
UpgradeStatusReport()
           
UpgradeStatusReport(int version, short status)
           
 
Method Summary
 String getStatusText(boolean details)
          Get upgradeStatus data as a text for reporting.
 short getUpgradeStatus()
          Get upgrade upgradeStatus as a percentage of the total upgrade done.
 int getVersion()
          Get the layout version of the currently running upgrade.
 void readFields(DataInput in)
          Reads the fields of this object from in.
 String toString()
          Print basic upgradeStatus details.
 void write(DataOutput out)
          Writes the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

version

protected int version

upgradeStatus

protected short upgradeStatus
Constructor Detail

UpgradeStatusReport

public UpgradeStatusReport()

UpgradeStatusReport

public UpgradeStatusReport(int version,
                           short status)
Method Detail

getVersion

public int getVersion()
Get the layout version of the currently running upgrade.

Returns:
layout version

getUpgradeStatus

public short getUpgradeStatus()
Get upgrade upgradeStatus as a percentage of the total upgrade done.

See Also:
Upgradeable.getUpgradeStatus()

getStatusText

public String getStatusText(boolean details)
Get upgradeStatus data as a text for reporting. Should be overloaded for a particular upgrade specific upgradeStatus data.

Parameters:
details - true if upgradeStatus details need to be included, false otherwise
Returns:
text

toString

public String toString()
Print basic upgradeStatus details.

Overrides:
toString in class Object

write

public void write(DataOutput out)
           throws IOException
Description copied from interface: Writable
Writes the fields of this object to out.

Specified by:
write in interface Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from interface: Writable
Reads the fields of this object from in. For efficiency, implementations should attempt to re-use storage in the existing object where possible.

Specified by:
readFields in interface Writable
Throws:
IOException


Copyright © 2006 The Apache Software Foundation