}
}
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() );