@Test public void testBuildNonKeyValueMeta() throws KettleException { HBaseService hBaseService = mock( HBaseService.class ); ByteConversionUtil byteConversionUtil = mock( ByteConversionUtil.class ); when( hBaseService.getByteConversionUtil() ).thenReturn( byteConversionUtil ); HBaseValueMetaInterfaceFactory valueMetaInterfaceFactory = mock( HBaseValueMetaInterfaceFactory.class ); when( hBaseService.getHBaseValueMetaInterfaceFactory() ).thenReturn( valueMetaInterfaceFactory ); HBaseValueMetaInterface valueMeta = mock( HBaseValueMetaInterface.class ); when( valueMeta.isString() ).thenReturn( true ); when( valueMetaInterfaceFactory.createHBaseValueMetaInterface( same( "FAMILY" ), same( "COLUMN_NAME" ), same( "ALIAS" ), anyInt(), anyInt(), anyInt() ) ).thenReturn( valueMeta ); HBaseValueMetaInterface column = MappingUtils.buildNonKeyValueMeta( "ALIAS", "FAMILY", "COLUMN_NAME", STRING_TYPE, "INDEXED_VALS", hBaseService ); assertNotNull( column ); verify( valueMeta ).setHBaseTypeFromString( STRING_TYPE ); verify( valueMeta ).setStorageType( ValueMetaInterface.STORAGE_TYPE_INDEXED ); }
public static HBaseValueMetaInterface buildNonKeyValueMeta( String alias, String family, String columnName, String type, String indexedVals, HBaseService hBaseService ) throws KettleException { HBaseValueMetaInterfaceFactory valueMetaInterfaceFactory = hBaseService.getHBaseValueMetaInterfaceFactory(); HBaseValueMetaInterface valueMeta = valueMetaInterfaceFactory.createHBaseValueMetaInterface( family, columnName, alias, 0, UNDEFINED_VALUE, UNDEFINED_VALUE ); try { valueMeta.setHBaseTypeFromString( type ); if ( valueMeta.isString() && !Const.isEmpty( indexedVals ) ) { ByteConversionUtil byteConversionUtil = hBaseService.getByteConversionUtil(); Object[] vals = byteConversionUtil.stringIndexListToObjects( indexedVals ); valueMeta.setIndex( vals ); valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_INDEXED ); } return valueMeta; } catch ( IllegalArgumentException e ) { throw new KettleException( e ); } }
MappingUtils { public static HBaseValueMetaInterface buildNonKeyValueMeta( String alias, String family, String columnName, String type, String indexedVals, HBaseService hBaseService ) throws KettleException { HBaseValueMetaInterfaceFactory valueMetaInterfaceFactory = hBaseService.getHBaseValueMetaInterfaceFactory(); HBaseValueMetaInterface valueMeta = valueMetaInterfaceFactory.createHBaseValueMetaInterface( family, columnName, alias, 0, UNDEFINED_VALUE, UNDEFINED_VALUE ); try { valueMeta.setHBaseTypeFromString( type ); if ( valueMeta.isString() && !Const.isEmpty( indexedVals ) ) { ByteConversionUtil byteConversionUtil = hBaseService.getByteConversionUtil(); Object[] vals = byteConversionUtil.stringIndexListToObjects( indexedVals ); valueMeta.setIndex( vals ); valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_INDEXED ); } return valueMeta; } catch ( IllegalArgumentException e ) { throw new KettleException( e ); } } }
MappingUtils { public static HBaseValueMetaInterface buildNonKeyValueMeta( String alias, String family, String columnName, String type, String indexedVals, HBaseService hBaseService ) throws KettleException { HBaseValueMetaInterfaceFactory valueMetaInterfaceFactory = hBaseService.getHBaseValueMetaInterfaceFactory(); HBaseValueMetaInterface valueMeta = valueMetaInterfaceFactory.createHBaseValueMetaInterface( family, columnName, alias, 0, UNDEFINED_VALUE, UNDEFINED_VALUE ); try { valueMeta.setHBaseTypeFromString( type ); if ( valueMeta.isString() && !Const.isEmpty( indexedVals ) ) { ByteConversionUtil byteConversionUtil = hBaseService.getByteConversionUtil(); Object[] vals = byteConversionUtil.stringIndexListToObjects( indexedVals ); valueMeta.setIndex( vals ); valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_INDEXED ); } return valueMeta; } catch ( IllegalArgumentException e ) { throw new KettleException( e ); } }  }
MappingUtils { public static HBaseValueMetaInterface buildNonKeyValueMeta( String alias, String family, String columnName, String type, String indexedVals, HBaseService hBaseService ) throws KettleException { HBaseValueMetaInterfaceFactory valueMetaInterfaceFactory = hBaseService.getHBaseValueMetaInterfaceFactory(); HBaseValueMetaInterface valueMeta = valueMetaInterfaceFactory.createHBaseValueMetaInterface( family, columnName, alias, 0, UNDEFINED_VALUE, UNDEFINED_VALUE ); try { valueMeta.setHBaseTypeFromString( type ); if ( valueMeta.isString() && !Const.isEmpty( indexedVals ) ) { ByteConversionUtil byteConversionUtil = hBaseService.getByteConversionUtil(); Object[] vals = byteConversionUtil.stringIndexListToObjects( indexedVals ); valueMeta.setIndex( vals ); valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_INDEXED ); } return valueMeta; } catch ( IllegalArgumentException e ) { throw new KettleException( e ); } }  static MappingAdmin getMappingAdmin( ConfigurationProducer cProducer ); static MappingAdmin getMappingAdmin( HBaseService hBaseService, VariableSpace variableSpace, String siteConfig,
      String defaultConfig ); static Mapping getMapping( MappingDefinition mappingDefinition, HBaseService hBaseService ); static HBaseValueMetaInterface buildNonKeyValueMeta( String alias, String family, String columnName,
      String type, String indexedVals, HBaseService hBaseService ); static boolean isTupleMapping( MappingDefinition mappingDefinition ); static boolean isTupleMappingColumn( String columnName ); }
MappingUtils { public static HBaseValueMetaInterface buildNonKeyValueMeta( String alias, String family, String columnName, String type, String indexedVals, HBaseService hBaseService ) throws KettleException { HBaseValueMetaInterfaceFactory valueMetaInterfaceFactory = hBaseService.getHBaseValueMetaInterfaceFactory(); HBaseValueMetaInterface valueMeta = valueMetaInterfaceFactory.createHBaseValueMetaInterface( family, columnName, alias, 0, UNDEFINED_VALUE, UNDEFINED_VALUE ); try { valueMeta.setHBaseTypeFromString( type ); if ( valueMeta.isString() && !Const.isEmpty( indexedVals ) ) { ByteConversionUtil byteConversionUtil = hBaseService.getByteConversionUtil(); Object[] vals = byteConversionUtil.stringIndexListToObjects( indexedVals ); valueMeta.setIndex( vals ); valueMeta.setStorageType( ValueMetaInterface.STORAGE_TYPE_INDEXED ); } return valueMeta; } catch ( IllegalArgumentException e ) { throw new KettleException( e ); } }  static MappingAdmin getMappingAdmin( ConfigurationProducer cProducer ); static MappingAdmin getMappingAdmin( HBaseService hBaseService, VariableSpace variableSpace, String siteConfig,
      String defaultConfig ); static Mapping getMapping( MappingDefinition mappingDefinition, HBaseService hBaseService ); static HBaseValueMetaInterface buildNonKeyValueMeta( String alias, String family, String columnName,
      String type, String indexedVals, HBaseService hBaseService ); static boolean isTupleMapping( MappingDefinition mappingDefinition ); static boolean isTupleMappingColumn( String columnName ); static final int TUPLE_COLUMNS_COUNT; static final int UNDEFINED_VALUE; static final String TUPLE_MAPPING_VISIBILITY; }