Skip to content

Commit cbc295f

Browse files
Manny-opdl239
authored andcommitted
fix: print import rows count after finished (4paradigm#1401)
Made integer variable within while loop that reads lines. After loop finishes, uses System.out.println to output the number.
1 parent 723aa23 commit cbc295f

File tree

1 file changed

+5
-1
lines changed
  • java/openmldb-import/src/main/java/com/_4paradigm/openmldb/importer

1 file changed

+5
-1
lines changed

java/openmldb-import/src/main/java/com/_4paradigm/openmldb/importer/Importer.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,20 @@ public void Load() {
209209
reader.enableCheckHeader(tableMetaData);
210210
try {
211211
CSVRecord record;
212+
int lines = 0;
212213
while ((record = reader.next()) != null) {
214+
// integer gets added at the start of iteration for each line.
215+
lines++;
213216
Map<Integer, List<Tablet.Dimension>> dims = buildDimensions(record, keyIndexMap, tableMetaData.getPartitionNum());
214-
215217
// distribute the row to the bulk load generators for each MemTable(tid, pid)
216218
for (Integer pid : dims.keySet()) {
217219
// Note: NS pid is int
218220
// no need to calc dims twice, pass it to BulkLoadGenerator
219221
generators.get(pid).feed(new BulkLoadGenerator.FeedItem(dims, tsIdxSet, record));
220222
}
221223
}
224+
System.out.println("Total read rows: " + lines);
225+
// after while loop is finished, print out number of lines gone through.
222226
} catch (Exception e) {
223227
logger.error("feeding failed, {}", e.getMessage());
224228
}

0 commit comments

Comments
 (0)