| 295 | } |
| 296 | |
| 297 | int CheckpointSender :: SendBuffer(const int iSMID, const uint64_t llCheckpointInstanceID, |
| 298 | const std::string & sFilePath, const uint64_t llOffset, const std::string & sBuffer) |
| 299 | { |
| 300 | uint32_t iChecksum = crc32(0, (const uint8_t *)sBuffer.data(), sBuffer.size(), CRC32SKIP); |
| 301 | |
| 302 | int ret = 0; |
| 303 | while (true) |
| 304 | { |
| 305 | if (m_bIsEnd) |
| 306 | { |
| 307 | return -1; |
| 308 | } |
| 309 | |
| 310 | if (!CheckAck(m_llSequence)) |
| 311 | { |
| 312 | return -1; |
| 313 | } |
| 314 | |
| 315 | ret = m_poLearner->SendCheckpoint( |
| 316 | m_iSendNodeID, m_llUUID, m_llSequence, llCheckpointInstanceID, |
| 317 | iChecksum, sFilePath, iSMID, llOffset, sBuffer); |
| 318 | |
| 319 | BP->GetCheckpointBP()->SendCheckpointOneBlock(); |
| 320 | |
| 321 | if (ret == 0) |
| 322 | { |
| 323 | m_llSequence++; |
| 324 | break; |
| 325 | } |
| 326 | else |
| 327 | { |
| 328 | PLGErr("SendCheckpoint fail, ret %d need sleep 30s", ret); |
| 329 | Time::MsSleep(30000); |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | return ret; |
| 334 | } |
| 335 | |
| 336 | void CheckpointSender :: Ack(const nodeid_t iSendNodeID, const uint64_t llUUID, const uint64_t llSequence) |
| 337 | { |
nothing calls this directly
no test coverage detected