@Test public void testInit() throws KettleException { String name = "hadoopExitMeta"; String outKeyFieldName = "outKeyFieldName"; String outValueFieldName = "outValueFieldName"; RowMetaInterface outputRowMeta = mock( RowMetaInterface.class ); HadoopExitMeta hadoopExitMeta = mock( HadoopExitMeta.class ); when( hadoopExitMeta.getName() ).thenReturn( name ); when( hadoopExitMeta.getOutKeyFieldname() ).thenReturn( outKeyFieldName ); when( hadoopExitMeta.getOutValueFieldname() ).thenReturn( outValueFieldName ); VariableSpace space = mock( VariableSpace.class ); when( rowMetaInterface.clone() ).thenReturn( outputRowMeta ); when( rowMetaInterface.indexOfValue( outKeyFieldName ) ).thenReturn( 5 ); when( rowMetaInterface.indexOfValue( outValueFieldName ) ).thenReturn( 6 ); hadoopExitData.init( rowMetaInterface, hadoopExitMeta, space ); assertEquals( outputRowMeta, hadoopExitData.getOutputRowMeta() ); verify( hadoopExitMeta ).getFields( outputRowMeta, name, null, null, space ); assertEquals( 5, hadoopExitData.getInKeyOrdinal() ); assertEquals( 6, hadoopExitData.getInValueOrdinal() ); }
public void init( RowMetaInterface rowMeta, HadoopExitMeta stepMeta, VariableSpace space ) throws KettleException { if ( rowMeta != null ) { outputRowMeta = rowMeta.clone(); stepMeta.getFields( outputRowMeta, stepMeta.getName(), null, null, space ); setInKeyOrdinal( rowMeta.indexOfValue( stepMeta.getOutKeyFieldname() ) ); setInValueOrdinal( rowMeta.indexOfValue( stepMeta.getOutValueFieldname() ) ); } }
HadoopExitData extends BaseStepData implements StepDataInterface { public void init( RowMetaInterface rowMeta, HadoopExitMeta stepMeta, VariableSpace space ) throws KettleException { if ( rowMeta != null ) { outputRowMeta = rowMeta.clone(); stepMeta.getFields( outputRowMeta, stepMeta.getName(), null, null, space ); setInKeyOrdinal( rowMeta.indexOfValue( stepMeta.getOutKeyFieldname() ) ); setInValueOrdinal( rowMeta.indexOfValue( stepMeta.getOutValueFieldname() ) ); } } }
HadoopExitData extends BaseStepData implements StepDataInterface { public void init( RowMetaInterface rowMeta, HadoopExitMeta stepMeta, VariableSpace space ) throws KettleException { if ( rowMeta != null ) { outputRowMeta = rowMeta.clone(); stepMeta.getFields( outputRowMeta, stepMeta.getName(), null, null, space ); setInKeyOrdinal( rowMeta.indexOfValue( stepMeta.getOutKeyFieldname() ) ); setInValueOrdinal( rowMeta.indexOfValue( stepMeta.getOutValueFieldname() ) ); } } HadoopExitData(); }
HadoopExitData extends BaseStepData implements StepDataInterface { public void init( RowMetaInterface rowMeta, HadoopExitMeta stepMeta, VariableSpace space ) throws KettleException { if ( rowMeta != null ) { outputRowMeta = rowMeta.clone(); stepMeta.getFields( outputRowMeta, stepMeta.getName(), null, null, space ); setInKeyOrdinal( rowMeta.indexOfValue( stepMeta.getOutKeyFieldname() ) ); setInValueOrdinal( rowMeta.indexOfValue( stepMeta.getOutValueFieldname() ) ); } } HadoopExitData(); void init( RowMetaInterface rowMeta, HadoopExitMeta stepMeta, VariableSpace space ); RowMetaInterface getOutputRowMeta(); void setInKeyOrdinal( int inKeyOrdinal ); int getInKeyOrdinal(); void setInValueOrdinal( int inValueOrdinal ); int getInValueOrdinal(); static int getOutKeyOrdinal(); static int getOutValueOrdinal(); }
HadoopExitData extends BaseStepData implements StepDataInterface { public void init( RowMetaInterface rowMeta, HadoopExitMeta stepMeta, VariableSpace space ) throws KettleException { if ( rowMeta != null ) { outputRowMeta = rowMeta.clone(); stepMeta.getFields( outputRowMeta, stepMeta.getName(), null, null, space ); setInKeyOrdinal( rowMeta.indexOfValue( stepMeta.getOutKeyFieldname() ) ); setInValueOrdinal( rowMeta.indexOfValue( stepMeta.getOutValueFieldname() ) ); } } HadoopExitData(); void init( RowMetaInterface rowMeta, HadoopExitMeta stepMeta, VariableSpace space ); RowMetaInterface getOutputRowMeta(); void setInKeyOrdinal( int inKeyOrdinal ); int getInKeyOrdinal(); void setInValueOrdinal( int inValueOrdinal ); int getInValueOrdinal(); static int getOutKeyOrdinal(); static int getOutValueOrdinal(); static final int outKeyOrdinal; static final int outValueOrdinal; }