@Test public void testToString() { List<OneField> oneFields = Arrays.asList(new OneField(1, "uno"), new OneField(2, "dos"), new OneField(3, "tres")); assertEquals("uno!dos!tres", HdfsUtilities.toString(oneFields, "!")); assertEquals("uno", HdfsUtilities.toString(Collections.singletonList(oneFields.get(0)), "!")); assertEquals("", HdfsUtilities.toString(Collections.emptyList(), "!")); }
public static String toString(List<OneField> complexRecord, String delimiter) { StringBuilder buff = new StringBuilder(); String delim = ""; if (complexRecord == null) return ""; for (OneField complex : complexRecord) { if (complex.type == DataType.BYTEA.getOID()) { buff.append(delim); Utilities.byteArrayToOctalString((byte[]) complex.val, buff); } else { buff.append(delim).append(complex.val); } delim = delimiter; } return buff.toString(); }
HdfsUtilities { public static String toString(List<OneField> complexRecord, String delimiter) { StringBuilder buff = new StringBuilder(); String delim = ""; if (complexRecord == null) return ""; for (OneField complex : complexRecord) { if (complex.type == DataType.BYTEA.getOID()) { buff.append(delim); Utilities.byteArrayToOctalString((byte[]) complex.val, buff); } else { buff.append(delim).append(complex.val); } delim = delimiter; } return buff.toString(); } }
HdfsUtilities { public static String toString(List<OneField> complexRecord, String delimiter) { StringBuilder buff = new StringBuilder(); String delim = ""; if (complexRecord == null) return ""; for (OneField complex : complexRecord) { if (complex.type == DataType.BYTEA.getOID()) { buff.append(delim); Utilities.byteArrayToOctalString((byte[]) complex.val, buff); } else { buff.append(delim).append(complex.val); } delim = delimiter; } return buff.toString(); }  }
HdfsUtilities { public static String toString(List<OneField> complexRecord, String delimiter) { StringBuilder buff = new StringBuilder(); String delim = ""; if (complexRecord == null) return ""; for (OneField complex : complexRecord) { if (complex.type == DataType.BYTEA.getOID()) { buff.append(delim); Utilities.byteArrayToOctalString((byte[]) complex.val, buff); } else { buff.append(delim).append(complex.val); } delim = delimiter; } return buff.toString(); }  static byte[] prepareFragmentMetadata(FileSplit fsp); static byte[] prepareFragmentMetadata(long start, long length, String[] locations); static FileSplit parseFileSplit(RequestContext requestContext); static void validateFile(Path file, FileSystem fs); static String toString(List<OneField> complexRecord, String delimiter); }
HdfsUtilities { public static String toString(List<OneField> complexRecord, String delimiter) { StringBuilder buff = new StringBuilder(); String delim = ""; if (complexRecord == null) return ""; for (OneField complex : complexRecord) { if (complex.type == DataType.BYTEA.getOID()) { buff.append(delim); Utilities.byteArrayToOctalString((byte[]) complex.val, buff); } else { buff.append(delim).append(complex.val); } delim = delimiter; } return buff.toString(); }  static byte[] prepareFragmentMetadata(FileSplit fsp); static byte[] prepareFragmentMetadata(long start, long length, String[] locations); static FileSplit parseFileSplit(RequestContext requestContext); static void validateFile(Path file, FileSystem fs); static String toString(List<OneField> complexRecord, String delimiter);  }