001/*
002 * Copyright (c) 2016-2017 Chris K Wensel <chris@wensel.net>. All Rights Reserved.
003 * Copyright (c) 2007-2017 Xplenty, Inc. All Rights Reserved.
004 *
005 * Project and contact information: http://www.cascading.org/
006 *
007 * This file is part of the Cascading project.
008 *
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 *     http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 */
021
022package cascading.flow;
023
024import java.util.List;
025
026/**
027 * The FlowStepStrategy interface allows for on the fly customization of {@link cascading.flow.FlowStep} configuration values
028 * before they are submitted to the underlying platform.
029 * <p>
030 * Use a strategy instance to change the display name for a job, or in the case of Hadoop, the number of
031 * mapper or reducer instances.
032 * <p>
033 * Note, to change the configuration information, {@link cascading.flow.FlowStep#getConfig()} must be
034 * called to get access to the current configuration.
035 * <p>
036 * If any, the completed predecessor steps are provided so that the predecessors can be inspected via the
037 * {@link cascading.stats.FlowStepStats} interface for any information that may influence the current job.
038 * <p>
039 * It is also possible to block submission of the job by blocking in this method.
040 */
041public interface FlowStepStrategy<Config>
042  {
043  void apply( Flow<Config> flow, List<FlowStep<Config>> predecessorSteps, FlowStep<Config> flowStep );
044  }