Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

void Rst_RedoTrafficControl::AllocateContainer ( bool &  IsOk  )  [inline]

allocates the I/O sequence container and the job container

The transactions of the database are limited by NumberOfTransEntries. if every transaction is closed at a different LogPage, so everey transaction has a different IoSeq. Therefore the IoSeqContainer has NumberOfTransEntries elements. The TransIndex has a range 1..NumberOfTransEntries. To avoid arithmetic expressions when accessing the JobContainer vector, the vector consists of NumberOfTransEntries+1 elements (0 .. n+1).

Definition at line 636 of file Rst_RedoTrafficControl.cpp.

References Rst_IoSeqList::Append(), LogTrans_Trace, m_IoSeqFreeList, m_NumberOfTransEntries, m_pIoSeqContainer, m_pJobContainer, m_RawAllocator, and newarray().

Referenced by Rst_RedoAllocateTrafficControl::Allocate().

    {  
        SAPDBTRACE_METHOD_DEBUG ("Rst_RedoTraffic::AllocateContainer", LogTrans_Trace, 5);
        
        IsOk = true;
        
        if ( m_NumberOfTransEntries > 0 )
        {
            SAPDBTRACE_WRITELN (LogTrans_Trace, 6, "NOT OK (m_NumberOfTransEntries > 0)");
            IsOk = false;
            return;
        }
        
        m_NumberOfTransEntries = k51number_of_trans_entries();
        
        if ( NULL == m_pIoSeqContainer )
        {
            newarray (m_pIoSeqContainer, m_NumberOfTransEntries, m_RawAllocator);
            if (NULL == m_pIoSeqContainer)
            {
                SAPDBTRACE_WRITELN (LogTrans_Trace, 6, "NOT OK (NULL == m_pIoSeqContainer)");
                IsOk = false;
                return;
            }
        }
        
        if ( NULL == m_pJobContainer )
        {
            newarray (m_pJobContainer, m_NumberOfTransEntries, m_RawAllocator);
            if ( NULL == m_pJobContainer )
            {
                SAPDBTRACE_WRITELN (LogTrans_Trace, 6, "NOT OK (NULL == m_pJobContainer)");
                IsOk = false;
                return;
            }
        }
        
        SAPDB_UInt i;
        
        for (i = 0; i < m_NumberOfTransEntries; ++i)
            m_IoSeqFreeList.Append (m_pIoSeqContainer+i);

        for (i = 0; i < m_NumberOfTransEntries; ++i)
            (m_pJobContainer+i)->SetOwnIndex (i+1);
    }


Generated by  Doxygen 1.6.0   Back to index