void addListeners( Collection listeners ) { for( Object listener : listeners ) { if( listener instanceof FlowListener ) addListener( (FlowListener) listener ); } }
protected void setCheckpoints( Map<String, Tap> checkpoints ) { addListeners( checkpoints.values() ); this.checkpoints = checkpoints; }
public void initialize( FlowElementGraph flowElementGraph, FlowStepGraph flowStepGraph ) { addPlannerProperties(); this.flowElementGraph = flowElementGraph; this.flowStepGraph = flowStepGraph; initSteps(); this.flowStats = createPrepareFlowStats(); initializeNewJobsMap(); initializeChildStats(); }
@Override public boolean areSinksStale() throws IOException { return areSourcesNewer( getSinkModified() ); }
protected BaseFlow( PlatformInfo platformInfo, Map<Object, Object> properties, Config defaultConfig, String name, Map<String, String> flowDescriptor ) { if( platformInfo != null ) this.platformInfo = platformInfo; this.name = name; if( flowDescriptor != null ) this.flowDescriptor = new LinkedHashMap<>( flowDescriptor ); addSessionProperties( properties ); initConfig( properties, defaultConfig ); }
protected BaseFlow( PlatformInfo platformInfo, Map<Object, Object> properties, Config defaultConfig, FlowDef flowDef ) { properties = PropertyUtil.asFlatMap( properties ); if( platformInfo != null ) this.platformInfo = platformInfo; this.name = flowDef.getName(); this.tags = flowDef.getTags(); this.runID = flowDef.getRunID(); this.classPath = flowDef.getClassPath(); if( !flowDef.getFlowDescriptor().isEmpty() ) this.flowDescriptor = new LinkedHashMap<>( flowDef.getFlowDescriptor() ); addSessionProperties( properties ); initConfig( properties, defaultConfig ); setSources( flowDef.getSourcesCopy() ); setSinks( flowDef.getSinksCopy() ); setTraps( flowDef.getTrapsCopy() ); setCheckpoints( flowDef.getCheckpointsCopy() ); initFromTaps(); retrieveSourceFields(); retrieveSinkFields(); }
@Override @ProcessStart public synchronized void start() { if( thread != null ) return; if( stop ) return; registerShutdownHook(); internalStart(); String threadName = ( "flow " + Util.toNull( getName() ) ).trim(); thread = createFlowThread( threadName ); thread.start(); }
@Override protected void initFromProperties( Map<Object, Object> properties ) { super.initFromProperties( properties ); preserveTemporaryFiles = getPreserveTemporaryFiles( properties ); }
@Override protected Thread createFlowThread( String threadName ) { Thread flowThread = super.createFlowThread( threadName ); flowThread.setContextClassLoader( createClassPathClassloader( flowThread.getContextClassLoader() ) ); return flowThread; }
@Override protected void initFromProperties( Map<Object, Object> properties ) { super.initFromProperties( properties ); preserveTemporaryFiles = getPreserveTemporaryFiles( properties ); }
@Override protected void initFromProperties( Map<Object, Object> properties ) { super.initFromProperties( properties ); preserveTemporaryFiles = getPreserveTemporaryFiles( properties ); }
protected void setTraps( Map<String, Tap> traps ) { addListeners( traps.values() ); this.traps = traps; }
@Override protected void initFromProperties( Map<Object, Object> properties ) { super.initFromProperties( properties ); preserveTemporaryFiles = getPreserveTemporaryFiles( properties ); }
protected void setSources( Map<String, Tap> sources ) { if( sources == null ) return; addListeners( sources.values() ); this.sources = sources; }
protected void setSinks( Map<String, Tap> sinks ) { if( sinks == null ) return; addListeners( sinks.values() ); this.sinks = sinks; }