Package cascading.flow

Examples of cascading.flow.FlowConnector


    // set the current job jar
    Properties properties = new Properties();
    FlowConnector.setApplicationJarClass( properties, Main.class );

    // connect the assembly to the SOURCE and SINK taps
    Flow parsedLogFlow = new FlowConnector( properties ).connect( logTap, remoteLogTap, importPipe );

    // optionally print out the parsedLogFlow to a DOT file for import into a graphics package
    // parsedLogFlow.writeDOT( "logparser.dot" );

    // start execution of the flow (either locally or on the cluster
View Full Code Here


        properties.setProperty("mapred.create.symlink", "yes");
      }
    }

    FlowConnector.setApplicationJarClass(properties, Main.class);
    FlowConnector flowConnector = new FlowConnector(properties);
    Flow flow = flowConnector.connect(sources, sinks, tails);
    if ("hadoop".equals(runningMode)) {
      try {
        flow.addListener(tempDir);
      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

    Tap sinkSecond = getPlatform().getTabDelimitedFile( new Fields( "ip" ), getOutputPath( "chainedtaps/second" ), SinkMode.REPLACE );
    Tap sinkThird = getPlatform().getTabDelimitedFile( new Fields( "ip" ), getOutputPath( "chainedtaps/third" ), SinkMode.REPLACE );

    Map<String, Tap> sinks = Cascades.tapsMap( new String[]{"first", "second",
                                                            "third"}, Tap.taps( sinkFirst, sinkSecond, sinkThird ) );
    FlowConnector flowConnector = getPlatform().getFlowConnector();

    Flow flow = flowConnector.connect( source, sinks, pipe );

    if( getPlatform().isMapReduce() )
      assertEquals( "wrong number of steps", 3, flow.getFlowSteps().size() );

    flow.complete();
View Full Code Here

    Pipe splice2 = new CoGroup( splice1, new Fields( "num1" ), pipeNum102, new Fields( "num" ), new Fields( "num1", "num2", "num3" ) );

    Properties properties = new Properties();
    FlowConnectorProps.setIntermediateSchemeClass( properties, TextLine.class );

    FlowConnector flowConnector = getPlatform().getFlowConnector( properties );

    Flow flow = flowConnector.connect( sources, sink, splice2 );

    assertEquals( "not equal: steps.size()", 2, flow.getFlowSteps().size() );
    }
View Full Code Here

    Pipe splice1 = new CoGroup( pipeNum20, new Fields( "num" ), pipeNum101, new Fields( "num" ), new Fields( "num1", "num2" ) );

    Pipe splice2 = new CoGroup( splice1, new Fields( "num9" ), pipeNum102, new Fields( "num" ), new Fields( "num1", "num2", "num3" ) );

    FlowConnector flowConnector = getPlatform().getFlowConnector();

    try
      {
      Flow flow = flowConnector.connect( sources, sink, splice2 );
      fail( "did not fail on bad field" );
      }
    catch( Exception exception )
      {
      // ignore
View Full Code Here

    right = new Each( right, new Fields( "num" ), new RegexFilter( ".*" ) );

    if( !before )
      right = new Pipe( "right", right );

    FlowConnector flowConnector = getPlatform().getFlowConnector();

    Flow flow = flowConnector.connect( "splitmiddle", sources, sinks, left, right );

    List<FlowStep> steps = flow.getFlowSteps();

    // if the optimization isn't in place, don't test for it
    if( testTempReplaced && !flowConnector.getRuleRegistry().hasRule( "CombineAdjacentTapTransformer" ) )
      testTempReplaced = false;

    assertEquals( "not equal: steps.size()", testTempReplaced ? 2 : 3, steps.size() );

    BaseFlowStep step = (BaseFlowStep) steps.get( 0 );
View Full Code Here

      .setName( "sql flow" )
      .addSource( "example.employee", empTap )
      .addSource( "example.sales_fact_1997", salesTap )
      .addSink( "results", resultsTap );

    FlowConnector flowConnector = new LocalFlowConnector();

    SQLPlanner sqlPlanner = new SQLPlanner()
      .setSql( statement );

    flowDef.addAssemblyPlanner( sqlPlanner );

    Flow flow = flowConnector.connect( flowDef );

    flow.complete();

    TupleEntryIterator iterator = resultsTap.openForRead( flow.getFlowProcess() );
View Full Code Here

TOP

Related Classes of cascading.flow.FlowConnector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.