Skip to content

Commit

Permalink
formatting in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Mar 2, 2018
1 parent 72b8fbf commit 53e7f09
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Expand Up @@ -91,20 +91,20 @@ protected void fireOffline(Exception error, Node remoteNode, RemoteNodeStatus st
status.setStatus(Status.OFFLINE);
} else if (isServiceUnavailable(error)) {
if (shouldLogTransportError(remoteNode.getNodeId())) {
log.warn("{} at {} was unavailable.", new Object[] {remoteNode, syncUrl});
log.warn("Remote node {} at {} was unavailable.", new Object[] {remoteNode, syncUrl});
} else {
log.info("{} at {} was unavailable. It may be starting up.", new Object[] {remoteNode, syncUrl});
log.info("Remote node {} at {} was unavailable. It may be starting up.", new Object[] {remoteNode, syncUrl});
}
status.setStatus(Status.OFFLINE);
} else if (isBusy(error)) {
if (shouldLogTransportError(remoteNode.getNodeId())) {
log.warn("{} at {} was busy", new Object[] {remoteNode, syncUrl});
log.warn("Remote node {} at {} was busy", new Object[] {remoteNode, syncUrl});
} else {
log.info("{} at {} was busy", new Object[] {remoteNode, syncUrl});
log.info("Remote node {} at {} was busy", new Object[] {remoteNode, syncUrl});
}
status.setStatus(Status.BUSY);
} else if (isNotAuthenticated(error)) {
log.warn("{} at {} was not authorized", new Object[] {remoteNode, syncUrl});
log.warn("Authorization denied from {} at {}", new Object[] {remoteNode, syncUrl});
status.setStatus(Status.NOT_AUTHORIZED);
} else if (isSyncDisabled(error)) {
log.warn("Sync was not enabled for {} at {}", new Object[] {remoteNode, syncUrl});
Expand Down
Expand Up @@ -151,14 +151,14 @@ public void execute(NodeCommunication nodeCommunication, RemoteNodeStatus status
lastDataProcessed = status.getDataProcessed() - cumulativeDataProcessed;
if (!status.failed() && (lastDataProcessed > 0 || lastBatchesProcessed > 0)) {
log.info(
"Pull data received from {} on queue {}. {} rows and {} batches were processed. {}",
"Pull data received from {} on queue {}. {} rows and {} batches were processed. ({})",
new Object[] { node.toString(), nodeCommunication.getQueue(), lastDataProcessed, lastBatchesProcessed, status.getTableSummary() });
statisticManager.addJobStats(node.getNodeId(), 1, "Pull",
begin, end, status.getDataProcessed());

} else if (status.failed()) {
log.debug(
"There was a failure while pulling data from {} on queue {}. {} rows and {} batches were processed. {}",
"There was a failure while pulling data from {} on queue {}. {} rows and {} batches were processed. ({})",
new Object[] { node.toString(), nodeCommunication.getQueue(),
lastDataProcessed, lastBatchesProcessed, status.getTableSummary()});
}
Expand Down
Expand Up @@ -167,10 +167,10 @@ public void execute(NodeCommunication nodeCommunication, RemoteNodeStatus status
lastDataProcessed = status.getDataProcessed() - cumulativeDataProcessed;
lastReloadBatchesProcessed = status.getReloadBatchesProcessed() - cumulativeReloadBatchesProcessed;
if (!status.failed() && lastBatchesProcessed > 0) {
log.info("Pushed data to node {}. {} data and {} batches were processed. {}",
log.info("Pushed data to node {}. {} data and {} batches were processed. ({})",
new Object[] { node, lastDataProcessed, lastBatchesProcessed, status.getTableSummary() });
} else if (status.failed()) {
log.debug("There was a failure while pushing data to {}. {} data and {} batches were processed. {}",
log.debug("There was a failure while pushing data to {}. {} data and {} batches were processed. ({})",
new Object[] { node, lastDataProcessed, lastBatchesProcessed, status.getTableSummary() });
}
log.debug("Push completed for {} channel {}", node, nodeCommunication.getQueue());
Expand Down
Expand Up @@ -146,8 +146,8 @@ public static void resolveForeginKeyOrder(Table t, Map<String, Table> allTables,
if (parentTable != null) {
StringBuilder dependentTables = new StringBuilder();
for (ForeignKey fk : parentTable.getForeignKeys()) {
if(fk.getForeignTable() != null && allTables.get(fk.getForeignTable().getName()) == null) {
if (dependentTables.length() > 0) { dependentTables.append(", "); }
if (dependentTables.length() > 0) {
dependentTables.append(", ");
}
dependentTables.append(fk.getForeignTableName());
if (missingDependencyMap.get(parentTable) == null) {
Expand Down

0 comments on commit 53e7f09

Please sign in to comment.