@Override public long getIdentifier(E entity) { return entity.getRowNumber(); }
@Override public int read() throws IOException { if (currentLine == null || currentReadLineIndex >= currentLine.length()) { if (rowIterator.hasNext()) { newLinePrinted = currentLine == null; currentReadLineIndex = 0; currentLine = rowIterator.next().toLine(); } else { return -1; } } if (!newLinePrinted) { newLinePrinted = true; return '\n'; } return currentLine.charAt(currentReadLineIndex++); } }
@Override public int read() throws IOException { if (currentLine == null || currentReadLineIndex >= currentLine.length()) { if (rowIterator.hasNext()) { newLinePrinted = currentLine == null; currentReadLineIndex = 0; currentLine = rowIterator.next().toLine(); } else { return -1; } } if (!newLinePrinted) { newLinePrinted = true; return '\n'; } return currentLine.charAt(currentReadLineIndex++); } }
private List<Object> tpchEntityToObjects(TpchEntity entity) { List<String> columnValues = SPLITTER.splitToList(entity.toLine()); QueryRowMapper queryRowMapper = new QueryRowMapper(columnTypes); List<String> valuesWithoutFinalBlank = columnValues.subList(0, columnValues.size() - 1); return queryRowMapper.mapToRow(valuesWithoutFinalBlank).getValues(); } }
@Override public long getIdentifier(E entity) { return entity.getRowNumber(); }
private List<Object> tpchEntityToObjects(TpchEntity entity) { List<String> columnValues = SPLITTER.splitToList(entity.toLine()); QueryRowMapper queryRowMapper = new QueryRowMapper(columnTypes); List<String> valuesWithoutFinalBlank = columnValues.subList(0, columnValues.size() - 1); return queryRowMapper.mapToRow(valuesWithoutFinalBlank).getValues(); } }
@Override public long getIdentifier(E entity) { return entity.getRowNumber(); }
private List<Object> tpchEntityToObjects(TpchEntity entity) { List<String> columnValues = SPLITTER.splitToList(entity.toLine()); QueryRowMapper queryRowMapper = new QueryRowMapper(columnTypes); List<String> valuesWithoutFinalBlank = columnValues.subList(0, columnValues.size() - 1); List<String> reallocatedList = remapList(valuesWithoutFinalBlank, mapping); return queryRowMapper.mapToRow(reallocatedList).getValues(); }
@Override public long getIdentifier(E entity) { return entity.getRowNumber(); }
private List<Object> tpchEntityToObjects(TpchEntity entity) { List<String> columnValues = SPLITTER.splitToList(entity.toLine()); QueryRowMapper queryRowMapper = new QueryRowMapper(columnTypes); List<String> valuesWithoutFinalBlank = columnValues.subList(0, columnValues.size() - 1); List<String> reallocatedList = remapList(valuesWithoutFinalBlank, mapping); return queryRowMapper.mapToRow(reallocatedList).getValues(); }
@Override public long getLong(E entity) { return entity.getRowNumber(); }
public static void assertEntityLinesMD5(Iterable<? extends TpchEntity> entities, String expectedMD5) { try { DigestOutputStream out = md5OutputStream(ByteStreams.nullOutputStream()); // out = md5OutputStream(System.out); for (TpchEntity entity : entities) { out.write(entity.toLine().getBytes(UTF_8)); out.write('\n'); } byte[] md5Digest = out.getMessageDigest().digest(); assertEquals(base16().lowerCase().encode(md5Digest), expectedMD5); } catch (IOException e) { throw new UncheckedIOException(e); } }