org.apache.hadoop.hdfs.server.namenode
Class UpgradeObjectNamenode

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

@InterfaceAudience.Private
public abstract class UpgradeObjectNamenode
extends UpgradeObject

Base class for name-node upgrade objects. Data-node upgrades are run in separate threads.


Field Summary
 
Fields inherited from class org.apache.hadoop.hdfs.server.common.UpgradeObject
status
 
Constructor Summary
UpgradeObjectNamenode()
           
 
Method Summary
 void forceProceed()
           
 HdfsConstants.NodeType getType()
          Get the type of the software component, which this object is upgrading.
abstract  UpgradeCommand processUpgradeCommand(UpgradeCommand command)
          Process an upgrade command.
 UpgradeCommand startUpgrade()
          Prepare for the upgrade.
 
Methods inherited from class org.apache.hadoop.hdfs.server.common.UpgradeObject
compareTo, equals, getDescription, getUpgradeStatus, getUpgradeStatusReport, 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, getVersion
 

Constructor Detail

UpgradeObjectNamenode

public UpgradeObjectNamenode()
Method Detail

processUpgradeCommand

public abstract UpgradeCommand processUpgradeCommand(UpgradeCommand command)
                                              throws IOException
Process an upgrade command. RPC has only one very generic command for all upgrade related inter component communications. The actual command recognition and execution should be handled here. The reply is sent back also as an UpgradeCommand.

Parameters:
command -
Returns:
the reply command which is analyzed on the client side.
Throws:
IOException

getType

public HdfsConstants.NodeType getType()
Description copied from interface: Upgradeable
Get the type of the software component, which this object is upgrading.

Returns:
type

startUpgrade

public UpgradeCommand startUpgrade()
                            throws IOException
Description copied from interface: Upgradeable
Prepare for the upgrade. E.g. initialize upgrade data structures and set status to 0. Returns an upgrade command that is used for broadcasting to other cluster components. E.g. name-node informs data-nodes that they must perform a distributed upgrade.

Returns:
an UpgradeCommand for broadcasting.
Throws:
IOException

forceProceed

public void forceProceed()
                  throws IOException
Throws:
IOException


Copyright © 2009 The Apache Software Foundation