/** * Checks whether the transformation steps are running lookup. * * @return a boolean array associated with the step list, indicating whether that step is running a lookup. */ public boolean[] getTransStepIsRunningLookup() { if ( steps == null ) { return null; } boolean[] tResult = new boolean[ steps.size() ]; for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); tResult[ i ] = ( sid.step.isRunning() || sid.step.getStatus() != StepExecutionStatus.STATUS_FINISHED ); } return tResult; }
/** * Gets the number of active (i.e. not finished) steps in this transformation * * @return the number of active steps */ public int nrActiveSteps() { if ( steps == null ) { return 0; } int nr = 0; for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); // without also considering a step status of not finished, // the step execution results grid shows empty while // the transformation has steps still running. // if ( sid.step.isRunning() ) nr++; if ( sid.step.isRunning() || sid.step.getStatus() != StepExecutionStatus.STATUS_FINISHED ) { nr++; } } return nr; }
/** * Gets the number of steps in the transformation that are in an end state, such as Finished, Halted, or Stopped. * * @return the number of ended steps */ public int getEnded() { int nrEnded = 0; if ( steps == null ) { return 0; } for ( int i = 0; i < steps.size(); i++ ) { StepMetaDataCombi sid = steps.get( i ); StepDataInterface data = sid.data; if ( ( sid.step != null && !sid.step.isRunning() ) // Should normally not be needed anymore, status is kept in data. || data.getStatus() == StepExecutionStatus.STATUS_FINISHED || // Finished processing data.getStatus() == StepExecutionStatus.STATUS_HALTED || // Not launching because of init error data.getStatus() == StepExecutionStatus.STATUS_STOPPED ) { // Stopped because of an error nrEnded++; } } return nrEnded; }
@GET @Path( "/status/{id : .+}" ) @Produces( { MediaType.APPLICATION_JSON } ) public TransformationStatus getTransformationStatus( @PathParam( "id" ) String id ) { TransformationStatus status = new TransformationStatus(); // find trans Trans trans = CarteResource.getTransformation( id ); CarteObjectEntry entry = CarteResource.getCarteObjectEntry( id ); status.setId( entry.getId() ); status.setName( entry.getName() ); status.setStatus( trans.getStatus() ); for ( int i = 0; i < trans.nrSteps(); i++ ) { StepInterface step = trans.getRunThread( i ); if ( ( step.isRunning() ) || step.getStatus() != StepExecutionStatus.STATUS_EMPTY ) { StepStatus stepStatus = new StepStatus( step ); status.addStepStatus( stepStatus ); } } return status; }
public synchronized void updateAll( StepInterface baseStep ) { // Proc: nr of lines processed: input + output! this.stepname = baseStep.getStepname(); this.copy = baseStep.getCopy(); this.linesRead = linesRead + baseStep.getLinesRead(); this.linesWritten = linesWritten + baseStep.getLinesWritten(); this.linesInput = linesInput + baseStep.getLinesInput(); this.linesOutput = linesOutput + baseStep.getLinesOutput(); this.linesUpdated = linesUpdated + baseStep.getLinesUpdated(); this.linesRejected = linesRejected + baseStep.getLinesRejected(); this.errors = errors + baseStep.getErrors(); this.accumlatedRuntime = accumlatedRuntime + baseStep.getRuntime(); this.statusDescription = baseStep.getStatus().getDescription(); long in_proc = Math.max( linesInput, linesRead ); long out_proc = Math.max( linesOutput + linesUpdated, linesWritten + linesRejected ); float lapsed = ( (float) accumlatedRuntime ) / 1000; double in_speed = 0; double out_speed = 0; if ( lapsed != 0 ) { in_speed = Math.floor( 10 * ( in_proc / lapsed ) ) / 10; out_speed = Math.floor( 10 * ( out_proc / lapsed ) ) / 10; } double speedNumber = ( in_speed > out_speed ? in_speed : out_speed ); this.seconds = Math.floor( ( lapsed * 10 ) + 0.5 ) / 10; this.speed = lapsed == 0 ? "-" : " " + speedDf.format( speedNumber ); this.priority = baseStep.isRunning() ? " " + baseStep.rowsetInputSize() + "/" + baseStep.rowsetOutputSize() : "-"; this.stopped = baseStep.isStopped(); this.paused = baseStep.isPaused(); }
&& step.isRunning() && !trans.isFinished() && !trans.isStopped() ) {
if ( ( baseStep.isRunning() ) || baseStep.getStatus() != StepExecutionStatus.STATUS_EMPTY ) { StepStatus stepStatus = new StepStatus( baseStep ); transStatus.getStepStatusList().add( stepStatus ); for ( int i = 0; i < trans.nrSteps(); i++ ) { StepInterface step = trans.getRunThread( i ); if ( ( step.isRunning() ) || step.getStatus() != StepExecutionStatus.STATUS_EMPTY ) { StepStatus stepStatus = new StepStatus( step ); boolean snif = false; String htmlString = ""; if ( step.isRunning() && !step.isStopped() && !step.isPaused() ) { snif = true; String sniffLink =
if ( step.isRunning() ) {