Skip to content

Commit

Permalink
0002680: Avoid updating status of outgoing batch for small batches
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jul 15, 2016
1 parent 7784693 commit 6a89f23
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Expand Up @@ -351,6 +351,8 @@ private ParameterConstants() {

public final static String DBF_ROUTER_VALIDATE_HEADER = "dbf.router.validate.header";

public final static String OUTGOING_BATCH_UPDATE_STATUS_MILLIS = "outgoing.batches.update.status.millis";

public static Map<String, ParameterMetaData> getParameterMetaData() {
return parameterMetaData;
}
Expand Down
Expand Up @@ -714,8 +714,14 @@ final protected boolean changeBatchStatus(Status status, OutgoingBatch currentBa
currentBatch.setStatus(status);
}
if (mode != ExtractMode.EXTRACT_ONLY) {
outgoingBatchService.updateOutgoingBatch(currentBatch);
return true;
long batchStatusUpdateMillis = parameterService.getLong(ParameterConstants.OUTGOING_BATCH_UPDATE_STATUS_MILLIS);
if (currentBatch.getStatus() == Status.RQ || currentBatch.getStatus() == Status.LD ||
currentBatch.getLastUpdatedTime() == null ||
System.currentTimeMillis() - batchStatusUpdateMillis >= currentBatch.getLastUpdatedTime().getTime()) {
outgoingBatchService.updateOutgoingBatch(currentBatch);
return true;
}
return false;
} else {
return false;
}
Expand Down
Expand Up @@ -993,6 +993,15 @@ routing.stale.gap.busy.expire.time.ms=1200000
# Tags: extract
outgoing.batches.peek.ahead.batch.commit.size=10


# Update the outgoing batch status to QY (querying) and SE (sending) only when
# the last update to the batch is in the past by at least the specified number of milliseconds.
# This can improve performance overhead on small batches by avoiding status updates.
#
# DatabaseOverridable: true
# Tags: extract
outgoing.batches.update.status.millis=10000

# Disable the extraction of all channels with the exception of the config channel
#
# DatabaseOverridable: true
Expand Down

0 comments on commit 6a89f23

Please sign in to comment.