@Override public void run() { if ( !isFinished() ) { addStepPerformanceSnapShot(); } } };
public boolean isFinishedOrStopped() { return isFinished() || isStopped(); }
/** * @deprecated Deprecated as of 8.0. Seems unused; will be to remove in 8.1 (ccaspanello) */ @Deprecated public void checkErrors() { if ( trans != null ) { if ( !trans.isFinished() ) { if ( trans.getErrors() != 0 ) { trans.killAll(); } } } }
private void checkTransEnded() { if ( trans != null ) { if ( trans.isFinished() && ( running || halted ) ) { log.logMinimal( BaseMessages.getString( PKG, "TransLog.Log.TransformationHasFinished" ) ); running = false; initialized = false; halted = false; halting = false; safeStopping = false; setControlStates(); // OK, also see if we had a debugging session going on. // If so and we didn't hit a breakpoint yet, display the show // preview dialog... // if ( debug && lastTransDebugMeta != null && lastTransDebugMeta.getTotalNumberOfHits() == 0 ) { debug = false; showLastPreviewResults(); } debug = false; checkErrorVisuals(); shell.getDisplay().asyncExec( new Runnable() { @Override public void run() { spoon.fireMenuControlers(); redraw(); } } ); } } }
@Test public void testDispose() throws KettleException { // Set Up TransMock to return the error when( stepMockHelper.trans.getErrors() ).thenReturn( 0 ); // The step has been already finished when( stepMockHelper.trans.isFinished() ).thenReturn( Boolean.FALSE ); // The step was started simpleMpData.wasStarted = true; smp = new SimpleMapping( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta, stepMockHelper.trans ); smp.init( stepMockHelper.initStepMetaInterface, simpleMpData ); smp.dispose( stepMockHelper.processRowsStepMetaInterface, simpleMpData ); verify( stepMockHelper.trans, times( 1 ) ).isFinished(); verify( stepMockHelper.trans, times( 1 ) ).waitUntilFinished(); verify( stepMockHelper.trans, times( 1 ) ).removeActiveSubTransformation( anyString() ); }
@Test public void testStepShouldProcessError_WhenMappingTransHasError() throws KettleException { // Set Up TransMock to return the error int errorCount = 1; when( stepMockHelper.trans.getErrors() ).thenReturn( errorCount ); // The step has been already finished when( stepMockHelper.trans.isFinished() ).thenReturn( Boolean.TRUE ); // The step was started simpleMpData.wasStarted = true; smp = new SimpleMapping( stepMockHelper.stepMeta, stepMockHelper.stepDataInterface, 0, stepMockHelper.transMeta, stepMockHelper.trans ); smp.init( stepMockHelper.initStepMetaInterface, simpleMpData ); smp.dispose( stepMockHelper.processRowsStepMetaInterface, simpleMpData ); verify( stepMockHelper.trans, times( 1 ) ).isFinished(); verify( stepMockHelper.trans, never() ).waitUntilFinished(); verify( stepMockHelper.trans, never() ).addActiveSubTransformation( anyString(), any( Trans.class ) ); verify( stepMockHelper.trans, times( 1 ) ).removeActiveSubTransformation( anyString() ); verify( stepMockHelper.trans, never() ).getActiveSubTransformation( anyString() ); verify( stepMockHelper.trans, times( 1 ) ).getErrors(); assertTrue( "The step contains the errors", smp.getErrors() == errorCount ); }
Mockito.when( mockHelper.trans.isFinished() ).thenReturn( false ); Mapping mapping = Mockito.spy( new Mapping( mockHelper.stepMeta, data, 0, mockHelper.transMeta, mockHelper.trans ) ); String stepName = "StepName";
&& !trans.isFinished() && !progressMonitor.isCanceled() ) {
&& step.isRunning() && !trans.isFinished() && !trans.isStopped() ) {
@Override public void run() { try { if ( Trans.this.isFinished() ) { log.logBasic( "Shutting down heartbeat signal for " + getName() ); shutdownHeartbeat( Trans.this.heartbeat ); return; } log.logDebug( "Triggering heartbeat signal for " + getName() + " at every " + intervalInSeconds + " seconds" ); ExtensionPointHandler.callExtensionPoint( log, KettleExtensionPoint.TransformationHeartbeat.id, Trans.this ); } catch ( KettleException e ) { log.logError( e.getMessage(), e ); } } }, intervalInSeconds /* initial delay */, intervalInSeconds /* interval delay */, TimeUnit.SECONDS );
if ( trans != null && ( trans.isFinished() || trans.isStopped() ) && trans.getLogDate() != null ) {
} else if ( isFinished() ) { message = STRING_FINISHED; if ( getResult().getNrErrors() > 0 ) {
while ( !trans.isFinished() ) {
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { // Close the running transformation if ( getData().wasStarted ) { if ( !getData().mappingTrans.isFinished() ) { // Wait until the child transformation has finished. getData().mappingTrans.waitUntilFinished(); } // Remove it from the list of active sub-transformations... // getTrans().removeActiveSubTransformation( getStepname() ); // See if there was an error in the sub-transformation, in that case, flag error etc. if ( getData().mappingTrans.getErrors() > 0 ) { logError( BaseMessages.getString( PKG, "SimpleMapping.Log.ErrorOccurredInSubTransformation" ) ); setErrors( 1 ); } } super.dispose( smi, sdi ); }
while ( !injectTrans.isFinished() && !injectTrans.isStopped() && !isStopped() ) { copyResult( injectTrans );
public void dispose( StepMetaInterface smi, StepDataInterface sdi ) { // Close the running transformation if ( getData().wasStarted ) { if ( !getData().mappingTrans.isFinished() ) { // Wait until the child transformation has finished. getData().getMappingTrans().waitUntilFinished(); } // Remove it from the list of active sub-transformations... // getTrans().removeActiveSubTransformation( getStepname() ); // See if there was an error in the sub-transformation, in that case, flag error etc. if ( getData().getMappingTrans().getErrors() > 0 ) { logError( BaseMessages.getString( PKG, "Mapping.Log.ErrorOccurredInSubTransformation" ) ); setErrors( 1 ); } } super.dispose( smi, sdi ); }
public void paintControl( final PaintEvent event ) { if ( transGraph.trans != null && transGraph.trans.isFinished() ) { refreshImage( event.gc ); if ( image != null && !image.isDisposed() ) { event.gc.drawImage( image, 0, 0 ); } } else { Rectangle bounds = canvas.getBounds(); if ( bounds.width <= 0 || bounds.height <= 0 ) { return; } event.gc.setForeground( GUIResource.getInstance().getColorWhite() ); event.gc.setBackground( GUIResource.getInstance().getColorWhite() ); event.gc.fillRectangle( new Rectangle( 0, 0, bounds.width, bounds.height ) ); event.gc.setForeground( GUIResource.getInstance().getColorBlack() ); String metricsMessage = BaseMessages.getString( PKG, "TransMetricsDelegate.TransformationIsNotRunning.Message" ); org.eclipse.swt.graphics.Point extent = event.gc.textExtent( metricsMessage ); event.gc.drawText( metricsMessage, ( bounds.width - extent.x ) / 2, ( bounds.height - extent.y ) / 2 ); } } } );
LogStatus status; if ( isFinished() ) { if ( isStopped() ) { status = LogStatus.STOP;
while ( !trans.isFinished() && trans.getErrors() == 0 ) { if ( parentJob.isStopped() ) { trans.stopAll();
public void run() { while ( !finished && !trans.isFinished() ) { try { rowsDone = step.getLinesOutput(); transformStats.setTotalRecords( rowsDone ); Thread.sleep( 250 ); } catch ( InterruptedException e ) { // swallow this } } doFinish(); }