public int setHostComponentState(String hostName, String componentName, String state) {
    StateProvider.State s = state.equals("STARTED") ? StateProvider.State.Running :
        state.equals("INSTALLED") ? StateProvider.State.Stopped : StateProvider.State.Unknown;

    int requestId = -1;
    if (!isClientOnlyComponent(componentName)) {
      if (s != StateProvider.State.Unknown && !state.equals(getHostComponentState(hostName, componentName))) {
        requestId = recordProcess(stateProvider.setRunningState(hostName, componentName, s), -1,
                "Set host component " + componentName + " state to " + s);
      }
    }
    return requestId;
  }
Set the host component state for the given host name and component name.

@param hostName       the host name
@param componentName  the component name

@return the request id
contrib/ambari-scom/ambari-scom-server/src/main/java/org/apache/ambari/msi/ClusterDefinition.java