@Test public void testProcessRowIllegalState() throws Exception { doThrow( new IllegalStateException( "IllegalStateExceptionMessage" ) ).when( mockPentahoParquetOutputFormat ) .setOutputFile( anyString(), anyBoolean() ); when( parquetOutput.getLogChannel() ).thenReturn( mockLogChannelInterface ); assertFalse( parquetOutput.processRow( parquetOutputMeta, parquetOutputData ) ); verify( mockLogChannelInterface, times( 1 ) ) .logError( "IllegalStateExceptionMessage" ); }
@Override public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { try { if ( data.output == null ) { init( getInputRowMeta() ); } Object[] currentRow = getRow(); if ( currentRow != null ) { RowMetaAndData row = new RowMetaAndData( getInputRowMeta(), currentRow ); data.writer.write( row ); putRow( row.getRowMeta(), row.getData() ); return true; } else { closeWriter(); pvfsFileAliaser.copyFileToFinalDestination(); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } } catch ( KettleException ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw ex; } catch ( IllegalStateException e ) { getLogChannel().logError( e.getMessage() ); setErrors( 1 ); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } catch ( Exception ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw new KettleException( ex ); } }
ParquetOutput extends BaseStep implements StepInterface { @Override public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { try { if ( data.output == null ) { init( getInputRowMeta() ); } Object[] currentRow = getRow(); if ( currentRow != null ) { RowMetaAndData row = new RowMetaAndData( getInputRowMeta(), currentRow ); data.writer.write( row ); putRow( row.getRowMeta(), row.getData() ); return true; } else { closeWriter(); pvfsFileAliaser.copyFileToFinalDestination(); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } } catch ( KettleException ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw ex; } catch ( IllegalStateException e ) { getLogChannel().logError( e.getMessage() ); setErrors( 1 ); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } catch ( Exception ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw new KettleException( ex ); } } }
ParquetOutput extends BaseStep implements StepInterface { @Override public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { try { if ( data.output == null ) { init( getInputRowMeta() ); } Object[] currentRow = getRow(); if ( currentRow != null ) { RowMetaAndData row = new RowMetaAndData( getInputRowMeta(), currentRow ); data.writer.write( row ); putRow( row.getRowMeta(), row.getData() ); return true; } else { closeWriter(); pvfsFileAliaser.copyFileToFinalDestination(); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } } catch ( KettleException ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw ex; } catch ( IllegalStateException e ) { getLogChannel().logError( e.getMessage() ); setErrors( 1 ); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } catch ( Exception ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw new KettleException( ex ); } } ParquetOutput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
                        Trans trans ); }
ParquetOutput extends BaseStep implements StepInterface { @Override public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { try { if ( data.output == null ) { init( getInputRowMeta() ); } Object[] currentRow = getRow(); if ( currentRow != null ) { RowMetaAndData row = new RowMetaAndData( getInputRowMeta(), currentRow ); data.writer.write( row ); putRow( row.getRowMeta(), row.getData() ); return true; } else { closeWriter(); pvfsFileAliaser.copyFileToFinalDestination(); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } } catch ( KettleException ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw ex; } catch ( IllegalStateException e ) { getLogChannel().logError( e.getMessage() ); setErrors( 1 ); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } catch ( Exception ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw new KettleException( ex ); } } ParquetOutput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
                        Trans trans ); @Override synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); void init( RowMetaInterface rowMeta ); void closeWriter(); boolean init( StepMetaInterface smi, StepDataInterface sdi ); }
ParquetOutput extends BaseStep implements StepInterface { @Override public synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException { try { if ( data.output == null ) { init( getInputRowMeta() ); } Object[] currentRow = getRow(); if ( currentRow != null ) { RowMetaAndData row = new RowMetaAndData( getInputRowMeta(), currentRow ); data.writer.write( row ); putRow( row.getRowMeta(), row.getData() ); return true; } else { closeWriter(); pvfsFileAliaser.copyFileToFinalDestination(); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } } catch ( KettleException ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw ex; } catch ( IllegalStateException e ) { getLogChannel().logError( e.getMessage() ); setErrors( 1 ); pvfsFileAliaser.deleteTempFileAndFolder(); setOutputDone(); return false; } catch ( Exception ex ) { try { closeWriter(); pvfsFileAliaser.deleteTempFileAndFolder(); } catch ( Exception ex2 ) { } throw new KettleException( ex ); } } ParquetOutput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
                        Trans trans ); @Override synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); void init( RowMetaInterface rowMeta ); void closeWriter(); boolean init( StepMetaInterface smi, StepDataInterface sdi );  }