Skip to content

Commit

Permalink
0003089: data_event_count is not being set for initial load batches
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 3, 2017
1 parent d1df665 commit aa1e715
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -96,7 +96,6 @@ public void close() {
startNewBatch();
end(this.table);
end(this.batch, false);
closeCurrentDataWriter();
}
closeCurrentDataWriter();
}
Expand Down Expand Up @@ -149,7 +148,7 @@ public void write(CsvData data) {
if (this.outgoingBatch.getDataEventCount() >= maxBatchSize && this.batches.size() > 0) {
this.currentDataWriter.end(table);
this.currentDataWriter.end(batch, false);
closeCurrentDataWriter();
this.closeCurrentDataWriter();
startNewBatch();
}
if (System.currentTimeMillis() - ts > 60000) {
Expand All @@ -167,15 +166,16 @@ public void checkSend() {
if (resource != null) {
resource.setState(State.DONE);
}
this.outgoingBatch = this.dataExtractorService.outgoingBatchService.findOutgoingBatch(outgoingBatch.getBatchId(), outgoingBatch.getNodeId());
if (outgoingBatch.getIgnoreCount() == 0) {
this.outgoingBatch.setStatus(Status.NE);
this.dataExtractorService.outgoingBatchService.updateOutgoingBatch(this.outgoingBatch);
OutgoingBatch batchFromDatabase = this.dataExtractorService.outgoingBatchService.findOutgoingBatch(outgoingBatch.getBatchId(), outgoingBatch.getNodeId());
if (batchFromDatabase.getIgnoreCount() == 0) {
this.outgoingBatch.setStatus(Status.NE);
} else {
cancelled = true;
throw new CancellationException();
}
}

this.dataExtractorService.outgoingBatchService.updateOutgoingBatch(this.outgoingBatch);
}

@Override
Expand All @@ -193,6 +193,7 @@ public void end(Batch batch, boolean inError) {
this.inError = inError;
if (this.currentDataWriter != null) {
this.currentDataWriter.end(this.batch, inError);
closeCurrentDataWriter();
}
}

Expand Down

0 comments on commit aa1e715

Please sign in to comment.