Package cascading.operation

Examples of cascading.operation.Filter


    Tap source = getPlatform().getTextFile( inputFileApache );
    Tap sink = getPlatform().getTextFile( getOutputPath( "logicfilter" ), SinkMode.REPLACE );

    Pipe pipe = new Pipe( "test" );

    Filter filter = new And( new RegexFilter( "^68.*$" ), new RegexFilter( "^1000.*$" ) );

    pipe = new Each( pipe, new Fields( "line" ), filter );

    Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );

View Full Code Here


      "        <b:top-second>nested-top-second</b:top-second>" +
      "      </a:second>" +
      "    </a:top>" +
      "</document>";

    Filter filter = new XPathFilter( namespaces, "//a:top/a:first/text() != 'first-value'" );

    assertTrue( invokeFilter( filter, new Tuple( xml ) ) );
    }
View Full Code Here

    context.argumentEntries = getArgumentEntries();
    context.calls = new ConcreteCall[ filters.length ];

    for( int i = 0; i < filters.length; i++ )
      {
      Filter filter = filters[ i ];

      context.calls[ i ] = new ConcreteCall( (ConcreteCall) operationCall );
      context.calls[ i ].setArguments( context.argumentEntries[ i ] );
      context.calls[ i ].setArgumentFields( context.argumentEntries[ i ].getFields() );

      filter.prepare( flowProcess, context.calls[ i ] );
      }

    operationCall.setContext( context );
    }
View Full Code Here

    Context context = (Context) operationCall.getContext();
    ConcreteCall[] calls = context.calls;

    for( int i = 0; i < filters.length; i++ )
      {
      Filter filter = filters[ i ];

      filter.cleanup( flowProcess, calls[ i ] );
      }

    operationCall.setContext( null );
    }
View Full Code Here

    Tap source = getPlatform().getTextFile( Fields.size( 2 ), inputFileApache );
    Tap sink = getPlatform().getTextFile( getOutputPath( "filterall" ), SinkMode.REPLACE );

    Pipe pipe = new Pipe( "test" );

    Filter filter = new RegexFilter( ".*", true );

    pipe = new Each( pipe, new Fields( 1 ), filter );

    Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );

View Full Code Here

    Tap source = getPlatform().getTextFile( Fields.size( 2 ), inputFileApache );
    Tap sink = getPlatform().getTextFile( getOutputPath( "filter" ), SinkMode.REPLACE );

    Pipe pipe = new Pipe( "test" );

    Filter filter = new RegexFilter( "^68.*" );

    pipe = new Each( pipe, new Fields( 1 ), filter );

    Flow flow = getPlatform().getFlowConnector().connect( source, sink, pipe );

View Full Code Here

    Tap source = getPlatform().getDelimitedFile( new Fields( "num", "char" ), " ", inputFileLhs );

    Pipe pipe = new Pipe( "test" );

    Filter filter = new Not( new And( new Fields( "num" ), new RegexFilter( "1", true, true ), new Fields( "char" ), new RegexFilter( "a", true, true ) ) );

    // compounding the filter for the Fields.ALL case.
    pipe = new Each( pipe, filter );
    pipe = new Each( pipe, new Fields( "num", "char" ), filter );
View Full Code Here

    Tap source = getPlatform().getDelimitedFile( new Fields( "num", "char" ), " ", inputFileLhs );

    Pipe pipe = new Pipe( "test" );

    Filter filter = new Not( new Or( new Fields( "num" ), new RegexFilter( "1", true, true ), new Fields( "char" ), new RegexFilter( "a", true, true ) ) );

    // compounding the filter for the Fields.ALL case.
    pipe = new Each( pipe, filter );
    pipe = new Each( pipe, new Fields( "num", "char" ), filter );
View Full Code Here

    Tap source = getPlatform().getDelimitedFile( new Fields( "num", "char" ), " ", inputFileLhs );

    Pipe pipe = new Pipe( "test" );

    Filter filter = new Not( new Xor( new Fields( "num" ), new RegexFilter( "1", true, true ), new Fields( "char" ), new RegexFilter( "a", true, true ) ) );

    // compounding the filter for the Fields.ALL case.
    pipe = new Each( pipe, filter );
    pipe = new Each( pipe, new Fields( "num", "char" ), filter );
View Full Code Here

    String expression = Expressions.toString( block );

    LOG.debug( "filter parameters: {}", incomingFields );
    LOG.debug( "filter expression: {}", expression );

    Filter expressionFilter = new ScriptFilter( expression, incomingFields.getTypesClasses() ); // handles coercions

    return new Each( pipe, expressionFilter );
    }
View Full Code Here

TOP

Related Classes of cascading.operation.Filter

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.