    001    /*
    002     * Copyright (c) 2007-2014 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.hadoop2;
    022
    023    import java.beans.ConstructorProperties;
    024    import java.util.Map;
    025
    026    import cascading.flow.FlowConnector;
    027    import cascading.flow.planner.FlowPlanner;
    028    import cascading.scheme.Scheme;
    029    import cascading.scheme.hadoop.SequenceFile;
    030
    031    /**
    032     * Use the Hadoop2MR1FlowConnector to link source and sink {@link cascading.tap.Tap} instances with an assembly of {@link cascading.pipe.Pipe} instances into
    033     * an executable {@link cascading.flow.hadoop.HadoopFlow} for execution on an Apache Hadoop cluster.
    034     *
    035     * @see cascading.property.AppProps
    036     * @see cascading.flow.FlowConnectorProps
    037     * @see cascading.flow.FlowDef
    038     * @see cascading.flow.hadoop.MapReduceFlow
    039     */
    040    public class Hadoop2MR1FlowConnector extends FlowConnector
    041      {
    042      /**
    043       * Constructor FlowConnector creates a new FlowConnector instance.
    044       * <p/>
    045       * All properties passed to Hadoop are retrieved from a default instantiation of the Hadoop
    046       * {@link org.apache.hadoop.mapred.JobConf} which pulls all properties from the local CLASSPATH.
    047       */
    048      public Hadoop2MR1FlowConnector()
    049        {
    050        }
    051
    052      /**
    053       * Constructor FlowConnector creates a new FlowConnector instance using the given {@link java.util.Properties} instance as
    054       * default value for the underlying jobs. All properties are copied to a new native configuration instance.
    055       *
    056       * @param properties of type Properties
    057       */
    058      @ConstructorProperties({"properties"})
    059      public Hadoop2MR1FlowConnector( Map<Object, Object> properties )
    060        {
    061        super( properties );
    062        }
    063
    064      protected Class<? extends Scheme> getDefaultIntermediateSchemeClass()
    065        {
    066        return SequenceFile.class;
    067        }
    068
    069      protected FlowPlanner createFlowPlanner()
    070        {
    071        return new Hadoop2MR1Planner();
    072        }
    073      }