    001/*
    002 * Copyright (c) 2007-2016 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
    021package cascading.flow.local;
    022
    023import java.beans.ConstructorProperties;
    024import java.util.Map;
    025
    026import cascading.flow.FlowConnector;
    027import cascading.flow.local.planner.LocalPlanner;
    028import cascading.flow.local.planner.LocalRuleRegistry;
    029import cascading.flow.planner.FlowPlanner;
    030import cascading.flow.planner.rule.RuleRegistrySet;
    031import cascading.scheme.Scheme;
    032
    033/**
    034 * Use the LocalFlowConnector to link source and sink {@link cascading.tap.Tap} instances with an assembly of {@link cascading.pipe.Pipe} instances into
    035 * an executable {@link LocalFlow} for execution in local memory.
    036 *
    037 * @see cascading.property.AppProps
    038 * @see cascading.flow.FlowConnectorProps
    039 * @see cascading.flow.FlowDef
    040 */
    041public class LocalFlowConnector extends FlowConnector
    042  {
    043  /** Constructor LocalFlowConnector creates a default instance. */
    044  public LocalFlowConnector()
    045    {
    046    }
    047
    048  /**
    049   * Constructor LocalFlowConnector creates a new instance using any of the given properties.
    050   *
    051   * @param properties of type Map
    052   */
    053  @ConstructorProperties({"properties"})
    054  public LocalFlowConnector( Map<Object, Object> properties )
    055    {
    056    super( properties );
    057    }
    058
    059  /** Constructor LocalFlowConnector creates a default instance. */
    060  @ConstructorProperties({"ruleRegistrySet"})
    061  public LocalFlowConnector( RuleRegistrySet ruleRegistrySet )
    062    {
    063    super( ruleRegistrySet );
    064    }
    065
    066  /**
    067   * Constructor LocalFlowConnector creates an instance using any of the given properties.
    068   *
    069   * @param properties of type Map
    070   */
    071  @ConstructorProperties({"properties", "ruleRegistrySet"})
    072  public LocalFlowConnector( Map<Object, Object> properties, RuleRegistrySet ruleRegistrySet )
    073    {
    074    super( properties, ruleRegistrySet );
    075    }
    076
    077  @Override
    078  protected Class<? extends Scheme> getDefaultIntermediateSchemeClass()
    079    {
    080    return null;
    081    }
    082
    083  @Override
    084  protected FlowPlanner createFlowPlanner()
    085    {
    086    return new LocalPlanner();
    087    }
    088
    089  @Override
    090  protected RuleRegistrySet createDefaultRuleRegistrySet()
    091    {
    092    return new RuleRegistrySet( new LocalRuleRegistry() );
    093    }
    094  }