public long getLinesReadImpl() { return super.getLinesRead(); }
@Override public long getProcessed() { if ( getLinesRead() > getLinesWritten() ) { return getLinesRead(); } else { return getLinesWritten(); } }
/** * Log summary. */ public void logSummary() { synchronized ( statusCountersLock ) { long li = getLinesInput(); long lo = getLinesOutput(); long lr = getLinesRead(); long lw = getLinesWritten(); long lu = getLinesUpdated(); long lj = getLinesRejected(); if ( li > 0 || lo > 0 || lr > 0 || lw > 0 || lu > 0 || lj > 0 || errors > 0 ) { logBasic( BaseMessages.getString( PKG, "BaseStep.Log.SummaryInfo", String.valueOf( li ), String .valueOf( lo ), String.valueOf( lr ), String.valueOf( lw ), String.valueOf( lw ), String .valueOf( errors + lj ) ) ); } else { logDetailed( BaseMessages.getString( PKG, "BaseStep.Log.SummaryInfo", String.valueOf( li ), String .valueOf( lo ), String.valueOf( lr ), String.valueOf( lw ), String.valueOf( lw ), String .valueOf( errors + lj ) ) ); } } }
/** * Verify rejection rates. */ private void verifyRejectionRates() { StepErrorMeta stepErrorMeta = stepMeta.getStepErrorMeta(); if ( stepErrorMeta == null ) { return; // nothing to verify. } // Was this one error too much? if ( maxErrors > 0 && getLinesRejected() > maxErrors ) { logError( BaseMessages.getString( PKG, "BaseStep.Log.TooManyRejectedRows", Long.toString( maxErrors ), Long .toString( getLinesRejected() ) ) ); setErrors( 1L ); stopAll(); } if ( maxPercentErrors > 0 && getLinesRejected() > 0 && ( minRowsForMaxErrorPercent <= 0 || getLinesRead() >= minRowsForMaxErrorPercent ) ) { int pct = (int) Math.ceil( 100 * (double) getLinesRejected() / getLinesRead() ); // additional conversion for PDI-10210 if ( pct > maxPercentErrors ) { logError( BaseMessages.getString( PKG, "BaseStep.Log.MaxPercentageRejectedReached", Integer.toString( pct ), Long .toString( getLinesRejected() ), Long.toString( getLinesRead() ) ) ); setErrors( 1L ); stopAll(); } } }
@Test public void testGuiSuccess() { try { int r = rows.size(); BaseStep step = doOutput( rows, "0" ); ( (IngresVectorwiseLoader) step ).vwLoadMonitorThread.join(); assertEquals( r, step.getLinesOutput() ); assertEquals( r, step.getLinesRead() ); assertEquals( r, step.getLinesWritten() ); assertEquals( 0, step.getLinesRejected() ); assertEquals( 0, step.getErrors() ); } catch ( KettleException e ) { fail( e.getMessage() ); } catch ( InterruptedException e ) { e.printStackTrace(); } }
@Test public void testGuiErrorsWithErrorsAllowed() { try { int r = wrongRows.size(); BaseStep step = doOutput( wrongRows, "2" ); ( (IngresVectorwiseLoader) step ).vwLoadMonitorThread.join(); assertEquals( r - 1, step.getLinesOutput() ); assertEquals( r, step.getLinesRead() ); assertEquals( r, step.getLinesWritten() ); assertEquals( 1, step.getLinesRejected() ); assertEquals( 0, step.getErrors() ); } catch ( KettleException e ) { fail( e.getMessage() ); } catch ( InterruptedException e ) { e.printStackTrace(); } }
@Test public void testGuiErrors() { try { int r = wrongRows.size(); BaseStep step = doOutput( wrongRows, "0" ); ( (IngresVectorwiseLoader) step ).vwLoadMonitorThread.join(); assertEquals( 0, step.getLinesOutput() ); assertEquals( r, step.getLinesRead() ); assertEquals( r, step.getLinesWritten() ); assertEquals( 1, step.getLinesRejected() ); assertEquals( 1, step.getErrors() ); } catch ( KettleException e ) { fail( e.getMessage() ); } catch ( InterruptedException e ) { e.printStackTrace(); } }
@Test public void testWaitForFinish() { try { int r = rows.size(); BaseStep step = doOutput( wrongRows, "2" ); assertEquals( r - 1, step.getLinesOutput() ); assertEquals( r, step.getLinesRead() ); assertEquals( r, step.getLinesWritten() ); assertEquals( 1, step.getLinesRejected() ); assertEquals( 0, step.getErrors() ); } catch ( KettleException e ) { fail( e.getMessage() ); } }