| 547 | } |
| 548 | |
| 549 | int EventStorage::CheckAndSwitchFile(bool force) { |
| 550 | EventDataInfo data_info; |
| 551 | event_file_manager_->GetWriteFileInfo(&data_info); |
| 552 | if (!force || data_info.offset() > option_->GetBinLogSvrConfig()->GetMaxEventFileSize()) { |
| 553 | STATISTICS(GtidEventSwitchDataFile()); |
| 554 | ColorLogInfo("%s file %s size %zu has full, max size %zu, switch", __func__, |
| 555 | data_info.file_name().c_str(), data_info.offset(), |
| 556 | option_->GetBinLogSvrConfig()->GetMaxEventFileSize()); |
| 557 | |
| 558 | EventData event_headerdata; |
| 559 | int ret = GetFileHeader(&event_headerdata, &data_info); |
| 560 | if (ret == 0) { |
| 561 | ret = EventStorage::SwitchNewFile(event_headerdata); |
| 562 | } |
| 563 | return ret; |
| 564 | } |
| 565 | return OK; |
| 566 | } |
| 567 | |
| 568 | void EventStorage::Notify() { |
| 569 | pthread_cond_broadcast(&cond_); |
nothing calls this directly
no test coverage detected