Skip to content

Commit

Permalink
update logging
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Apr 6, 2013
1 parent 2976893 commit 871bda9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Expand Up @@ -127,15 +127,16 @@ public void execute(NodeCommunication nodeCommunication, RemoteNodeStatus status

dataLoaderService.loadDataFromPull(node, status);

if (status.getDataProcessed() > 0 || status.getBatchesProcessed() > 0) {
if (!status.failed() &&
(status.getDataProcessed() > 0 || status.getBatchesProcessed() > 0)) {
log.info(
"Pull data received from {}. {} rows and {} batches were processed",
new Object[] { node.toString(), status.getDataProcessed(),
status.getBatchesProcessed() });

} else {
log.debug(
"Pull data received from {}. {} rows and {} batches were processed",
} else if (status.failed()) {
log.warn(
"There was a failure while pulling data from {}. {} rows and {} batches were processed",
new Object[] { node.toString(), status.getDataProcessed(),
status.getBatchesProcessed() });
}
Expand Down
Expand Up @@ -154,11 +154,17 @@ public void execute(NodeCommunication nodeCommunication, RemoteNodeStatus status
reloadBatchesProcessed = status.getReloadBatchesProcessed();
log.debug("Push requested for {}", node);
pushToNode(node, status);
if (status.getBatchesProcessed() > 0 && status.getBatchesProcessed() != lastBatchCount) {
if (!status.failed() && status.getBatchesProcessed() > 0
&& status.getBatchesProcessed() != lastBatchCount) {
log.info(
"Pushed data to {}. {} data and {} batches were processed{}",
"Pushed data to {}. {} data and {} batches were processed",
new Object[] { node, status.getDataProcessed(),
status.getBatchesProcessed(), status.failed() ? ". There was at least one failure" : "" });
status.getBatchesProcessed()});
} else if (status.failed()) {
log.warn(
"There was a failure while pushing data to {}. {} data and {} batches were processed",
new Object[] { node, status.getDataProcessed(),
status.getBatchesProcessed()});
}
log.debug("Push completed for {}", node);
lastBatchCount = status.getBatchesProcessed();
Expand Down

0 comments on commit 871bda9

Please sign in to comment.