Package cascading.tuple

Examples of cascading.tuple.TupleEntryCollector


  final Tap trap;
  final String trapName;

  static TupleEntryCollector getTrapCollector( Tap trap, FlowProcess flowProcess )
    {
    TupleEntryCollector trapCollector = trapCollectors.get( trap );

    if( trapCollector == null )
      {
      try
        {
View Full Code Here


    function = each.getFunction();

    operationCall.setArguments( argumentsEntry );

    operationCall.setOutputCollector( new TupleEntryCollector( getOperationDeclaredFields() )
    {
    @Override
    protected void collect( TupleEntry input ) throws IOException
      {
      Tuple outgoing = outgoingBuilder.makeResult( incomingEntry.getTuple(), input.getTuple() );
View Full Code Here

    {
    super.initialize();

    buffer = every.getBuffer();

    outputCollector = new TupleEntryCollector( getOperationDeclaredFields() )
    {
    @Override
    protected void collect( TupleEntry resultEntry ) throws IOException
      {
      Tuple outgoing = outgoingBuilder.makeResult( incomingEntry.getTuple(), resultEntry.getTuple() );
View Full Code Here

    {
    super.initialize();

    aggregator = every.getAggregator();

    outputCollector = new TupleEntryCollector( getOperationDeclaredFields() )
    {
    @Override
    protected void collect( TupleEntry resultEntry ) throws IOException
      {
      Tuple outgoing = outgoingBuilder.makeResult( incomingEntry.getTuple(), resultEntry.getTuple() );
View Full Code Here

    }

  @Override
  public TupleEntryCollector openSystemIntermediateForWrite() throws IOException
    {
    return new TupleEntryCollector( Fields.size( 2 ) )
    {
    @Override
    protected void collect( TupleEntry tupleEntry )
      {
      try
View Full Code Here

    {
    String tapPath = getOutputPath( "tapreplace" );

    Tap tap = getPlatform().getTextFile( tapPath, SinkMode.KEEP );

    TupleEntryCollector collector = tap.openForWrite( getPlatform().getFlowProcess() ); // casting for test

    for( int i = 0; i < 100; i++ )
      collector.add( new Tuple( "string", "" + i, i ) );

    collector.close();

    tap = getPlatform().getTextFile( tapPath, SinkMode.REPLACE );

    collector = tap.openForWrite( getPlatform().getFlowProcess() ); // casting for test

    for( int i = 0; i < 100; i++ )
      collector.add( new Tuple( "string", "" + i, i ) );

    collector.close();
    }
View Full Code Here

    Hfs temp = new Hfs( new TextLine(), statePath, SinkMode.REPLACE );

    try
      {
      TupleEntryCollector writer = temp.openForWrite( new HadoopFlowProcess( conf ) );

      writer.add( new Tuple( stepState ) );

      writer.close();
      }
    catch( IOException exception )
      {
      throw new FlowException( "unable to write step state to Hadoop FS: " + temp.getIdentifier() );
      }
View Full Code Here

      this.partitionEntry.setTuple( partitionTuple );
      }

    TupleEntryCollector getCollector( String path )
      {
      TupleEntryCollector collector = collectors.get( path );

      if( collector != null )
        return collector;

      try
View Full Code Here

        }
      }

    public void closeCollector( String path )
      {
      TupleEntryCollector collector = collectors.get( path );
      if( collector == null )
        return;
      try
        {
        collector.close();

        flowProcess.increment( Counters.Paths_Closed, 1 );
        }
      catch( Exception exception )
        {
View Full Code Here

  private void writeFileTo( String path ) throws IOException
    {
    Hfs tap = new Hfs( new TextLine( new Fields( "offset", "line" ) ), getOutputPath( path ) );

    TupleEntryCollector collector = tap.openForWrite( getPlatform().getFlowProcess() );

    collector.add( new Tuple( 1, "1" ) );

    collector.close();
    }
View Full Code Here

TOP

Related Classes of cascading.tuple.TupleEntryCollector

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.