Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
0003142: Sync Columns Between Incoming and Outgoing Batch. Fix null
pointer when stream.to.file.enabled is false on source and true on
target.
  • Loading branch information
chenson42 committed Sep 24, 2017
1 parent e0c7c5a commit 04cf827
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -199,7 +199,8 @@ public Object readNext() {
} else if (tokens[0].equals(CsvConstants.BATCH) || tokens[0].equals(CsvConstants.RETRY)) {
Batch batch = new Batch(batchType, Long.parseLong(tokens[1]), channelId, binaryEncoding, sourceNodeId, targetNodeId,
false);
statistics.put(batch, new DataReaderStatistics());
stats = stats != null ? stats : new DataReaderStatistics();
statistics.put(batch, stats);
tokens = null;
return batch;
} else if (tokens[0].equals(CsvConstants.NO_BINARY_OLD_DATA)) {
Expand Down Expand Up @@ -281,6 +282,7 @@ public Object readNext() {
statsColumns = CollectionUtils.copyOfRange(tokens, 1, tokens.length);
} else if (tokens[0].equals(CsvConstants.STATS)) {
statsValues = CollectionUtils.copyOfRange(tokens, 1, tokens.length);
stats = stats != null ? stats : new DataReaderStatistics();
putStats(stats, statsColumns, statsValues);
} else {
log.info("Unable to handle unknown csv values: " + Arrays.toString(tokens));
Expand Down

0 comments on commit 04cf827

Please sign in to comment.