001    /*
002     * Copyright (c) 2007-2015 Concurrent, Inc. All Rights Reserved.
003     *
004     * Project and contact information: http://www.cascading.org/
005     *
006     * This file is part of the Cascading project.
007     *
008     * Licensed under the Apache License, Version 2.0 (the "License");
009     * you may not use this file except in compliance with the License.
010     * You may obtain a copy of the License at
011     *
012     *     http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing, software
015     * distributed under the License is distributed on an "AS IS" BASIS,
016     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017     * See the License for the specific language governing permissions and
018     * limitations under the License.
019     */
020    
021    package cascading.flow;
022    
023    import java.io.Serializable;
024    import java.util.Set;
025    
026    import cascading.flow.planner.Scope;
027    import cascading.property.ConfigDef;
028    import cascading.tuple.Fields;
029    
030    /**
031     * Interface FlowElement is a utility interface used internally to simplify DAG management. It is not intended
032     * for users to interact with these methods directly.
033     */
034    public interface FlowElement extends Serializable
035      {
036      /**
037       * Method outgoingScopeFor returns the Scope this FlowElement hands off to the next FlowElement.
038       *
039       * @param incomingScopes of type Set<Scope>
040       * @return Scope
041       */
042      Scope outgoingScopeFor( Set<Scope> incomingScopes );
043    
044      /**
045       * Method resolveIncomingOperationArgumentFields returns the Fields outgoing from the previous FlowElement that
046       * are consumable by this FlowElement when preparing Operation arguments.
047       *
048       * @param incomingScope of type Scope
049       * @return Fields
050       */
051      Fields resolveIncomingOperationArgumentFields( Scope incomingScope );
052    
053      /**
054       * Method resolveIncomingOperationPassThroughFields returns the Fields outgoing from the previous FlowElement that
055       * are consumable by this FlowElement when preparing the Pipe outgoing tuple.
056       *
057       * @param incomingScope of type Scope
058       * @return Fields
059       */
060      Fields resolveIncomingOperationPassThroughFields( Scope incomingScope );
061    
062      boolean isEquivalentTo( FlowElement element );
063    
064      ConfigDef getStepConfigDef();
065    
066      boolean hasStepConfigDef();
067    
068      ConfigDef getConfigDef();
069    
070      boolean hasConfigDef();
071      }