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

bool cbd500_Tree::bd520LeafUnderFlow ( tsp00_KeyPtr  pKey,
tsp00_Int4  KeyLen 

function: bd520LeafUnderFlow description: This removes record space from a record, which is deleted.

The recordspace is specified by the Key. After the space is removed from the node it is calculated, if nodes might be deleted. Therefore Records are moved. The IndexNodes are restructured. POST: The PathInfo is invalid. return value: bool - true, if anything was done arguments: Key [in] specifies the Leaf

Definition at line 158 of file vbd520.cpp.

References cbd300_InvCurrentBasis::bd300LockTreeExclusive(), bd500FindNode(), bd500Print(), cbd600_Node::bd600Covering(), cbd600_Node::bd600IsRoot(), cbd600_Node::bd600Release(), cbd600_Node::m_Current, and cbd600_Node::m_TrError.

Referenced by bd530DelRecord(), and bd530UpdRecordSpace().

    ROUTINE_DBG_MEO00 ("bd520LeafUnderFlow");

    /* PTS 1106992 UH 2000-06-21 */
    /* the return value was added */

    if ( m_Node.bd600IsRoot() ||
         m_Node.bd600Covering() >= UNDER_FLOW_LIMIT_BD600 ) return false;

    /* convert current tree-lock from leaf-exclusive to tree-exclusive */

    m_Node.bd600Release (IS_CHANGED_BD600);
    if (e_ok != m_Node.m_TrError) return false;

    if ( m_Node.m_Current.bd300LockTreeExclusive() )
        if ( g01vtrace.vtrAll_gg00 || g01vtrace.vtrBdIndex_gg00 )
    if (e_ok != m_Node.m_TrError) return false;

    /* Because there were intermediately no locks on the tree.   */
    /* The leaf must be searched again, which potentially        */
    /* can have an underflow.                                    */

    bd500FindNode (pKey, KeyLen, LEAF_LEVEL_BD00);
    if (e_ok != m_Node.m_TrError) return false;

    cbd501_IndexOrders NewOrders; 
    tsp00_Int4         NumNodeDiff = 0;
    cbd600_Node        Neighbor (m_Node.m_Current, tbd_node_request::fromConst (nr_for_update));
    cbd600_Node        AuxNode  (m_Node.m_Current, tbd_node_request::fromConst (nr_for_update)); // PTS 1109619 UH 2001-03-13
    bool               bOrdersExisting; /* PTS 1106992 UH 2000-06-21 */

    if ( g01vtrace.vtrAll_gg00 && g01glob.treecheck )
        bd500Print ("bd520LeafUnderFlow"); // PTS 1112713 UH 2001-12-07

    bd520_UnderFlow (Neighbor, AuxNode, false, NumNodeDiff, NewOrders);

    bOrdersExisting = NewOrders.iosOrderCount_bd501 > 0;

    if (e_ok != m_Node.m_TrError) return bOrdersExisting;

    m_Node.m_Current.currNumLeaves_bd00 += NumNodeDiff;
    if ( bOrdersExisting )
        bd510_ExcuteOrdersOnOneLevel (NewOrders, NumNodeDiff);

    m_CurrLevel = LEAF_LEVEL_BD00;

    return bOrdersExisting;

Generated by  Doxygen 1.6.0   Back to index