Public Member Functions | Public Attributes | Private Member Functions | Private Attributes

fio_CirFileTrans Class Reference
[Classes for large file i/o, relative file, and DataBase]

#include <fio_CirFileTrans.h>

Inheritance diagram for fio_CirFileTrans:
Inheritance graph
[legend]
Collaboration diagram for fio_CirFileTrans:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 fio_CirFileTrans (bool a_readOnly, const int a_fileID, const cmn_Path a_path, const string a_fileName, const int a_recordSize, const Int16_t a_recordStructVersion, const UInt16_t a_numOfDifVector=1, const UInt16_t a_smallestVectorSize=0x0400)
 Default constructor.
virtual ~fio_CirFileTrans ()
virtual void SyncRelFileObj ()
 Sync relative file object with data on disk after transaction reply.
ivd_RecordIDX_t ReadFront (void *a_buffer_p)
 Read first element from circular file and forgot it.
ivd_RecordIDX_t WriteBack (const void *a_buffer_p, fio_Transaction &a_transaction_p)
 Write new element to circular file.
int WriteRec (const fio_RecordIDX_t a_index, const void *a_buffer_p, const unsigned int a_numOfRec, fio_Transaction &a_transaction_p)
 update any record in file
int ReadRec (const fio_RecordIDX_t a_index, void *a_buffer_p, const unsigned int a_numOfRec)
 Read any record from file.
fio_RecordIDX_t ReadNext (void *a_buffer_p)
 Read next record, use ReadReset to set start position;.
void ReadNextReset ()
 Set the start position for ReadNext, it is set to first logical record by default.
virtual void DumpHdr (ostream &os)
 dump header to stream

Public Attributes

 log_CLASSID_m
 readnext block index

Private Member Functions

ivd_RecordIDX_t NewWriteBackBlock ()
 To have consistent DB sinhronize method, flush all unused record form list to disk.
void SetRecIndeces ()
ivd_RecordIDX_t GetRFIdxFromNextBlock ()
 when Idx exceed from block cause of write back, then new idx from next block is got
ivd_RecordIDX_t GetRNIdxFromNextBlock ()
void UpdateReadFrontBlockIdx (ivd_RecordIDX_t a_idx, fio_Transaction &a_transaction)
void UpdateWriteBackBlockIdx (ivd_RecordIDX_t a_idx, fio_Transaction &a_transaction)
void CheckBlockChain ()

Private Attributes

UInt16_t m_blockRecordOffset
 ofset of the first record inside block or how much record ocupy block header?
fio_CirFileHeader_t m_cirFileHdr
 in circular file header are permanent information BackBlockIdx, FrontBlockIdx,
ivd_RecordIDX_t m_currentWriteBackIdx
 All three block heders have to be acordingly updated when another point to the same block header / memory buffered front block header, fio_CirBlockHeader_t m_frontBlockHead;.
ivd_RecordIDX_t m_currentReadFrontIdx
 first index that will be pop by ReadFront method
ivd_RecordIDX_t m_currentReadNextBlockIdx
ivd_RecordIDX_t m_currentReadNextIdx
cmn_Mutex m_writeBackIdx_x
 mutex to lock write back index
int m_writeBackBlockIdxFilePos
int m_readFrontBlockIdxFilePos
const int m_buffSize
char * m_zerroesBuff

Detailed Description

Definition at line 129 of file fio_CirFileTrans.h.


Constructor & Destructor Documentation

fio_CirFileTrans::fio_CirFileTrans ( bool  a_readOnly,
const int  a_fileID,
const cmn_Path  a_path,
const string  a_fileName,
const int  a_recordSize,
const Int16_t  a_recordStructVersion,
const UInt16_t  a_numOfDifVector = 1,
const UInt16_t  a_smallestVectorSize = 0x0400 
)

Default constructor.

Definition at line 136 of file fio_CirFileTrans.cpp.

References c_fio_CirFileHdrPosition, dbg_DETAIL, dbg_NORM, fio_CirFileHeader_t::Dump(), fio_File::GetFileName(), fio_RelFile::Idx2Pos(), ie_CIR_FILE_HEADER_INV, ie_INV_HEADER_POSITION, ivd_NULLCHK_m, log_DBG_m, log_FUNC_m, m_blockRecordOffset, m_buffSize, m_cirFileHdr, m_readFrontBlockIdxFilePos, fio_RelFile::m_smallestVectorSize, m_writeBackBlockIdxFilePos, m_zerroesBuff, fio_File::PosRead(), fio_RelFileTrans::PosWrite(), fio_CirFileHeader_t::readFrontBlockIdx, fio_RelFile::SetFirstNewIDX(), and fio_CirFileHeader_t::writeBackBlockIdx.

        :
        fio_RelFileTrans(
                    a_readOnly,
                    a_fileID, 
                    a_path, 
                    a_fileName, 
                    a_recordSize, 
                    a_recordStructVersion,
                    a_numOfDifVector,
                    a_smallestVectorSize,
                    false,
                    1),    // recommend UV buffer size. exten and sring buffer by 1 vector
        // how much records ocupy fio_CirBlockHeader_t
        m_blockRecordOffset((sizeof(fio_CirBlockHeader_t) / a_recordSize) + 1),
        m_buffSize(a_smallestVectorSize * a_recordSize),
        m_zerroesBuff(NULL)
{
    log_FUNC_m(fio_CirFileTrans);

    // set buffer with zeroes
    m_zerroesBuff = new char[m_buffSize];
    static string nullChkMsg("char[m_buffSize]");
    ivd_NULLCHK_m(m_zerroesBuff, nullChkMsg);
    memset(m_zerroesBuff, 0, m_buffSize);

    
    // calculate file possition of write back block index inside CirFileHdr structure
    m_writeBackBlockIdxFilePos = c_fio_CirFileHdrPosition + 
                                (char*)&m_cirFileHdr.writeBackBlockIdx -
                                (char*)&m_cirFileHdr;

    // calculate file possition of read front block index inside CirFileHdr structure
    m_readFrontBlockIdxFilePos = c_fio_CirFileHdrPosition + 
                                (char*)&m_cirFileHdr.readFrontBlockIdx - 
                                (char*)&m_cirFileHdr;

    if ( sizeof(fio_RelFileHeader_t) >= c_fio_CirFileHdrPosition) {
        throw ivd_InternalError(ie_INV_HEADER_POSITION, 
            "Circular file header of " + GetFileName() + " overwrite relative file header.", true);
    }

    // header created from current constructor parameters
    fio_CirFileHeader_t cirFileHdr(m_smallestVectorSize, m_blockRecordOffset);

    fio_CirFileHeader_t nullCirFileHdr;
    // header read form file
    fio_File::PosRead(c_fio_CirFileHdrPosition, &m_cirFileHdr, sizeof(fio_CirFileHeader_t));
    log_DBG_m(dbg_NORM, "Cirkular file header read from file.");
    m_cirFileHdr.Dump();
    
    // check if header form file is null
    if (m_cirFileHdr == nullCirFileHdr) { // then new file was created
        m_cirFileHdr = cirFileHdr;
        log_DBG_m(dbg_DETAIL, " file is new. Set header and first block.");

        // prepare file with one prepared block
        // NOTE this is a little triky, cause method NewWriteBackBlock()
        // do same think beetter and set all neccessary members,
        // BUT need DATABASE and DB is not yet accessible.
        ivd_FilePosition_t FirstBlockPos = Idx2Pos(1);
        fio_File::PosWrite(FirstBlockPos, m_zerroesBuff, m_buffSize);
        SetFirstNewIDX();
        m_cirFileHdr.readFrontBlockIdx = 1;
        m_cirFileHdr.writeBackBlockIdx = 1;
        fio_File::PosWrite(c_fio_CirFileHdrPosition, &m_cirFileHdr, sizeof(fio_CirFileHeader_t));
    }
    else {
        //  match header form file and header constructed by constructor parameters
        if (! (m_cirFileHdr == cirFileHdr)) {
            throw ivd_InternalError(ie_CIR_FILE_HEADER_INV, 
                "In file " + GetFileName(), true);
        }
    }
}    

Here is the call graph for this function:

fio_CirFileTrans::~fio_CirFileTrans (  )  [virtual]

Definition at line 223 of file fio_CirFileTrans.cpp.

References m_zerroesBuff, and NULL.

                                     {
    if (m_zerroesBuff != NULL) {
        delete [] m_zerroesBuff;
    }
}


Member Function Documentation

void fio_CirFileTrans::CheckBlockChain (  )  [private]

Definition at line 544 of file fio_CirFileTrans.cpp.

References cmn_Num2Str(), dbg_DETAIL, fio_File::GetFileName(), fio_RelFile::Idx2Pos(), ie_CIR_FILE_HEADER_INV, log_DBG_m, log_FUNC_m, m_cirFileHdr, fio_RelFile::m_recordSize, fio_CirBlockHeader_t::NextBlockIdx, fio_File::PosRead(), fio_CirFileHeader_t::readFrontBlockIdx, and fio_CirFileHeader_t::writeBackBlockIdx.

Referenced by SyncRelFileObj().

                                       {
    log_FUNC_m(CheckBlockChain);
    
    log_DBG_m(dbg_DETAIL, "Check block chain in file " << GetFileName() << endl
                      << m_cirFileHdr
                      << " size of record = " << m_recordSize
                      << " size of fio_CirBlockHeader_t= " << sizeof(fio_CirBlockHeader_t));
    log_DBG_m(dbg_DETAIL,  "nextBlkIdx    file pos" );
    log_DBG_m(dbg_DETAIL,  "======================");
                      
    fio_CirBlockHeader_t blockHead;
    blockHead.NextBlockIdx = m_cirFileHdr.readFrontBlockIdx;
    
    
    while (  blockHead.NextBlockIdx != m_cirFileHdr.writeBackBlockIdx)  {
        ivd_FilePosition_t BHPos = Idx2Pos(blockHead.NextBlockIdx);
        
        log_DBG_m(dbg_DETAIL, setw(10) << blockHead.NextBlockIdx << setw(12) << BHPos);
        
        if (blockHead.NextBlockIdx == 0) {
            ostringstream sstr;
            sstr << "Check block chain in file " << GetFileName() << endl
                 << "missing index to next block header." 
                 << " Block idx = "
                 << cmn_Num2Str(m_cirFileHdr.readFrontBlockIdx)
                 << " file " << GetFileName()
                 << m_cirFileHdr
                 << blockHead;
                 
            throw ivd_InternalError(ie_CIR_FILE_HEADER_INV, sstr.str());
        }
        fio_RelFileTrans::PosRead(BHPos, 
                                &blockHead, 
                                sizeof(fio_CirBlockHeader_t));                                
    };  
    log_DBG_m(dbg_DETAIL, setw(10) << blockHead.NextBlockIdx << setw(12) << Idx2Pos(blockHead.NextBlockIdx));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fio_CirFileTrans::DumpHdr ( ostream &  os  )  [virtual]

dump header to stream

Reimplemented from fio_RelFile.

Definition at line 537 of file fio_CirFileTrans.cpp.

References log_FUNC_m, and m_cirFileHdr.

Referenced by hdb_Tables::DumpActiveEntries().

Here is the caller graph for this function:

ivd_RecordIDX_t fio_CirFileTrans::GetRFIdxFromNextBlock (  )  [private]

when Idx exceed from block cause of write back, then new idx from next block is got

when Idx exceed from block cause of read front, then new idx from next block is got

Definition at line 403 of file fio_CirFileTrans.cpp.

References cmn_Num2Str(), dbg_DETAIL, fio_Transaction::EndTransaction(), ftt_CIRC_VECT, fio_File::GetFileName(), fio_DataBase::GetTransObj(), fio_RelFile::Idx2Pos(), ie_CIR_FILE_HEADER_INV, log_DBG_m, log_FUNC_m, m_blockRecordOffset, m_cirFileHdr, m_currentReadFrontIdx, m_currentReadNextBlockIdx, fio_RelFileTrans::m_database_p, fio_RelFile::m_smallestVectorSize, fio_CirBlockHeader_t::NextBlockIdx, fio_File::PosRead(), fio_CirFileHeader_t::readFrontBlockIdx, ReadNextReset(), fio_DataBase::ReleaseTransObj(), fio_RelFileTrans::ReleaseVectorIdx(), fio_Transaction::StartTransaction(), and UpdateReadFrontBlockIdx().

Referenced by ReadFront().

                                                        {
    log_FUNC_m(GetRFIdxFromNextBlock);

    bool updateReadNextIdx = m_currentReadNextBlockIdx == m_cirFileHdr.readFrontBlockIdx;
    
    fio_CirBlockHeader_t blockHead;
    ivd_FilePosition_t BHPos = Idx2Pos(m_cirFileHdr.readFrontBlockIdx);

    fio_RelFileTrans::PosRead(BHPos, 
                              &blockHead, 
                              sizeof(fio_CirBlockHeader_t));

    if (blockHead.NextBlockIdx == 0) {
        throw ivd_InternalError(ie_CIR_FILE_HEADER_INV, 
                  "Read front circular block header must have next one. " 
                  " Block idx = " +
                  cmn_Num2Str(m_cirFileHdr.readFrontBlockIdx) +
                  " file " + GetFileName());
    }
    else {
        fio_Transaction *trans_p = m_database_p->GetTransObj();
        trans_p->StartTransaction(ftt_CIRC_VECT);

        ReleaseVectorIdx(m_cirFileHdr.readFrontBlockIdx, m_smallestVectorSize, trans_p);
        log_DBG_m(dbg_DETAIL, "Released vector on idx " <<  m_cirFileHdr.readFrontBlockIdx 
                           << " with size " << m_smallestVectorSize
                           << " file " << GetFileName());

        UpdateReadFrontBlockIdx(blockHead.NextBlockIdx, *trans_p);        
        m_currentReadFrontIdx =  blockHead.NextBlockIdx + m_blockRecordOffset - 1;
        
        if (updateReadNextIdx) {
            ReadNextReset();
        }

        trans_p->EndTransaction();
        m_database_p->ReleaseTransObj(&trans_p);
    }
    return m_currentReadFrontIdx;
}   

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_RecordIDX_t fio_CirFileTrans::GetRNIdxFromNextBlock (  )  [private]

Definition at line 446 of file fio_CirFileTrans.cpp.

References dbg_DETAIL, fio_File::GetFileName(), fio_RelFile::Idx2Pos(), ie_CIR_FILE_HEADER_INV, log_DBG_m, log_FUNC_m, m_blockRecordOffset, m_currentReadNextBlockIdx, m_currentReadNextIdx, fio_CirBlockHeader_t::NextBlockIdx, and fio_File::PosRead().

Referenced by ReadNext().

                                                        {
    log_FUNC_m(GetRNIdxFromNextBlock);

    fio_CirBlockHeader_t blockHead;
    ivd_FilePosition_t BHPos = Idx2Pos(m_currentReadNextBlockIdx);

    fio_RelFileTrans::PosRead(BHPos, 
                              &blockHead, 
                              sizeof(fio_CirBlockHeader_t));

    log_DBG_m(dbg_DETAIL, "Read circular block header: "
            << " Block idx = " << m_currentReadNextBlockIdx 
            << " file pos = " << BHPos
            << " File " << GetFileName()
            << blockHead);

    if (blockHead.NextBlockIdx == 0) {
        ostringstream sstr;
        sstr << "Read front circular block header must have next one. " 
             << " Block idx = " << m_currentReadNextBlockIdx 
             << " file pos = " << BHPos
             << " File " << GetFileName()
             << blockHead;
             
        throw ivd_InternalError(ie_CIR_FILE_HEADER_INV, sstr.str());
    }
    else {

        m_currentReadNextBlockIdx =  blockHead.NextBlockIdx;        
        m_currentReadNextIdx      =  blockHead.NextBlockIdx + m_blockRecordOffset - 1;        
    }
    return m_currentReadNextIdx;
}   

Here is the call graph for this function:

Here is the caller graph for this function:

ivd_RecordIDX_t fio_CirFileTrans::NewWriteBackBlock (  )  [private]

To have consistent DB sinhronize method, flush all unused record form list to disk.

used by DBLock method;

Definition at line 368 of file fio_CirFileTrans.cpp.

References dbg_DETAIL, fio_Transaction::EndTransaction(), ftt_CIRC_VECT, fio_File::GetFileName(), fio_DataBase::GetTransObj(), fio_RelFileTrans::GetVectorIDX(), fio_RelFile::Idx2Pos(), log_DBG_m, log_FUNC_m, m_blockRecordOffset, m_cirFileHdr, fio_RelFileTrans::m_database_p, fio_RelFile::m_smallestVectorSize, m_zerroesBuff, fio_CirBlockHeader_t::NextBlockIdx, fio_RelFileTrans::PosWrite(), fio_DataBase::ReleaseTransObj(), fio_Transaction::StartTransaction(), UpdateWriteBackBlockIdx(), fio_CirFileHeader_t::writeBackBlockIdx, and WriteRec().

Referenced by WriteBack().

                                                    {
    log_FUNC_m(NewWriteBackBlock);

    fio_Transaction *trans_p = m_database_p->GetTransObj();
    trans_p->StartTransaction(ftt_CIRC_VECT);

    fio_CirBlockHeader_t blockHead; // default block header next idx = 0

    blockHead.NextBlockIdx = GetVectorIDX(m_smallestVectorSize, trans_p);
    log_DBG_m(dbg_DETAIL, "Got vector on idx " <<  blockHead.NextBlockIdx 
                       << " with size " << m_smallestVectorSize
                       << " file " << GetFileName());

    // write zeroes to all block
    fio_RelFileTrans::WriteRec(blockHead.NextBlockIdx, m_zerroesBuff, m_smallestVectorSize, trans_p);

    // update current WBB header
    if (m_cirFileHdr.writeBackBlockIdx != 0) {
        fio_RelFileTrans::PosWrite(Idx2Pos(m_cirFileHdr.writeBackBlockIdx), 
                                  &blockHead, 
                                  sizeof(fio_CirBlockHeader_t),
                                  trans_p);
    }

    // update WBB index inside circular file header 
    UpdateWriteBackBlockIdx(blockHead.NextBlockIdx, *trans_p);

    trans_p->EndTransaction();
    m_database_p->ReleaseTransObj(&trans_p);

    return blockHead.NextBlockIdx + m_blockRecordOffset;
}

Here is the call graph for this function:

Here is the caller graph for this function:

fio_RecordIDX_t fio_CirFileTrans::ReadFront ( void *  a_buffer_p  ) 

Read first element from circular file and forgot it.

Definition at line 267 of file fio_CirFileTrans.cpp.

References dbg_DETAIL, fio_File::GetFileName(), GetRFIdxFromNextBlock(), ie_FILE_ERROR, cmn_Mutex::Lock(), log_DBG_m, log_FUNC_m, m_cirFileHdr, m_currentReadFrontIdx, m_currentReadNextBlockIdx, m_currentReadNextIdx, m_currentWriteBackIdx, fio_RelFile::m_smallestVectorSize, m_writeBackIdx_x, fio_CirFileHeader_t::readFrontBlockIdx, ReadRec(), cmn_Mutex::Unlock(), and fio_CirFileHeader_t::writeBackBlockIdx.

Referenced by hsm_ReleaseCandRec::FindNextRec(), and hsm_ActiveFH::FindNextRec().

Here is the call graph for this function:

Here is the caller graph for this function:

fio_RecordIDX_t fio_CirFileTrans::ReadNext ( void *  a_buffer_p  ) 
void fio_CirFileTrans::ReadNextReset (  ) 

Set the start position for ReadNext, it is set to first logical record by default.

Definition at line 336 of file fio_CirFileTrans.cpp.

References log_FUNC_m, m_cirFileHdr, m_currentReadFrontIdx, m_currentReadNextBlockIdx, m_currentReadNextIdx, and fio_CirFileHeader_t::readFrontBlockIdx.

Referenced by hsm_ActiveFH::ActiveToList(), hdb_Tables::DumpActiveEntries(), hdb_Tables::DumpReleaseCand(), GetRFIdxFromNextBlock(), hsm_ActiveFH::OrphanedToMigList(), and SyncRelFileObj().

                                     {
    log_FUNC_m(ReadReset);

    // read block header is same as front header at staru up and reset
    m_currentReadNextBlockIdx  = m_cirFileHdr.readFrontBlockIdx;
    m_currentReadNextIdx       = m_currentReadFrontIdx;
}

Here is the caller graph for this function:

int fio_CirFileTrans::ReadRec ( const fio_RecordIDX_t  a_index,
void *  a_buffer_p,
const unsigned int  a_numOfRec 
) [inline]

Read any record from file.

Reimplemented from fio_RelFile.

Definition at line 225 of file fio_CirFileTrans.h.

References fio_RelFile::ReadRec().

Referenced by hsm_ReleaseCandRec::IsValid(), ReadFront(), ReadNext(), and SetRecIndeces().

                                                        {
        return fio_RelFile::ReadRec(a_index, a_buffer_p, a_numOfRec);
    };

Here is the call graph for this function:

Here is the caller graph for this function:

void fio_CirFileTrans::SetRecIndeces (  )  [private]

Definition at line 489 of file fio_CirFileTrans.cpp.

References cmn_Num2Str(), fio_File::GetFileName(), ie_CIR_FILE_HEADER_INV, ivd_NULLCHK_m, log_FUNC_m, m_blockRecordOffset, m_cirFileHdr, m_currentReadFrontIdx, m_currentWriteBackIdx, fio_RelFile::m_recordSize, fio_RelFile::m_smallestVectorSize, fio_CirFileHeader_t::readFrontBlockIdx, ReadRec(), and fio_CirFileHeader_t::writeBackBlockIdx.

Referenced by SyncRelFileObj().

                                     {
    log_FUNC_m(SetIndeces);

    if (   m_cirFileHdr.readFrontBlockIdx == 0
        || m_cirFileHdr.writeBackBlockIdx == 0) {

        throw ivd_InternalError(ie_CIR_FILE_HEADER_INV, 
          "Can't set record indeces, cause some block index is zero. readFrontBlockIdx " 
                  + cmn_Num2Str(m_cirFileHdr.readFrontBlockIdx) 
                  + "  writeBackBlockIdx "
                  + cmn_Num2Str(m_cirFileHdr.writeBackBlockIdx)
                  + " file " + GetFileName());
    }

    // find last not zerro record in block, that represent write back index
    // last filled rec in block because index is incremented before use
    // it is possible that exist emply records in middle of data
    
    int buffSize = m_smallestVectorSize * m_recordSize;

    char * buff = new char[buffSize];
    static string nullChkMsg("char[m_smallestVectorSize * m_recordSize]");
    ivd_NULLCHK_m(buff, nullChkMsg);

    // read whole block
    fio_RelFileTrans::ReadRec(m_cirFileHdr.writeBackBlockIdx, 
                              buff, 
                              m_smallestVectorSize);
    // last char in buffer;
    char *p = buff + buffSize;

    // set guard that block header is not null
    buff[m_blockRecordOffset * m_recordSize - 1] = 1;
    while ( *--p == 0 ) {
        // Empty
    }
    // block index + idx of first used record (backward) in block + 1 (next is unused)
    m_currentWriteBackIdx = m_cirFileHdr.writeBackBlockIdx + (p - buff) / m_recordSize + 1;

    m_currentReadFrontIdx = m_cirFileHdr.readFrontBlockIdx 
                          + m_blockRecordOffset - 1;
                          
    delete [] buff;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void fio_CirFileTrans::SyncRelFileObj (  )  [virtual]

Sync relative file object with data on disk after transaction reply.

Reimplemented from fio_RelFileTrans.

Definition at line 230 of file fio_CirFileTrans.cpp.

References c_fio_CirFileHdrPosition, CheckBlockChain(), log_FUNC_m, m_cirFileHdr, fio_File::PosRead(), ReadNextReset(), and SetRecIndeces().

Here is the call graph for this function:

void fio_CirFileTrans::UpdateReadFrontBlockIdx ( ivd_RecordIDX_t  a_idx,
fio_Transaction a_transaction 
) [private]

Definition at line 346 of file fio_CirFileTrans.cpp.

References m_cirFileHdr, m_readFrontBlockIdxFilePos, fio_RelFileTrans::PosWrite(), and fio_CirFileHeader_t::readFrontBlockIdx.

Referenced by GetRFIdxFromNextBlock().

Here is the call graph for this function:

Here is the caller graph for this function:

void fio_CirFileTrans::UpdateWriteBackBlockIdx ( ivd_RecordIDX_t  a_idx,
fio_Transaction a_transaction 
) [private]

Definition at line 357 of file fio_CirFileTrans.cpp.

References m_cirFileHdr, m_writeBackBlockIdxFilePos, fio_RelFileTrans::PosWrite(), and fio_CirFileHeader_t::writeBackBlockIdx.

Referenced by NewWriteBackBlock().

Here is the call graph for this function:

Here is the caller graph for this function:

fio_RecordIDX_t fio_CirFileTrans::WriteBack ( const void *  a_buffer_p,
fio_Transaction a_transaction_p 
)
int fio_CirFileTrans::WriteRec ( const fio_RecordIDX_t  a_index,
const void *  a_buffer_p,
const unsigned int  a_numOfRec,
fio_Transaction a_transaction_p 
) [inline]

update any record in file

Definition at line 216 of file fio_CirFileTrans.h.

References fio_RelFile::WriteRec().

Referenced by hsm_ActiveFH::ActiveToList(), hsm_ReleaseCandRec::FindNextClearCurrRec(), hsm_ActiveFH::FindNextClearCurrRec(), NewWriteBackBlock(), hsm_ActiveFH::OrphanedToMigList(), hsm_ReleaseCandRec::Release(), hsm_ActiveFH::Release(), hsm_ActiveFH::Update(), and WriteBack().

                                                         {
        return fio_RelFile::WriteRec(a_index, a_buffer_p, a_numOfRec, &a_transaction_p); 
    };

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

readnext block index

read next index could be reset to minimum m_currentReadFrontIdx

Reimplemented from fio_RelFileTrans.

Definition at line 201 of file fio_CirFileTrans.h.

ofset of the first record inside block or how much record ocupy block header?

Definition at line 154 of file fio_CirFileTrans.h.

Referenced by fio_CirFileTrans(), GetRFIdxFromNextBlock(), GetRNIdxFromNextBlock(), NewWriteBackBlock(), and SetRecIndeces().

const int fio_CirFileTrans::m_buffSize [private]

Definition at line 192 of file fio_CirFileTrans.h.

Referenced by fio_CirFileTrans().

first index that will be pop by ReadFront method

Definition at line 179 of file fio_CirFileTrans.h.

Referenced by GetRFIdxFromNextBlock(), ReadFront(), ReadNextReset(), and SetRecIndeces().

Definition at line 183 of file fio_CirFileTrans.h.

Referenced by GetRNIdxFromNextBlock(), ReadFront(), ReadNext(), and ReadNextReset().

All three block heders have to be acordingly updated when another point to the same block header / memory buffered front block header, fio_CirBlockHeader_t m_frontBlockHead;.

/ memory buffered back block header, fio_CirBlockHeader_t m_backBlockHead;

/ memory buffered sequentialy read block header fio_CirBlockHeader_t m_seqReadBlockHead; index to last write location update by WriteBack method

Definition at line 176 of file fio_CirFileTrans.h.

Referenced by ReadFront(), ReadNext(), SetRecIndeces(), and WriteBack().

Definition at line 189 of file fio_CirFileTrans.h.

Referenced by fio_CirFileTrans(), and UpdateReadFrontBlockIdx().

Definition at line 188 of file fio_CirFileTrans.h.

Referenced by fio_CirFileTrans(), and UpdateWriteBackBlockIdx().

mutex to lock write back index

Definition at line 186 of file fio_CirFileTrans.h.

Referenced by ReadFront(), ReadNext(), and WriteBack().

Definition at line 193 of file fio_CirFileTrans.h.

Referenced by fio_CirFileTrans(), NewWriteBackBlock(), and ~fio_CirFileTrans().


The documentation for this class was generated from the following files: