@Test public void testNoAutoSkipFailure() throws Exception { Map<String, UpgradePack> upgrades = ambariMetaInfo.getUpgradePacks("HDP", "2.2.0"); UpgradePack upgradePack = upgrades.get("upgrade_test_skip_failures"); List<Grouping> groups = upgradePack.getGroups(Direction.UPGRADE); for (Grouping grouping : groups) { if (grouping.name.equals("SKIPPABLE_BUT_NOT_AUTO_SKIPPABLE")) { Assert.assertFalse(grouping.supportsAutoSkipOnFailure); } else { Assert.assertTrue(grouping.supportsAutoSkipOnFailure); } } }
public List<Grouping> getGroups(Direction direction) { List<Grouping> list = new ArrayList<Grouping>(); if (direction.isUpgrade()) { list = groups; } else { switch (type) { case NON_ROLLING: list = getDowngradeGroupsForNonrolling(); break; case HOST_ORDERED: case ROLLING: default: list = getDowngradeGroupsForRolling(); break; } } List<Grouping> checked = new ArrayList<Grouping>(); for (Grouping group : list) { if (null == group.intendedDirection || direction == group.intendedDirection) { checked.add(group); } } return checked; }
UpgradePack { public List<Grouping> getGroups(Direction direction) { List<Grouping> list = new ArrayList<Grouping>(); if (direction.isUpgrade()) { list = groups; } else { switch (type) { case NON_ROLLING: list = getDowngradeGroupsForNonrolling(); break; case HOST_ORDERED: case ROLLING: default: list = getDowngradeGroupsForRolling(); break; } } List<Grouping> checked = new ArrayList<Grouping>(); for (Grouping group : list) { if (null == group.intendedDirection || direction == group.intendedDirection) { checked.add(group); } } return checked; } }
UpgradePack { public List<Grouping> getGroups(Direction direction) { List<Grouping> list = new ArrayList<Grouping>(); if (direction.isUpgrade()) { list = groups; } else { switch (type) { case NON_ROLLING: list = getDowngradeGroupsForNonrolling(); break; case HOST_ORDERED: case ROLLING: default: list = getDowngradeGroupsForRolling(); break; } } List<Grouping> checked = new ArrayList<Grouping>(); for (Grouping group : list) { if (null == group.intendedDirection || direction == group.intendedDirection) { checked.add(group); } } return checked; }  }
UpgradePack { public List<Grouping> getGroups(Direction direction) { List<Grouping> list = new ArrayList<Grouping>(); if (direction.isUpgrade()) { list = groups; } else { switch (type) { case NON_ROLLING: list = getDowngradeGroupsForNonrolling(); break; case HOST_ORDERED: case ROLLING: default: list = getDowngradeGroupsForRolling(); break; } } List<Grouping> checked = new ArrayList<Grouping>(); for (Grouping group : list) { if (null == group.intendedDirection || direction == group.intendedDirection) { checked.add(group); } } return checked; }  String getName(); void setName(String name); String getTarget(); UpgradeType getType(); List<String> getPrerequisiteChecks(); PrerequisiteCheckConfig getPrerequisiteCheckConfig(); void mergePrerequisiteChecks(UpgradePack pack); void mergeProcessing(UpgradePack pack); List<IntermediateStack> getIntermediateStacks(); String getTargetStack(); boolean isComponentFailureAutoSkipped(); boolean isServiceCheckFailureAutoSkipped(); List<Grouping> getAllGroups(); List<Grouping> getGroups(Direction direction); boolean isDowngradeAllowed(); boolean canBeApplied(String targetVersion); Map<String, Map<String, ProcessingComponent>> getTasks(); boolean isAllTarget(); }
UpgradePack { public List<Grouping> getGroups(Direction direction) { List<Grouping> list = new ArrayList<Grouping>(); if (direction.isUpgrade()) { list = groups; } else { switch (type) { case NON_ROLLING: list = getDowngradeGroupsForNonrolling(); break; case HOST_ORDERED: case ROLLING: default: list = getDowngradeGroupsForRolling(); break; } } List<Grouping> checked = new ArrayList<Grouping>(); for (Grouping group : list) { if (null == group.intendedDirection || direction == group.intendedDirection) { checked.add(group); } } return checked; }  String getName(); void setName(String name); String getTarget(); UpgradeType getType(); List<String> getPrerequisiteChecks(); PrerequisiteCheckConfig getPrerequisiteCheckConfig(); void mergePrerequisiteChecks(UpgradePack pack); void mergeProcessing(UpgradePack pack); List<IntermediateStack> getIntermediateStacks(); String getTargetStack(); boolean isComponentFailureAutoSkipped(); boolean isServiceCheckFailureAutoSkipped(); List<Grouping> getAllGroups(); List<Grouping> getGroups(Direction direction); boolean isDowngradeAllowed(); boolean canBeApplied(String targetVersion); Map<String, Map<String, ProcessingComponent>> getTasks(); boolean isAllTarget();  }