/** Process a new repair log response */
@Override
public void deliver(VoltMessage message)
{
if (message instanceof Iv2RepairLogResponseMessage) {
Iv2RepairLogResponseMessage response = (Iv2RepairLogResponseMessage)message;
if (response.getRequestId() != m_requestId) {
tmLog.debug(m_whoami + "rejecting stale repair response."
+ " Current request id is: " + m_requestId
+ " Received response for request id: " + response.getRequestId());
return;
}
// Step 1: if the msg has a known (not MAX VALUE) handle, update m_maxSeen.
if (response.getTxnId() != Long.MAX_VALUE) {
m_maxSeenTxnId = Math.max(m_maxSeenTxnId, response.getTxnId());
}
// Step 2: track hashinator versions
if (response.hasHashinatorConfig()) {
Pair<Long,byte[]> proposed = response.getHashinatorVersionedConfig();
if (proposed.getFirst() > m_newestHashinatorConfig.getFirst()) {
m_newestHashinatorConfig = proposed;
}
}
// Step 3: offer to the union
addToRepairLog(response);
if (tmLog.isTraceEnabled()) {
tmLog.trace(m_whoami + " collected from " + CoreUtils.hsIdToString(response.m_sourceHSId) +
", message: " + response.getPayload());
}
// Step 4: update the corresponding replica repair struct.
ReplicaRepairStruct rrs = m_replicaRepairStructs.get(response.m_sourceHSId);
if (rrs.m_expectedResponses < 0) {
tmLog.debug(m_whoami + "collecting " + response.getOfTotal()
+ " repair log entries from "
+ CoreUtils.hsIdToString(response.m_sourceHSId));
}
if (rrs.update(response)) {