@Test public void testIsTopologyRefreshRequired() throws Exception { AmbariCustomCommandExecutionHelper helper = injector.getInstance(AmbariCustomCommandExecutionHelper.class); createClusterFixture("c2", "HDP-2.1.1", "c2"); Assert.assertTrue(helper.isTopologyRefreshRequired("START", "c2", "HDFS")); Assert.assertTrue(helper.isTopologyRefreshRequired("RESTART", "c2", "HDFS")); Assert.assertFalse(helper.isTopologyRefreshRequired("STOP", "c2", "HDFS")); }
public boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName) throws AmbariException { if (actionName.equals(START_COMMAND_NAME) || actionName.equals(RESTART_COMMAND_NAME)) { Cluster cluster = clusters.getCluster(clusterName); StackId stackId = cluster.getDesiredStackVersion(); AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo(); StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (stack != null) { ServiceInfo serviceInfo = stack.getService(serviceName); if (serviceInfo != null) { Boolean restartRequiredAfterRackChange = serviceInfo.isRestartRequiredAfterRackChange(); if (restartRequiredAfterRackChange != null && restartRequiredAfterRackChange) { return true; } } } } return false; }
AmbariCustomCommandExecutionHelper { public boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName) throws AmbariException { if (actionName.equals(START_COMMAND_NAME) || actionName.equals(RESTART_COMMAND_NAME)) { Cluster cluster = clusters.getCluster(clusterName); StackId stackId = cluster.getDesiredStackVersion(); AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo(); StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (stack != null) { ServiceInfo serviceInfo = stack.getService(serviceName); if (serviceInfo != null) { Boolean restartRequiredAfterRackChange = serviceInfo.isRestartRequiredAfterRackChange(); if (restartRequiredAfterRackChange != null && restartRequiredAfterRackChange) { return true; } } } } return false; } }
AmbariCustomCommandExecutionHelper { public boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName) throws AmbariException { if (actionName.equals(START_COMMAND_NAME) || actionName.equals(RESTART_COMMAND_NAME)) { Cluster cluster = clusters.getCluster(clusterName); StackId stackId = cluster.getDesiredStackVersion(); AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo(); StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (stack != null) { ServiceInfo serviceInfo = stack.getService(serviceName); if (serviceInfo != null) { Boolean restartRequiredAfterRackChange = serviceInfo.isRestartRequiredAfterRackChange(); if (restartRequiredAfterRackChange != null && restartRequiredAfterRackChange) { return true; } } } } return false; }  }
AmbariCustomCommandExecutionHelper { public boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName) throws AmbariException { if (actionName.equals(START_COMMAND_NAME) || actionName.equals(RESTART_COMMAND_NAME)) { Cluster cluster = clusters.getCluster(clusterName); StackId stackId = cluster.getDesiredStackVersion(); AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo(); StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (stack != null) { ServiceInfo serviceInfo = stack.getService(serviceName); if (serviceInfo != null) { Boolean restartRequiredAfterRackChange = serviceInfo.isRestartRequiredAfterRackChange(); if (restartRequiredAfterRackChange != null && restartRequiredAfterRackChange) { return true; } } } } return false; }  void addServiceCheckAction(Stage stage, String hostname, String smokeTestRole,
      long nowTimestamp, String serviceName, String componentName,
      Map<String, String> actionParameters, boolean retryAllowed, boolean autoSkipFailure); void validateAction(ExecuteActionRequest actionRequest); void addExecutionCommandsToStage(ActionExecutionContext actionExecutionContext,
      Stage stage, Map<String, String> requestParams); String getRepoInfo(Cluster cluster, Host host); String getRepoInfo(Cluster cluster, String hostOSType, String hostOSFamily, String hostName); ExecuteCommandJson getCommandJson(ActionExecutionContext actionExecContext,
      Cluster cluster, StackId stackId); boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName); }
AmbariCustomCommandExecutionHelper { public boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName) throws AmbariException { if (actionName.equals(START_COMMAND_NAME) || actionName.equals(RESTART_COMMAND_NAME)) { Cluster cluster = clusters.getCluster(clusterName); StackId stackId = cluster.getDesiredStackVersion(); AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo(); StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (stack != null) { ServiceInfo serviceInfo = stack.getService(serviceName); if (serviceInfo != null) { Boolean restartRequiredAfterRackChange = serviceInfo.isRestartRequiredAfterRackChange(); if (restartRequiredAfterRackChange != null && restartRequiredAfterRackChange) { return true; } } } } return false; }  void addServiceCheckAction(Stage stage, String hostname, String smokeTestRole,
      long nowTimestamp, String serviceName, String componentName,
      Map<String, String> actionParameters, boolean retryAllowed, boolean autoSkipFailure); void validateAction(ExecuteActionRequest actionRequest); void addExecutionCommandsToStage(ActionExecutionContext actionExecutionContext,
      Stage stage, Map<String, String> requestParams); String getRepoInfo(Cluster cluster, Host host); String getRepoInfo(Cluster cluster, String hostOSType, String hostOSFamily, String hostName); ExecuteCommandJson getCommandJson(ActionExecutionContext actionExecContext,
      Cluster cluster, StackId stackId); boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName); static final Map<String, String> masterToSlaveMappingForDecom; final static String DECOM_INCLUDED_HOSTS; final static String DECOM_EXCLUDED_HOSTS; final static String DECOM_SLAVE_COMPONENT; final static String HBASE_MARK_DRAINING_ONLY; final static String UPDATE_EXCLUDE_FILE_ONLY; final static int MIN_STRICT_SERVICE_CHECK_TIMEOUT; static final String DECOMMISSION_COMMAND_NAME; }