/** * Build an empty row based on the meta-data... * * @return */ private Object[] buildEmptyRow() { Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() ); return rowData; }
/** * Build an empty row based on the meta-data. * * @return */ private Object[] buildEmptyRow() { Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() ); return rowData; }
/** * Build an empty row based on the meta-data... * * @return */ private Object[] buildEmptyRow() { Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() ); return rowData; }
/** * Build an empty row based on the meta-data... * * @return */ private Object[] buildEmptyRow() { Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() ); return rowData; }
/** * Build an empty row based on the meta-data... * * @return */ private Object[] buildEmptyRow() { Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() ); return rowData; }
/** * Build an empty row based on the meta-data... * * @return */ private Object[] buildEmptyRow() { Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() ); return rowData; }
/** * Build an empty row based on the meta-data... * * @return */ private Object[] buildEmptyRow() { Object[] rowData = RowDataUtil.allocateRowData( data.outputRowMeta.size() ); return rowData; }
private Object[] getHashValue() throws KettleValueException { Object[] groupDataHash = new Object[groupMeta.size()]; for ( int i = 0; i < groupMeta.size(); i++ ) { ValueMetaInterface valueMeta = groupMeta.getValueMeta( i ); groupDataHash[i] = valueMeta.convertToNormalStorageType( groupData[i] ); } return groupDataHash; } }
/** * Build an empty row based on the meta-data. * * @return empty row built */ private Object[] buildEmptyRow() { return RowDataUtil.allocateRowData( data.outputRowMeta.size() ); }
private Object[] addCounter( RowMetaInterface outputRowMeta, Object[] r, long count ) { if ( meta.isCountRows() ) { Object[] outputRow = RowDataUtil.addValueData( r, outputRowMeta.size() - 1, new Long( count ) ); return outputRow; } else { return r; // nothing to do } }
private static Integer getFieldIdx( RowMetaInterface rowMeta, String fieldName ) { if ( fieldName == null ) { return null; } for ( int i = 0; i < rowMeta.size(); i++ ) { String name = rowMeta.getValueMeta( i ).getName(); if ( fieldName.equals( name ) ) { return i; } } return null; }
private void init( RowMetaInterface rowMeta ) { int size = rowMeta.size(); conv = new KettleValueConverter[size]; for ( int colidx = 0; colidx < size; colidx++ ) { ValueMetaInterface meta = rowMeta.getValueMeta( colidx ); conv[colidx] = new KettleValueConverter( meta ); } } }
@Override public void rowWrittenEvent( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException { for ( int i = 0; i < rowMeta.size(); i++ ) { assertEquals( "Value", row[ i ] ); } } } );
public void oneMoreElement( Object element ) { final Object[] row = (Object[]) element; try { assert ( rowMeta.size() != row.length ); incrementLinesInput(); putRow( rowMeta, row ); } catch ( Exception ex ) { this.throwedException = ex; this.cancel(); } } };
@Before public void setUp() throws Exception { data.groupMeta = groupMeta; when( groupMeta.size() ).thenReturn( 1 ); when( groupMeta.getValueMeta( anyInt() ) ).thenReturn( valueMeta ); when( valueMeta.convertToNormalStorageType( anyObject() ) ).then( new Answer<Object>() { @Override public Object answer( InvocationOnMock invocation ) throws Throwable { Object argument = invocation.getArguments()[0]; return new String( (byte[]) argument ); } } ); }
public void addValue( ValueMetaInterface valueMeta, Object valueData ) { if ( valueMeta.isInteger() && ( valueData instanceof ObjectId ) ) { valueData = new LongObjectId( (ObjectId) valueData ).longValue(); } data = RowDataUtil.addValueData( data, rowMeta.size(), valueData ); rowMeta.addValueMeta( valueMeta ); }
@Test public void testCheckGoodPrev() { UnivariateStatsMeta meta = new UnivariateStatsMeta(); RowMetaInterface mockRowMetaInterface = mock( RowMetaInterface.class ); when( mockRowMetaInterface.size() ).thenReturn( 500 ); List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>(); meta.check( remarks, null, null, mockRowMetaInterface, new String[0], null, null, null, null, null ); assertEquals( 2, remarks.size() ); assertEquals( "Step is connected to previous one, receiving " + 500 + " fields", remarks.get( 0 ).getText() ); }
private void initReturnMeta() { // We also want to know the metadata of the return values beforehand (null handling) data.returnMeta = new RowMeta(); for ( int i = 0; i < meta.getReturnValueField().length; i++ ) { ValueMetaInterface v = data.outputRowMeta.getValueMeta( getInputRowMeta().size() + i ).clone(); data.returnMeta.addValueMeta( v ); } }
void checkAndWriteHeader() throws KettleStepException { // See if we have to write a header-line) if ( !meta.isFileAppended() && ( meta.isHeaderEnabled() || meta.isFooterEnabled() ) ) { if ( !meta.isFileNameInField() && meta.isHeaderEnabled() && data.outputRowMeta != null ) { writeHeader(); // add an empty line for the header Object[] row = new Object[ data.outputRowMeta.size() ]; putRowFromStream( row ); } } }