Skip to content

Commit 1fa4390

Browse files
ehennumehennum
ehennum
authored andcommitted
reword log messages to identify hosts without implying connection #999
1 parent 535e3db commit 1fa4390

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/QueryBatcherImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private void retry(QueryEvent queryEvent, boolean callFailListeners) {
156156
// we're obviously not done with this forest
157157
forestIsDone.get(retryForest).set(false);
158158
long start = queryEvent.getForestResultsSoFar() + 1;
159-
logger.trace("retryForest: {}, retryHost: {}, start: {}",
159+
logger.trace("retryForest {} on retryHost {} at start {}",
160160
retryForest.getForestName(), retryForest.getPreferredHost(), start);
161161
QueryTask runnable = new QueryTask(getMoveMgr(), this, retryForest, query,
162162
queryEvent.getForestBatchNumber(), start, queryEvent.getJobBatchNumber(), callFailListeners);
@@ -428,7 +428,7 @@ public synchronized QueryBatcher withForestConfig(ForestConfiguration forestConf
428428
if ( forestResults.get(forest) == null ) forestResults.put(forest, new AtomicLong());
429429
if ( forestIsDone.get(forest) == null ) forestIsDone.put(forest, new AtomicBoolean(false));
430430
}
431-
logger.info("(withForestConfig) Using {} hosts with forests for \"{}\"", hosts.keySet(), forests[0].getDatabaseName());
431+
logger.info("(withForestConfig) Using forests on {} hosts for \"{}\"", hosts.keySet(), forests[0].getDatabaseName());
432432
List<DatabaseClient> newClientList = new ArrayList<>();
433433
for ( String host : hosts.keySet() ) {
434434
Forest forest = hosts.get(host);

marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/WriteBatcherImpl.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ public synchronized WriteBatcher withForestConfig(ForestConfiguration forestConf
805805
removedHostInfos.put(hostInfo.hostName, hostInfo);
806806
}
807807
}
808-
logger.info("(withForestConfig) Using {} hosts with forests for \"{}\"", hosts.keySet(), forests[0].getDatabaseName());
808+
logger.info("(withForestConfig) Using forests on {} hosts for \"{}\"", hosts.keySet(), forests[0].getDatabaseName());
809809
// initialize a DatabaseClient for each host
810810
HostInfo[] newHostInfos = new HostInfo[hosts.size()];
811811
int i=0;
@@ -819,8 +819,10 @@ public synchronized WriteBatcher withForestConfig(ForestConfiguration forestConf
819819
Forest forest = hosts.get(host);
820820
// this is a host-specific client (no DatabaseClient is actually forest-specific)
821821
newHostInfos[i].client = getMoveMgr().getForestClient(forest);
822-
logger.info("Adding DatabaseClient on port {} for host \"{}\" to the rotation",
823-
newHostInfos[i].client.getPort(), host);
822+
if (getMoveMgr().getConnectionType() == DatabaseClient.ConnectionType.DIRECT) {
823+
logger.info("Adding DatabaseClient on port {} for host \"{}\" to the rotation",
824+
newHostInfos[i].client.getPort(), host);
825+
}
824826
}
825827
i++;
826828
}
@@ -1052,7 +1054,7 @@ public void run() {
10521054
transaction = transactionInfo.transaction;
10531055
transactionInfo.written.set(true);
10541056
}
1055-
logger.trace("begin write batch {} to host \"{}\"", writeSet.getBatchNumber(), writeSet.getClient().getHost());
1057+
logger.trace("begin write batch {} to forest on host \"{}\"", writeSet.getBatchNumber(), writeSet.getClient().getHost());
10561058
if ( writeSet.getTemporalCollection() == null ) {
10571059
writeSet.getClient().newDocumentManager().write(
10581060
writeSet.getWriteSet(), writeSet.getTransform(), transaction
@@ -1077,7 +1079,7 @@ public void run() {
10771079
throw new DataMovementException("Failed to write because transaction already underwent commit or rollback", null);
10781080
}
10791081
} catch (Throwable t) {
1080-
logger.trace("failed batch sent to host \"{}\"", writeSet.getClient().getHost());
1082+
logger.trace("failed batch sent to forest on host \"{}\"", writeSet.getClient().getHost());
10811083
Consumer<Throwable> onFailure = writeSet.getOnFailure();
10821084
if ( onFailure != null ) {
10831085
onFailure.accept(t);

0 commit comments

Comments
 (0)