Skip to content

Commit

Permalink
0003112: Make Outgoing Batch and Incoming Batch Similar
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellpettit committed May 19, 2017
1 parent d95d6d7 commit 7f0b91c
Show file tree
Hide file tree
Showing 40 changed files with 3,512 additions and 3,378 deletions.
Expand Up @@ -94,7 +94,7 @@ protected void logFailureDetails(Throwable e, CsvData data, boolean logLastDmlDe
}

protected LoadStatus upsert(CsvData data) {
statistics.get(batch).startTimer(DataWriterStatisticConstants.DATABASEMILLIS);
statistics.get(batch).startTimer(DataWriterStatisticConstants.LOADMILLIS);
try {
DB db = clientManager.getDB(objectMapper.mapToDatabase(this.targetTable));
DBCollection collection = db.getCollection(objectMapper
Expand All @@ -117,13 +117,13 @@ protected LoadStatus upsert(CsvData data) {
throw new SymmetricException("Failed to write data: " + object.toString());
}
} finally {
statistics.get(batch).stopTimer(DataWriterStatisticConstants.DATABASEMILLIS);
statistics.get(batch).stopTimer(DataWriterStatisticConstants.LOADMILLIS);
}
}

@Override
protected LoadStatus delete(CsvData data, boolean useConflictDetection) {
statistics.get(batch).startTimer(DataWriterStatisticConstants.DATABASEMILLIS);
statistics.get(batch).startTimer(DataWriterStatisticConstants.LOADMILLIS);
try {
DB db = clientManager.getDB(objectMapper.mapToDatabase(this.targetTable));
DBCollection collection = db.getCollection(objectMapper
Expand All @@ -143,7 +143,7 @@ protected LoadStatus delete(CsvData data, boolean useConflictDetection) {
}
return LoadStatus.SUCCESS;
} finally {
statistics.get(batch).stopTimer(DataWriterStatisticConstants.DATABASEMILLIS);
statistics.get(batch).stopTimer(DataWriterStatisticConstants.LOADMILLIS);
}

}
Expand All @@ -155,15 +155,15 @@ protected boolean create(CsvData data) {

@Override
protected boolean sql(CsvData data) {
statistics.get(batch).startTimer(DataWriterStatisticConstants.DATABASEMILLIS);
statistics.get(batch).startTimer(DataWriterStatisticConstants.LOADMILLIS);
try {
DB db = clientManager.getDB(objectMapper.mapToDatabase(this.targetTable));
String command = data.getParsedData(CsvData.ROW_DATA)[0];
log.info("About to run command: {}", command);
CommandResult results = db.command(command);
log.info("The results of the command were: {}", results);
} finally {
statistics.get(batch).stopTimer(DataWriterStatisticConstants.DATABASEMILLIS);
statistics.get(batch).stopTimer(DataWriterStatisticConstants.LOADMILLIS);
}
return true;
}
Expand Down

0 comments on commit 7f0b91c

Please sign in to comment.