}
private TupleEntryCollector getTupleEntryCollector( PlatformBroker platformBroker, Branch branch )
{
LingualFlowFactory flowFactory = platformBroker.getFlowFactory( branch );
TableDef tableDef = branch.tailTableDef;
String[] jarPath = ClassLoaderUtil.getJarPaths( getPlatformBroker(), tableDef );
flowFactory.addSink( tableDef.getName(), tableDef, jarPath );
ClassLoader jarLoader = ClassLoaderUtil.getJarClassLoader( platformBroker, flowFactory );
if( jarLoader != null )
Thread.currentThread().setContextClassLoader( jarLoader );
FlowProcess flowProcess = platformBroker.getFlowProcess();
SchemaCatalogManager schemaCatalog = platformBroker.getCatalogManager();
Map<String, TupleEntryCollector> cache = platformBroker.getCollectorCache();
TupleEntryCollector collector;
try
{
String identifier = tableDef.getIdentifier();
if( cache != null && cache.containsKey( identifier ) )
{
LOG.debug( "inserting into (cached): {}", identifier );
collector = cache.get( identifier );