org.apache.hadoop.dfs
Interface Upgradeable

All Superinterfaces:
Comparable<Upgradeable>

public interface Upgradeable
extends Comparable<Upgradeable>

Common interface for distributed upgrade objects. Each upgrade object corresponds to a layout version, which is the latest version that should be upgraded using this object. That is all components whose layout version is greater or equal to the one returned by getVersion() must be upgraded with this object.


Method Summary
 org.apache.hadoop.dfs.UpgradeCommand completeUpgrade()
          Complete upgrade.
 String getDescription()
          Description of the upgrade object for displaying.
 FSConstants.NodeType getType()
          Get the type of the software component, which this object is upgrading.
 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 getVersion()
          Get the layout version of the upgrade object.
 org.apache.hadoop.dfs.UpgradeCommand startUpgrade()
          Prepare for the upgrade.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getVersion

int getVersion()
Get the layout version of the upgrade object.

Returns:
layout version

getType

FSConstants.NodeType getType()
Get the type of the software component, which this object is upgrading.

Returns:
type

getDescription

String getDescription()
Description of the upgrade object for displaying.

Returns:
description

getUpgradeStatus

short getUpgradeStatus()
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.

Returns:
integer value in the range [0, 100].

startUpgrade

org.apache.hadoop.dfs.UpgradeCommand startUpgrade()
                                                  throws IOException
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

completeUpgrade

org.apache.hadoop.dfs.UpgradeCommand completeUpgrade()
                                                     throws IOException
Complete upgrade. E.g. cleanup upgrade data structures or write metadata to disk. Returns an upgrade command that is used for broadcasting to other cluster components. E.g. data-nodes inform the name-node that they completed the upgrade while other data-nodes are still upgrading.

Throws:
IOException

getUpgradeStatusReport

UpgradeStatusReport getUpgradeStatusReport(boolean details)
                                           throws IOException
Get status report for the upgrade.

Parameters:
details - true if upgradeStatus details need to be included, false otherwise
Returns:
UpgradeStatusReport
Throws:
IOException


Copyright © 2008 The Apache Software Foundation