| 579 | } |
| 580 | |
| 581 | bool BackupRelationTask::fileWriter(Item& item) |
| 582 | { |
| 583 | BurpGlobals* tdgbl = item.m_gbl; |
| 584 | fb_assert(tdgbl == m_masterGbl); |
| 585 | |
| 586 | BURP_verbose(142, m_relation->rel_name); |
| 587 | // msg 142 writing data for relation %s |
| 588 | |
| 589 | IOBuffer*& buf = item.m_buffer = NULL; |
| 590 | FB_UINT64 records = 0; |
| 591 | FB_UINT64 verbRecs = -1; |
| 592 | FB_UINT64 verb = 0; |
| 593 | while (!m_stop) |
| 594 | { |
| 595 | if (!buf) |
| 596 | buf = getDirtyBuffer(); |
| 597 | else |
| 598 | buf->lock(); |
| 599 | |
| 600 | if (!buf) |
| 601 | break; |
| 602 | |
| 603 | const UCHAR* p = buf->getBuffer(); |
| 604 | FB_SIZE_T recs = buf->getRecs(); |
| 605 | FB_SIZE_T len = (recs > 0) ? buf->getUsed() : buf->getSize(); |
| 606 | |
| 607 | // very inefficient ! |
| 608 | MVOL_write_block(tdgbl, p, len); |
| 609 | |
| 610 | IOBuffer* next = buf->getNext(); |
| 611 | buf->clear(); |
| 612 | putCleanBuffer(buf); |
| 613 | buf = next; |
| 614 | |
| 615 | records += recs; |
| 616 | |
| 617 | if (verb != (records / tdgbl->verboseInterval)) |
| 618 | { |
| 619 | verb = (records / tdgbl->verboseInterval); |
| 620 | verbRecs = records; |
| 621 | BURP_verbose(108, SafeArg() << (verb * tdgbl->verboseInterval) /*records*/); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | if (records != verbRecs) |
| 626 | BURP_verbose(108, SafeArg() << records); |
| 627 | |
| 628 | return true; |
| 629 | } |
| 630 | |
| 631 | BackupRelationTask::Item::EnsureUnlockBuffer::~EnsureUnlockBuffer() |
| 632 | { |
nothing calls this directly
no test coverage detected