@Test public void testInit() { try { avroOutput.init( avroOutputMeta, avroOutputData ); avroOutput.init(); } catch ( Exception ex ) { fail( "Something failed with the initialization of the AvroOutputStep: " + ex.getMessage() ); } }
public void init() throws Exception { if ( getTransMeta().getNamedClusterEmbedManager() != null ) { getTransMeta().getNamedClusterEmbedManager() .passEmbeddedMetastoreKey( getTransMeta(), getTransMeta().getEmbeddedMetastoreProviderKey() ); } NamedCluster namedCluster = getNamedCluster(); FormatService formatService; try { formatService = meta.getNamedClusterResolver().getNamedClusterServiceLocator() .getService( namedCluster, FormatService.class ); } catch ( ClusterInitializationException e ) { throw new KettleException( "can't get service format shim ", e ); } TransMeta parentTransMeta = meta.getParentStepMeta().getParentTransMeta(); data.output = formatService.createOutputFormat( IPentahoAvroOutputFormat.class, namedCluster ); data.output .setOutputFile( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getFilename() ) ), meta.isOverrideOutput() ); data.output.setFields( meta.getOutputFields() ); data.output.setVariableSpace( parentTransMeta ); IPentahoAvroOutputFormat.COMPRESSION compression; try { compression = IPentahoAvroOutputFormat.COMPRESSION .valueOf( parentTransMeta.environmentSubstitute( meta.getCompressionType() ).toUpperCase() ); } catch ( Exception ex ) { compression = IPentahoAvroOutputFormat.COMPRESSION.UNCOMPRESSED; } data.output.setCompression( compression ); data.output.setNameSpace( parentTransMeta.environmentSubstitute( meta.getNamespace() ) ); data.output.setRecordName( parentTransMeta.environmentSubstitute( meta.getRecordName() ) ); data.output.setDocValue( parentTransMeta.environmentSubstitute( meta.getDocValue() ) ); if ( meta.getSchemaFilename() != null && meta.getSchemaFilename().length() != 0 ) { data.output.setSchemaFilename( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getSchemaFilename() ) ) ); } data.writer = data.output.createRecordWriter(); }
AvroOutput extends BaseStep implements StepInterface { public void init() throws Exception { if ( getTransMeta().getNamedClusterEmbedManager() != null ) { getTransMeta().getNamedClusterEmbedManager() .passEmbeddedMetastoreKey( getTransMeta(), getTransMeta().getEmbeddedMetastoreProviderKey() ); } NamedCluster namedCluster = getNamedCluster(); FormatService formatService; try { formatService = meta.getNamedClusterResolver().getNamedClusterServiceLocator() .getService( namedCluster, FormatService.class ); } catch ( ClusterInitializationException e ) { throw new KettleException( "can't get service format shim ", e ); } TransMeta parentTransMeta = meta.getParentStepMeta().getParentTransMeta(); data.output = formatService.createOutputFormat( IPentahoAvroOutputFormat.class, namedCluster ); data.output .setOutputFile( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getFilename() ) ), meta.isOverrideOutput() ); data.output.setFields( meta.getOutputFields() ); data.output.setVariableSpace( parentTransMeta ); IPentahoAvroOutputFormat.COMPRESSION compression; try { compression = IPentahoAvroOutputFormat.COMPRESSION .valueOf( parentTransMeta.environmentSubstitute( meta.getCompressionType() ).toUpperCase() ); } catch ( Exception ex ) { compression = IPentahoAvroOutputFormat.COMPRESSION.UNCOMPRESSED; } data.output.setCompression( compression ); data.output.setNameSpace( parentTransMeta.environmentSubstitute( meta.getNamespace() ) ); data.output.setRecordName( parentTransMeta.environmentSubstitute( meta.getRecordName() ) ); data.output.setDocValue( parentTransMeta.environmentSubstitute( meta.getDocValue() ) ); if ( meta.getSchemaFilename() != null && meta.getSchemaFilename().length() != 0 ) { data.output.setSchemaFilename( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getSchemaFilename() ) ) ); } data.writer = data.output.createRecordWriter(); } }
AvroOutput extends BaseStep implements StepInterface { public void init() throws Exception { if ( getTransMeta().getNamedClusterEmbedManager() != null ) { getTransMeta().getNamedClusterEmbedManager() .passEmbeddedMetastoreKey( getTransMeta(), getTransMeta().getEmbeddedMetastoreProviderKey() ); } NamedCluster namedCluster = getNamedCluster(); FormatService formatService; try { formatService = meta.getNamedClusterResolver().getNamedClusterServiceLocator() .getService( namedCluster, FormatService.class ); } catch ( ClusterInitializationException e ) { throw new KettleException( "can't get service format shim ", e ); } TransMeta parentTransMeta = meta.getParentStepMeta().getParentTransMeta(); data.output = formatService.createOutputFormat( IPentahoAvroOutputFormat.class, namedCluster ); data.output .setOutputFile( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getFilename() ) ), meta.isOverrideOutput() ); data.output.setFields( meta.getOutputFields() ); data.output.setVariableSpace( parentTransMeta ); IPentahoAvroOutputFormat.COMPRESSION compression; try { compression = IPentahoAvroOutputFormat.COMPRESSION .valueOf( parentTransMeta.environmentSubstitute( meta.getCompressionType() ).toUpperCase() ); } catch ( Exception ex ) { compression = IPentahoAvroOutputFormat.COMPRESSION.UNCOMPRESSED; } data.output.setCompression( compression ); data.output.setNameSpace( parentTransMeta.environmentSubstitute( meta.getNamespace() ) ); data.output.setRecordName( parentTransMeta.environmentSubstitute( meta.getRecordName() ) ); data.output.setDocValue( parentTransMeta.environmentSubstitute( meta.getDocValue() ) ); if ( meta.getSchemaFilename() != null && meta.getSchemaFilename().length() != 0 ) { data.output.setSchemaFilename( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getSchemaFilename() ) ) ); } data.writer = data.output.createRecordWriter(); } AvroOutput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
                     Trans trans ); }
AvroOutput extends BaseStep implements StepInterface { public void init() throws Exception { if ( getTransMeta().getNamedClusterEmbedManager() != null ) { getTransMeta().getNamedClusterEmbedManager() .passEmbeddedMetastoreKey( getTransMeta(), getTransMeta().getEmbeddedMetastoreProviderKey() ); } NamedCluster namedCluster = getNamedCluster(); FormatService formatService; try { formatService = meta.getNamedClusterResolver().getNamedClusterServiceLocator() .getService( namedCluster, FormatService.class ); } catch ( ClusterInitializationException e ) { throw new KettleException( "can't get service format shim ", e ); } TransMeta parentTransMeta = meta.getParentStepMeta().getParentTransMeta(); data.output = formatService.createOutputFormat( IPentahoAvroOutputFormat.class, namedCluster ); data.output .setOutputFile( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getFilename() ) ), meta.isOverrideOutput() ); data.output.setFields( meta.getOutputFields() ); data.output.setVariableSpace( parentTransMeta ); IPentahoAvroOutputFormat.COMPRESSION compression; try { compression = IPentahoAvroOutputFormat.COMPRESSION .valueOf( parentTransMeta.environmentSubstitute( meta.getCompressionType() ).toUpperCase() ); } catch ( Exception ex ) { compression = IPentahoAvroOutputFormat.COMPRESSION.UNCOMPRESSED; } data.output.setCompression( compression ); data.output.setNameSpace( parentTransMeta.environmentSubstitute( meta.getNamespace() ) ); data.output.setRecordName( parentTransMeta.environmentSubstitute( meta.getRecordName() ) ); data.output.setDocValue( parentTransMeta.environmentSubstitute( meta.getDocValue() ) ); if ( meta.getSchemaFilename() != null && meta.getSchemaFilename().length() != 0 ) { data.output.setSchemaFilename( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getSchemaFilename() ) ) ); } data.writer = data.output.createRecordWriter(); } AvroOutput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
                     Trans trans ); @Override synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); void init(); void closeWriter(); boolean init( StepMetaInterface smi, StepDataInterface sdi ); }
AvroOutput extends BaseStep implements StepInterface { public void init() throws Exception { if ( getTransMeta().getNamedClusterEmbedManager() != null ) { getTransMeta().getNamedClusterEmbedManager() .passEmbeddedMetastoreKey( getTransMeta(), getTransMeta().getEmbeddedMetastoreProviderKey() ); } NamedCluster namedCluster = getNamedCluster(); FormatService formatService; try { formatService = meta.getNamedClusterResolver().getNamedClusterServiceLocator() .getService( namedCluster, FormatService.class ); } catch ( ClusterInitializationException e ) { throw new KettleException( "can't get service format shim ", e ); } TransMeta parentTransMeta = meta.getParentStepMeta().getParentTransMeta(); data.output = formatService.createOutputFormat( IPentahoAvroOutputFormat.class, namedCluster ); data.output .setOutputFile( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getFilename() ) ), meta.isOverrideOutput() ); data.output.setFields( meta.getOutputFields() ); data.output.setVariableSpace( parentTransMeta ); IPentahoAvroOutputFormat.COMPRESSION compression; try { compression = IPentahoAvroOutputFormat.COMPRESSION .valueOf( parentTransMeta.environmentSubstitute( meta.getCompressionType() ).toUpperCase() ); } catch ( Exception ex ) { compression = IPentahoAvroOutputFormat.COMPRESSION.UNCOMPRESSED; } data.output.setCompression( compression ); data.output.setNameSpace( parentTransMeta.environmentSubstitute( meta.getNamespace() ) ); data.output.setRecordName( parentTransMeta.environmentSubstitute( meta.getRecordName() ) ); data.output.setDocValue( parentTransMeta.environmentSubstitute( meta.getDocValue() ) ); if ( meta.getSchemaFilename() != null && meta.getSchemaFilename().length() != 0 ) { data.output.setSchemaFilename( parentTransMeta.environmentSubstitute( meta.constructOutputFilename( meta.getSchemaFilename() ) ) ); } data.writer = data.output.createRecordWriter(); } AvroOutput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
                     Trans trans ); @Override synchronized boolean processRow( StepMetaInterface smi, StepDataInterface sdi ); void init(); void closeWriter(); boolean init( StepMetaInterface smi, StepDataInterface sdi );  }