Package cascading.lingual.platform

Examples of cascading.lingual.platform.PlatformBroker


      }
    }

  public Enumerator createEnumerator() throws IOException
    {
    PlatformBroker platformBroker = getPlatformBroker();
    Branch branch = getBranch();

    Properties properties = platformBroker.getProperties();

    for( Ref head : branch.heads.keySet() )
      {
      if( head.tuples != null )
        writeValuesTuple( platformBroker, head );
      }

    LingualFlowFactory flowFactory = platformBroker.getFlowFactory( branch );

    Optiq.writeSQLPlan( properties, flowFactory.getName(), getVolcanoPlanner() );

    for( Ref head : branch.heads.keySet() )
      {
      TableDef tableDefFor = getTableDefFor( platformBroker, head );
      String[] jarPath = ClassLoaderUtil.getJarPaths( getPlatformBroker(), tableDefFor );

      flowFactory.addSource( head.name, tableDefFor, jarPath );
      }

    FlowListener flowListener = null;

    if( branch.tailTableDef != null )
      {
      TableDef tableDef = branch.tailTableDef;
      String[] jarPath = ClassLoaderUtil.getJarPaths( getPlatformBroker(), tableDef );

      flowFactory.addSink( tableDef.getName(), tableDef, jarPath );
      }
    else
      {
      Resource<Protocol, Format, SinkMode> resource = createResultResource( platformBroker, flowFactory );

      flowFactory.addSink( branch.current.getName(), resource );

      if( platformBroker.hasResultSchemaDef() )
        flowListener = new AddResultTableListener( platformBroker, flowFactory.getLingualConnection() );
      }

    String flowPlanPath = setFlowPlanPath( properties, flowFactory.getName() );
View Full Code Here


    }

  @Override
  public Enumerator enumerator()
    {
    PlatformBroker platformBroker = getPlatformBroker();
    Optiq.writeSQLPlan( platformBroker.getProperties(), createUniqueName(), getVolcanoPlanner() );

    Branch branch = getBranch();
    TupleEntryCollector collector = getTupleEntryCollector( platformBroker, branch );

    long rowCount;

    try
      {
      rowCount = 0;

      for( List<RexLiteral> values : branch.tuples )
        {
        collector.add( createTupleFrom( values ) );

        rowCount++;
        }
      }
    finally
      {
      if( platformBroker.getCollectorCache() == null )
        collector.close();
      }

    LOG.debug( "inserted {} rows", rowCount );
View Full Code Here

TOP

Related Classes of cascading.lingual.platform.PlatformBroker

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.