@Override public void getFields( RowMetaInterface rowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space ) throws KettleStepException { rowMeta.clear(); // start afresh - eats the input if ( m_mapping != null ) { int kettleType; if ( m_mapping.getKeyType() == Mapping.KeyType.DATE || m_mapping.getKeyType() == Mapping.KeyType.UNSIGNED_DATE ) { kettleType = ValueMetaInterface.TYPE_DATE; } else if ( m_mapping.getKeyType() == Mapping.KeyType.STRING ) { kettleType = ValueMetaInterface.TYPE_STRING; } else if ( m_mapping.getKeyType() == Mapping.KeyType.BINARY ) { kettleType = ValueMetaInterface.TYPE_BINARY; } else { kettleType = ValueMetaInterface.TYPE_INTEGER; } ValueMetaInterface keyMeta = new ValueMeta( m_mapping.getKeyName(), kettleType ); keyMeta.setOrigin( origin ); rowMeta.addValueMeta( keyMeta ); // Add the rest of the fields in the mapping Map<String, HBaseValueMetaInterface> mappedColumnsByAlias = m_mapping.getMappedColumns(); Set<String> aliasSet = mappedColumnsByAlias.keySet(); for ( String alias : aliasSet ) { HBaseValueMetaInterface columnMeta = mappedColumnsByAlias.get( alias ); columnMeta.setOrigin( origin ); rowMeta.addValueMeta( columnMeta ); } } }
String tableName = theMapping.getTableName(); String mappingName = theMapping.getMappingName(); Map<String, HBaseValueMetaInterface> mapping = theMapping.getMappedColumns(); String keyName = theMapping.getKeyName(); Mapping.KeyType keyType = theMapping.getKeyType();
Map<String, HBaseValueMetaInterface> mappedColumnsByAlias = m_cachedMapping.getMappedColumns(); Set<String> aliasSet = mappedColumnsByAlias.keySet(); for ( String alias : aliasSet ) {
if ( theMapping.getMappedColumns().size() == 0 ) { MessageDialog.openError( m_shell, "No columns defined", "A HBase table requires at least one column family to be defined." ); Set<String> cols = theMapping.getMappedColumns().keySet(); Set<String> families = new TreeSet<String>(); for ( String col : cols ) { String family = theMapping.getMappedColumns().get( col ).getColumnFamily(); families.add( family );
static List<HBaseValueMetaInterface> createOutputFieldsDefinition( List<OutputFieldDefinition> outputFieldsDefinition, Mapping m_mapping, HBaseService hBaseService ) { HBaseValueMetaInterfaceFactory valueMetaInterfaceFactory = hBaseService.getHBaseValueMetaInterfaceFactory(); ByteConversionUtil byteConversionUtil = hBaseService.getByteConversionUtil(); List<HBaseValueMetaInterface> outputFields = new ArrayList<>(); Map<String, HBaseValueMetaInterface> columns = m_mapping.getMappedColumns(); for ( OutputFieldDefinition fieldDefinition : outputFieldsDefinition ) { HBaseValueMetaInterface valueMeta = valueMetaInterfaceFactory.createHBaseValueMetaInterface( fieldDefinition.getFamily(), fieldDefinition .getColumnName(), fieldDefinition.getAlias(), ValueMeta.getType( fieldDefinition.getHbaseType() ), -1, -1 ); valueMeta.setKey( fieldDefinition.isKey() ); valueMeta.setConversionMask( fieldDefinition.getFormat() ); HBaseValueMetaInterface mappedColumn = columns.get( fieldDefinition.getAlias() ); if ( mappedColumn != null && mappedColumn.getIndex() != null ) { Object[] indexVal = mappedColumn.getIndex(); String indexStrign = byteConversionUtil.objectIndexValuesToString( indexVal ); Object[] vals = byteConversionUtil.stringIndexListToObjects( indexStrign ); valueMeta.setIndex( vals ); valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_INDEXED ); } outputFields.add( valueMeta ); } return outputFields; }
m_outputColumns = new HBaseValueMetaInterface[m_tableMapping.getMappedColumns().keySet().size()]; int k = 0; for ( String alias : m_tableMapping.getMappedColumns().keySet() ) { m_outputColumns[k++] = m_tableMapping.getMappedColumns().get( alias ); List<Object[]> hrowToKettleRow = m_tupleHandler.hbaseRowToKettleTupleMode( hBaseService.getHBaseValueMetaInterfaceFactory(), hRow, m_tableMapping, m_tableMapping .getMappedColumns(), m_data.getOutputRowMeta() );
m_keyInfo.setText( "HBase Key: " + m_keyName + " (" + m_keyType.toString() + ")" ); mappedColumns = current.getMappedColumns();
m_columnsMappedByAlias = m_tableMapping.getMappedColumns();
exception.printStackTrace(); m_columnsMappedByAlias = m_tableMapping.getMappedColumns();
Map<String, HBaseValueMetaInterface> mappedFields = mapping.getMappedColumns(); for ( String alias : mappedFields.keySet() ) { HBaseValueMetaInterface vm = mappedFields.get( alias );