HdfsUtils { public static Object[] formatRecord(LinkConfiguration linkConfiguration, FromJobConfiguration fromJobConfiguration, Object[] record) { if (fromJobConfiguration.fromJobConfig.overrideNullValue != null && fromJobConfiguration.fromJobConfig.overrideNullValue) { for (int i = 0; i < record.length; ++i) { if (record[i] != null && record[i].equals(fromJobConfiguration.fromJobConfig.nullValue)) { record[i] = null; } } } return record; }  static Configuration createConfiguration(LinkConfiguration linkConfig); static void configurationToContext(Configuration configuration, MutableContext context); static void contextToConfiguration(ImmutableContext context, Configuration configuration); static Configuration configureURI(Configuration conf, LinkConfiguration linkConfiguration); static boolean hasCustomFormat(LinkConfiguration linkConfiguration, FromJobConfiguration fromJobConfiguration); static boolean hasCustomFormat(LinkConfiguration linkConfiguration, ToJobConfiguration toJobConfiguration); static Object[] formatRecord(LinkConfiguration linkConfiguration,
                                      FromJobConfiguration fromJobConfiguration,
                                      Object[] record); static Object[] formatRecord(LinkConfiguration linkConfiguration,
                                    ToJobConfiguration toJobConfiguration,
                                    Object[] record); static final String DEFAULT_HADOOP_CONF_DIR; }
@Test public void testTransformRecord() throws Exception { LinkConfiguration linkConfiguration = new LinkConfiguration(); FromJobConfiguration fromJobConfiguration = new FromJobConfiguration(); ToJobConfiguration toJobConfiguration = new ToJobConfiguration(); final Object[] fromRecord = new Object[]{ "'Abe'", "\0", "'test'" }; final Object[] toRecord = new Object[]{ "'Abe'", "\0", "'test'" }; assertArrayEquals(toRecord, HdfsUtils.formatRecord(linkConfiguration, fromJobConfiguration, fromRecord)); assertArrayEquals(fromRecord, HdfsUtils.formatRecord(linkConfiguration, toJobConfiguration, toRecord)); }