private Stage createNewStage(long id, Cluster cluster, long requestId,
                               String requestContext, String commandParams, String hostParams) {

    Stage stage = stageFactory.createNew(requestId,
      BASE_LOG_DIR + File.pathSeparator + requestId,
      cluster.getClusterName(),
      cluster.getClusterId(),
      requestContext,
      commandParams,
      hostParams);

    stage.setStageId(id);
    return stage;
  }
Creates a new stage

@param id             the new stage's id
@param cluster        the relevant Cluster
@param requestId      the relevant request Id
@param requestContext a String describing the stage
@param commandParams  JSON-encoded command parameters
@param hostParams     JSON-encoded host parameters
@return a newly created Stage
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java