synchronized (theQueryObject) {
queryId = theQueryObject.getQueryId();
shardId = theQueryObject.getRemoteQueryInfo().getShardId();
}
QueryStatus targetStatus = null;
synchronized (_slaveStatus) {
for (QueryStatus status : _slaveStatus.getQueryStatus()) {
// if query ids and shard ids match
if (status.getQueryId() == queryId
&& status.getShardId() == shardId) {
targetStatus = status;
break;
}
}
}
boolean addNewStatus = (targetStatus == null);
if (targetStatus == null) {
targetStatus = new QueryStatus();
}
synchronized (theQueryObject) {
// clear fields that are only relavent at the master
theQueryObject.getQueryStatus().setFieldClean(QueryStatus.Field_ATTEMPTS);
theQueryObject.getQueryStatus().setFieldClean(QueryStatus.Field_LASTATTEMPTTIME);
try {
targetStatus.merge(theQueryObject.getQueryStatus());
} catch (CloneNotSupportedException e) {
}
}
if (addNewStatus) {