public class UpgradeHelper extends Object
Constructor and Description |
---|
UpgradeHelper() |
Modifier and Type | Method and Description |
---|---|
List<UpgradeGroupHolder> |
createSequence(UpgradePack upgradePack,
UpgradeContext context)
Generates a list of UpgradeGroupHolder items that are used to execute either
an upgrade or a downgrade.
|
Resource |
getTaskResource(String clusterName,
Long requestId,
Long stageId,
Long taskId)
Get a single resource for the task with the given parameters.
|
void |
publishDesiredRepositoriesUpdates(UpgradeContext upgradeContext) |
UpgradePack |
suggestUpgradePack(String clusterName,
StackId sourceStackId,
StackId targetStackId,
Direction direction,
org.apache.ambari.spi.upgrade.UpgradeType upgradeType,
String preferredUpgradePackName)
Get right Upgrade Pack, depends on stack, direction and upgrade type
information
|
void |
updateDesiredRepositoriesAndConfigs(UpgradeContext upgradeContext)
Updates the various repositories and configurations for services
participating in the upgrade or downgrade.
|
public UpgradePack suggestUpgradePack(String clusterName, StackId sourceStackId, StackId targetStackId, Direction direction, org.apache.ambari.spi.upgrade.UpgradeType upgradeType, String preferredUpgradePackName) throws org.apache.ambari.server.AmbariException
clusterName
- The name of the clustersourceStackId
- the "from" stack for this upgrade/downgradetargetStackId
- the "to" stack for this upgrade/downgradedirection
- Direction
of the upgradeupgradeType
- The UpgradeType
preferredUpgradePackName
- For unit test, need to prefer an upgrade pack since multiple
matches can be found.UpgradeType
objectorg.apache.ambari.server.AmbariException
public List<UpgradeGroupHolder> createSequence(UpgradePack upgradePack, UpgradeContext context) throws org.apache.ambari.server.AmbariException
upgradePack
- the upgrade packcontext
- the context that wraps key fields required to perform an upgradeorg.apache.ambari.server.AmbariException
public Resource getTaskResource(String clusterName, Long requestId, Long stageId, Long taskId) throws UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException, SystemException
clusterName
- Cluster NamerequestId
- Request IdstageId
- Stage IdtaskId
- Task IdUnsupportedPropertyException
NoSuchResourceException
NoSuchParentResourceException
SystemException
public void updateDesiredRepositoriesAndConfigs(UpgradeContext upgradeContext) throws org.apache.ambari.server.AmbariException
UpgradeState
of every component host is moved to either
UpgradeState.IN_PROGRESS
or UpgradeState.NONE
.
upgradeContext
- the upgrade context holding all relevent upgrade information (not
null
).org.apache.ambari.server.AmbariException
public void publishDesiredRepositoriesUpdates(UpgradeContext upgradeContext) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariException
Copyright © 2022 Apache Software Foundation. All rights reserved.