org.apache.hadoop.hdfs.server.common
Class UpgradeObject

java.lang.Object
  extended by org.apache.hadoop.hdfs.server.common.UpgradeObject
All Implemented Interfaces:
Comparable<Upgradeable>, Upgradeable
Direct Known Subclasses:
UpgradeObjectDatanode, UpgradeObjectNamenode

@InterfaceAudience.Private
public abstract class UpgradeObject
extends Object
implements Upgradeable

Abstract upgrade object. Contains default implementation of common methods of Upgradeable interface.


Field Summary
protected  short status
           
 
Constructor Summary
UpgradeObject()
           
 
Method Summary
 int compareTo(Upgradeable o)
           
 boolean equals(Object o)
           
 String getDescription()
          Description of the upgrade object for displaying.
 short getUpgradeStatus()
          Upgrade status determines a percentage of the work done out of the total amount required by the upgrade.
 UpgradeStatusReport getUpgradeStatusReport(boolean details)
          Get status report for the upgrade.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hdfs.server.common.Upgradeable
completeUpgrade, getType, getVersion, startUpgrade
 

Field Detail

status

protected short status
Constructor Detail

UpgradeObject

public UpgradeObject()
Method Detail

getUpgradeStatus

public short getUpgradeStatus()
Description copied from interface: Upgradeable
Upgrade status determines a percentage of the work done out of the total amount required by the upgrade. 100% means that the upgrade is completed. Any value < 100 means it is not complete. The return value should provide at least 2 values, e.g. 0 and 100.

Specified by:
getUpgradeStatus in interface Upgradeable
Returns:
integer value in the range [0, 100].

getDescription

public String getDescription()
Description copied from interface: Upgradeable
Description of the upgrade object for displaying.

Specified by:
getDescription in interface Upgradeable
Returns:
description

getUpgradeStatusReport

public UpgradeStatusReport getUpgradeStatusReport(boolean details)
                                           throws IOException
Description copied from interface: Upgradeable
Get status report for the upgrade.

Specified by:
getUpgradeStatusReport in interface Upgradeable
Parameters:
details - true if upgradeStatus details need to be included, false otherwise
Returns:
UpgradeStatusReport
Throws:
IOException

compareTo

public int compareTo(Upgradeable o)
Specified by:
compareTo in interface Comparable<Upgradeable>

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009 The Apache Software Foundation