@Override public void stop() { flow.stop(); } }
public void stop() { if( LOG.isInfoEnabled() ) logInfo( "stopping flow: " + flow.getName() ); stop = true; if( flow != null ) flow.stop(); }
@Override public void cancel() throws SQLException { try { if( !parent.isClosed() ) parent.cancel(); } finally { Flow flow = lingualConnection.getCurrentFlow(); if( flow != null ) { LOG.info( "stopping flow: {}", flow.getID() ); flow.stop(); } } }
flow.stop();
flow.stop();
@Test public void testProcessFlowFlowListenerExceptionHandlingInStop() throws IOException, InterruptedException { ThrowableListener listener = new ThrowableListener(); getPlatform().copyFromLocal( inputFileIps ); String path = "stopException"; Flow process = flowWithException( path, FailingRiffle.Failing.STOP ); process.addListener( listener ); process.start(); try { process.stop(); fail( "there should have been an exception" ); } catch( CascadingException exception ) { assertNotNull( listener.getThrowable() ); } }
@Test public void testProcessFlowFlowListenerExceptionHandlingInStop() throws IOException, InterruptedException { ThrowableListener listener = new ThrowableListener(); getPlatform().copyFromLocal( inputFileIps ); String path = "stopException"; Flow process = flowWithException( path, FailingRiffle.Failing.STOP ); process.addListener( listener ); process.start(); try { process.stop(); fail( "there should have been an exception" ); } catch( CascadingException exception ) { assertNotNull( listener.getThrowable() ); } }
flow.stop();
@Test public void testStartStopRace() throws Exception { getPlatform().copyFromLocal( inputFileLower ); Tap sourceLower = new Hfs( new TextLine( new Fields( "offset", "line" ) ), inputFileLower ); Map sources = new HashMap(); sources.put( "lower", sourceLower ); Function splitter = new RegexSplitter( new Fields( "num", "char" ), " " ); // using null pos so all fields are written Tap sink = new Hfs( new TextLine(), getOutputPath( "startstop" ), SinkMode.REPLACE ); Pipe pipeLower = new Each( new Pipe( "lower" ), new Fields( "line" ), splitter ); pipeLower = new GroupBy( pipeLower, new Fields( "num" ) ); Flow flow = getPlatform().getFlowConnector( getProperties() ).connect( sources, sink, pipeLower ); flow.start(); flow.stop(); // should not fail }
@Test public void testStartStopRace() throws Exception { getPlatform().copyFromLocal( inputFileLower ); Tap sourceLower = new Hfs( new TextLine( new Fields( "offset", "line" ) ), inputFileLower ); Map sources = new HashMap(); sources.put( "lower", sourceLower ); Function splitter = new RegexSplitter( new Fields( "num", "char" ), " " ); // using null pos so all fields are written Tap sink = new Hfs( new TextLine(), getOutputPath( "startstop" ), SinkMode.REPLACE ); Pipe pipeLower = new Each( new Pipe( "lower" ), new Fields( "line" ), splitter ); pipeLower = new GroupBy( pipeLower, new Fields( "num" ) ); Flow flow = getPlatform().getFlowConnector( getProperties() ).connect( sources, sink, pipeLower ); flow.start(); flow.stop(); // should not fail }