/** * Logs a summary message for the specified step. * * @param si the step interface */ public void logSummary( StepInterface si ) { log.logBasic( si.getStepname(), BaseMessages.getString( PKG, "Trans.Log.FinishedProcessing", String.valueOf( si .getLinesInput() ), String.valueOf( si.getLinesOutput() ), String.valueOf( si.getLinesRead() ) ) + BaseMessages .getString( PKG, "Trans.Log.FinishedProcessing2", String.valueOf( si.getLinesWritten() ), String.valueOf( si .getLinesUpdated() ), String.valueOf( si.getErrors() ) ) ); }
@Override public long getLinesRead() { if ( getData() != null && getData().linesReadStepNr != -1 ) { return getData().getMappingTrans().getSteps().get( getData().linesReadStepNr ).step.getLinesRead(); } else { return 0; } }
public static double getProcessCount( Context actualContext, Scriptable actualObject, Object[] ArgList, Function FunctionContext ) { if ( ArgList.length == 1 ) { try { Object scmO = actualObject.get( "_step_", actualObject ); StepInterface scm = (StepInterface) Context.jsToJava( scmO, StepInterface.class ); String strType = Context.toString( ArgList[0] ).toLowerCase(); if ( strType.equals( "i" ) ) { return scm.getLinesInput(); } else if ( strType.equals( "o" ) ) { return scm.getLinesOutput(); } else if ( strType.equals( "r" ) ) { return scm.getLinesRead(); } else if ( strType.equals( "u" ) ) { return scm.getLinesUpdated(); } else if ( strType.equals( "w" ) ) { return scm.getLinesWritten(); } else if ( strType.equals( "e" ) ) { return scm.getLinesRejected(); } else { return 0; } } catch ( Exception e ) { // throw Context.reportRuntimeError(e.toString()); return 0; } } else { throw Context.reportRuntimeError( "The function call getProcessCount requires 1 argument." ); } }
step.getLinesRead(), step.getLinesWritten(), step.getLinesInput(), step.getLinesOutput(), step .getLinesUpdated(), step.getLinesRejected(), step.getErrors() );
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(); }
break; case LINES_READ: value = new Long( combi.step.getLinesRead() ); break; case LINES_WRITTEN:
@Test public void doesNotWriteRowOnTimeWhenStopped() throws KettleException, InterruptedException { TransMeta transMeta = new TransMeta( getClass().getResource( "safe-stop.ktr" ).getPath() ); Trans trans = new Trans( transMeta ); trans.prepareExecution( new String[] {} ); trans.getSteps().get( 1 ).step.addRowListener( new RowAdapter() { @Override public void rowWrittenEvent( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException { trans.safeStop(); } } ); trans.startThreads(); trans.waitUntilFinished(); assertEquals( 1, trans.getSteps().get( 0 ).step.getLinesWritten() ); assertEquals( 1, trans.getSteps().get( 1 ).step.getLinesRead() ); } }
long li = step.getLinesInput(); long lo = step.getLinesOutput(); long lr = step.getLinesRead(); long lw = step.getLinesWritten(); long lu = step.getLinesUpdated();
result.setNrLinesRead( result.getNrLinesRead() + step.getLinesRead() );
rowData[index++] = step.getLinesRead();
private void doFinish() { try { trans.cleanup(); } catch ( Exception e ) { //Do Nothing } transformStats.setRowsFinished( true ); transformStats.setTotalRecords( step.getLinesRead() ); // there seems to be an issue with trans.getErrors() reporting 0 - figure it out on our own instead // transformStats.setErrorCount(errorCount); transformStats.setErrorCount( step.getLinesRead() - step.getLinesWritten() ); finished = true; }