@Test public void testSaveRep() throws KettleException { meta.setInputFields( Arrays.asList( field ) ); meta.saveRep( rep, metaStore, id_transformation, id_step ); verify( meta ).getDataLocation(); verify( meta ).getSchemaLocation(); verify( field ).getAvroFieldName(); verify( field ).getPentahoFieldName(); verify( field ).getTypeDesc(); }
@Override public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException { try { rep.saveStepAttribute( id_transformation, id_step, "passing_through_fields", passingThruFields ); rep.saveStepAttribute( id_transformation, id_step, "dataLocation", getDataLocation() ); rep.saveStepAttribute( id_transformation, id_step, "sourceFormat", getFormat() ); rep.saveStepAttribute( id_transformation, id_step, "dataLocationType", dataLocationType ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocation", getSchemaLocation() ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocationType", schemaLocationType ); rep.saveStepAttribute( id_transformation, id_step, "isCacheSchemas", isCacheSchemas() ); rep.saveStepAttribute( id_transformation, id_step, "allowNullForMissingFields", isAllowNullForMissingFields() ); for ( int i = 0; i < inputFields.length; i++ ) { AvroInputField field = inputFields[ i ]; rep.saveStepAttribute( id_transformation, id_step, i, "path", field.getAvroFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getPentahoFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getTypeDesc() ); AvroSpec.DataType avroDataType = field.getAvroType(); if ( avroDataType != null && !avroDataType.equals( AvroSpec.DataType.NULL ) ) { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", avroDataType.getName() ); } else { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", AvroTypeConverter.convertToAvroType( field.getTypeDesc() ) ); } if ( field.getStringFormat() != null ) { rep.saveStepAttribute( id_transformation, id_step, i, "format", field.getStringFormat() ); } String indexedValues = field.getIndexedValues(); if ( indexedValues != null && indexedValues.length() > 0 ) { rep.saveStepAttribute( id_transformation, id_step, i, "indexed_vals", indexedValues ); } } for ( int i = 0; i < lookupFields.size(); i++ ) { AvroLookupField field = lookupFields.get( i ); rep.saveStepAttribute( id_transformation, id_step, i, "fieldName", field.getFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "variableName", field.getVariableName() ); rep.saveStepAttribute( id_transformation, id_step, i, "defaultValue", field.getDefaultValue() ); } super.saveRep( rep, metaStore, id_transformation, id_step ); } catch ( Exception e ) { throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e ); } }
AvroInputMetaBase extends BaseStepMeta implements StepMetaInterface, ResolvableResource { @Override public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException { try { rep.saveStepAttribute( id_transformation, id_step, "passing_through_fields", passingThruFields ); rep.saveStepAttribute( id_transformation, id_step, "dataLocation", getDataLocation() ); rep.saveStepAttribute( id_transformation, id_step, "sourceFormat", getFormat() ); rep.saveStepAttribute( id_transformation, id_step, "dataLocationType", dataLocationType ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocation", getSchemaLocation() ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocationType", schemaLocationType ); rep.saveStepAttribute( id_transformation, id_step, "isCacheSchemas", isCacheSchemas() ); rep.saveStepAttribute( id_transformation, id_step, "allowNullForMissingFields", isAllowNullForMissingFields() ); for ( int i = 0; i < inputFields.length; i++ ) { AvroInputField field = inputFields[ i ]; rep.saveStepAttribute( id_transformation, id_step, i, "path", field.getAvroFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getPentahoFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getTypeDesc() ); AvroSpec.DataType avroDataType = field.getAvroType(); if ( avroDataType != null && !avroDataType.equals( AvroSpec.DataType.NULL ) ) { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", avroDataType.getName() ); } else { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", AvroTypeConverter.convertToAvroType( field.getTypeDesc() ) ); } if ( field.getStringFormat() != null ) { rep.saveStepAttribute( id_transformation, id_step, i, "format", field.getStringFormat() ); } String indexedValues = field.getIndexedValues(); if ( indexedValues != null && indexedValues.length() > 0 ) { rep.saveStepAttribute( id_transformation, id_step, i, "indexed_vals", indexedValues ); } } for ( int i = 0; i < lookupFields.size(); i++ ) { AvroLookupField field = lookupFields.get( i ); rep.saveStepAttribute( id_transformation, id_step, i, "fieldName", field.getFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "variableName", field.getVariableName() ); rep.saveStepAttribute( id_transformation, id_step, i, "defaultValue", field.getDefaultValue() ); } super.saveRep( rep, metaStore, id_transformation, id_step ); } catch ( Exception e ) { throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e ); } } }
AvroInputMetaBase extends BaseStepMeta implements StepMetaInterface, ResolvableResource { @Override public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException { try { rep.saveStepAttribute( id_transformation, id_step, "passing_through_fields", passingThruFields ); rep.saveStepAttribute( id_transformation, id_step, "dataLocation", getDataLocation() ); rep.saveStepAttribute( id_transformation, id_step, "sourceFormat", getFormat() ); rep.saveStepAttribute( id_transformation, id_step, "dataLocationType", dataLocationType ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocation", getSchemaLocation() ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocationType", schemaLocationType ); rep.saveStepAttribute( id_transformation, id_step, "isCacheSchemas", isCacheSchemas() ); rep.saveStepAttribute( id_transformation, id_step, "allowNullForMissingFields", isAllowNullForMissingFields() ); for ( int i = 0; i < inputFields.length; i++ ) { AvroInputField field = inputFields[ i ]; rep.saveStepAttribute( id_transformation, id_step, i, "path", field.getAvroFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getPentahoFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getTypeDesc() ); AvroSpec.DataType avroDataType = field.getAvroType(); if ( avroDataType != null && !avroDataType.equals( AvroSpec.DataType.NULL ) ) { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", avroDataType.getName() ); } else { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", AvroTypeConverter.convertToAvroType( field.getTypeDesc() ) ); } if ( field.getStringFormat() != null ) { rep.saveStepAttribute( id_transformation, id_step, i, "format", field.getStringFormat() ); } String indexedValues = field.getIndexedValues(); if ( indexedValues != null && indexedValues.length() > 0 ) { rep.saveStepAttribute( id_transformation, id_step, i, "indexed_vals", indexedValues ); } } for ( int i = 0; i < lookupFields.size(); i++ ) { AvroLookupField field = lookupFields.get( i ); rep.saveStepAttribute( id_transformation, id_step, i, "fieldName", field.getFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "variableName", field.getVariableName() ); rep.saveStepAttribute( id_transformation, id_step, i, "defaultValue", field.getDefaultValue() ); } super.saveRep( rep, metaStore, id_transformation, id_step ); } catch ( Exception e ) { throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e ); } }  }
AvroInputMetaBase extends BaseStepMeta implements StepMetaInterface, ResolvableResource { @Override public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException { try { rep.saveStepAttribute( id_transformation, id_step, "passing_through_fields", passingThruFields ); rep.saveStepAttribute( id_transformation, id_step, "dataLocation", getDataLocation() ); rep.saveStepAttribute( id_transformation, id_step, "sourceFormat", getFormat() ); rep.saveStepAttribute( id_transformation, id_step, "dataLocationType", dataLocationType ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocation", getSchemaLocation() ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocationType", schemaLocationType ); rep.saveStepAttribute( id_transformation, id_step, "isCacheSchemas", isCacheSchemas() ); rep.saveStepAttribute( id_transformation, id_step, "allowNullForMissingFields", isAllowNullForMissingFields() ); for ( int i = 0; i < inputFields.length; i++ ) { AvroInputField field = inputFields[ i ]; rep.saveStepAttribute( id_transformation, id_step, i, "path", field.getAvroFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getPentahoFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getTypeDesc() ); AvroSpec.DataType avroDataType = field.getAvroType(); if ( avroDataType != null && !avroDataType.equals( AvroSpec.DataType.NULL ) ) { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", avroDataType.getName() ); } else { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", AvroTypeConverter.convertToAvroType( field.getTypeDesc() ) ); } if ( field.getStringFormat() != null ) { rep.saveStepAttribute( id_transformation, id_step, i, "format", field.getStringFormat() ); } String indexedValues = field.getIndexedValues(); if ( indexedValues != null && indexedValues.length() > 0 ) { rep.saveStepAttribute( id_transformation, id_step, i, "indexed_vals", indexedValues ); } } for ( int i = 0; i < lookupFields.size(); i++ ) { AvroLookupField field = lookupFields.get( i ); rep.saveStepAttribute( id_transformation, id_step, i, "fieldName", field.getFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "variableName", field.getVariableName() ); rep.saveStepAttribute( id_transformation, id_step, i, "defaultValue", field.getDefaultValue() ); } super.saveRep( rep, metaStore, id_transformation, id_step ); } catch ( Exception e ) { throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e ); } }  List<AvroLookupField> getLookupFields(); void setLookupFields( List<AvroLookupField> lookupFields ); String getDataLocation(); void setDataLocation( String dataLocation, LocationDescriptor locationDescriptor ); LocationDescriptor getDataLocationType(); void setFormat( int formatIndex ); int getFormat(); String getSchemaLocation(); void setSchemaLocation( String schemaLocation, LocationDescriptor locationDescriptor ); @Override void setDefault(); LocationDescriptor getSchemaLocationType(); boolean isCacheSchemas(); void setCacheSchemas( boolean cacheSchemas ); boolean isAllowNullForMissingFields(); void setAllowNullForMissingFields( boolean allowNullForMissingFields ); String getEncoding(); AvroInputField[] getInputFields(); void setInputFields( AvroInputField[] inputFields ); void setInputFields( List<AvroInputField> inputFields ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override String getXML(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override void resolve(); @Injection( name = "AVRO_FILENAME" ) @Deprecated void setDataFileName( String fileName ); @Injection( name = "STREAM_FIELDNAME" ) @Deprecated void setDataFieldName( String fieldName ); @Injection( name = "SCHEMA_FILENAME" ) @Deprecated void setSchemaFileName( String fileName ); }
AvroInputMetaBase extends BaseStepMeta implements StepMetaInterface, ResolvableResource { @Override public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException { try { rep.saveStepAttribute( id_transformation, id_step, "passing_through_fields", passingThruFields ); rep.saveStepAttribute( id_transformation, id_step, "dataLocation", getDataLocation() ); rep.saveStepAttribute( id_transformation, id_step, "sourceFormat", getFormat() ); rep.saveStepAttribute( id_transformation, id_step, "dataLocationType", dataLocationType ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocation", getSchemaLocation() ); rep.saveStepAttribute( id_transformation, id_step, "schemaLocationType", schemaLocationType ); rep.saveStepAttribute( id_transformation, id_step, "isCacheSchemas", isCacheSchemas() ); rep.saveStepAttribute( id_transformation, id_step, "allowNullForMissingFields", isAllowNullForMissingFields() ); for ( int i = 0; i < inputFields.length; i++ ) { AvroInputField field = inputFields[ i ]; rep.saveStepAttribute( id_transformation, id_step, i, "path", field.getAvroFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "name", field.getPentahoFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "type", field.getTypeDesc() ); AvroSpec.DataType avroDataType = field.getAvroType(); if ( avroDataType != null && !avroDataType.equals( AvroSpec.DataType.NULL ) ) { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", avroDataType.getName() ); } else { rep.saveStepAttribute( id_transformation, id_step, i, "avro_type", AvroTypeConverter.convertToAvroType( field.getTypeDesc() ) ); } if ( field.getStringFormat() != null ) { rep.saveStepAttribute( id_transformation, id_step, i, "format", field.getStringFormat() ); } String indexedValues = field.getIndexedValues(); if ( indexedValues != null && indexedValues.length() > 0 ) { rep.saveStepAttribute( id_transformation, id_step, i, "indexed_vals", indexedValues ); } } for ( int i = 0; i < lookupFields.size(); i++ ) { AvroLookupField field = lookupFields.get( i ); rep.saveStepAttribute( id_transformation, id_step, i, "fieldName", field.getFieldName() ); rep.saveStepAttribute( id_transformation, id_step, i, "variableName", field.getVariableName() ); rep.saveStepAttribute( id_transformation, id_step, i, "defaultValue", field.getDefaultValue() ); } super.saveRep( rep, metaStore, id_transformation, id_step ); } catch ( Exception e ) { throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e ); } }  List<AvroLookupField> getLookupFields(); void setLookupFields( List<AvroLookupField> lookupFields ); String getDataLocation(); void setDataLocation( String dataLocation, LocationDescriptor locationDescriptor ); LocationDescriptor getDataLocationType(); void setFormat( int formatIndex ); int getFormat(); String getSchemaLocation(); void setSchemaLocation( String schemaLocation, LocationDescriptor locationDescriptor ); @Override void setDefault(); LocationDescriptor getSchemaLocationType(); boolean isCacheSchemas(); void setCacheSchemas( boolean cacheSchemas ); boolean isAllowNullForMissingFields(); void setAllowNullForMissingFields( boolean allowNullForMissingFields ); String getEncoding(); AvroInputField[] getInputFields(); void setInputFields( AvroInputField[] inputFields ); void setInputFields( List<AvroInputField> inputFields ); @Override void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore ); @Override String getXML(); @Override void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ); @Override void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); @Override void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
                         VariableSpace space, Repository repository, IMetaStore metaStore ); @Override void resolve(); @Injection( name = "AVRO_FILENAME" ) @Deprecated void setDataFileName( String fileName ); @Injection( name = "STREAM_FIELDNAME" ) @Deprecated void setDataFieldName( String fieldName ); @Injection( name = "SCHEMA_FILENAME" ) @Deprecated void setSchemaFileName( String fileName ); static final Class<?> PKG; @Injection( name = "DATA_LOCATION_TYPE" )
  @VisibleForTesting
  public int dataLocationType; @Injection( name = "PASS_THROUGH_FIELDS" )
  public boolean passingThruFields; @InjectionDeep
  public AvroInputField[] inputFields; }